> For the complete documentation index, see [llms.txt](https://gotolabs.gitbook.io/merklepatriciatrie/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gotolabs.gitbook.io/merklepatriciatrie/util/nibble.md).

# Nibble

### 📖 Definition:

A [`nibble`](https://github.com/Aleksao998/MerklePatriciaTrie/blob/main/trie/nibble/nibble.go) is a 4-bit unit of data, representing half a byte or, equivalently, one hexadecimal digit. In the context of the MPT, nibbles are instrumental in the efficient encoding of keys, ensuring a more refined and organized trie structure.

### 📌 Key Characteristics:

1. **Compact Representation**: Nibbles offer a middle ground between bits and bytes, allowing for a compact yet expressive way to depict data, particularly in scenarios like the MPT where precision in key encoding matters.
2. **Hexadecimal Mapping**: Each nibble can represent a single hexadecimal digit, ranging from 0-F. This mapping makes it intuitive to understand and visualize, especially when debugging or analyzing trie structures.
3. **Key Conversion for Traversal**: In MPT operations, keys typically begin as byte arrays (`[]byte`). However, for a more precise and granular traversal, these keys are converted into an array of nibbles (`[]nibble`). This conversion facilitates the trie's iterative process, enabling a step-by-step movement through the structure using each individual nibble.
