# Merkle Partricia Trie

# What

Merkle Patricia Trie (MPT) is an implementation to satisfy the following requirements.

  1. It is a key-value store.
  2. This k-v store can quickly verify if a key is inside, simply from the root hash.
  3. The k-v store can get the value if key is inside simply from the root hash if the key-value store has not been updated.

# Implementation

# Data Structures

type Node interface {
    Hash() []byte
    Raw() []interface{}
}

type Trie struct {
    root Node
}

func (t *Trie) Hash() []byte {
    return t.root.hash()
}

// nibbles are only ints from 0-15. It is breaking every byte into two 0-15 parts.
type Nibble byte 

func (t *Trie) Put(key []byte, value[]byte) {
    
}

func (t *Trie) Get(key []byte) (proof []byte, bool) {
    node := t.root

}

# References

  1. see the yellow paper (very hard to understand)
  2. Read this article
  3. Read this repo