So what are Merkle Trees?

Merkle trees are one of many tools used by cryptographers to guarantee that in distributed networks (such as Blockchains) each and every single node — wherever they may be — is aware of the current state of the entire network. It is one of the vital components of the blockchain’s “database” .

A Merkle Tree looks like this

In this picture you can see that 4 transactions are made, transaction A, B, C and D. And their respective hashes are stored in the Merkle Tree (we call these leafs) of which further combinations are also hashed until only a Root Hash remains. Note: Hashing produces a shorter hashed key that is quicker and easier to find than the original value.

In the blockchain, only the Root Hash is stored. Every node that connects to the blockchain needs to reconstruct everything that has happened (we call that reconstructing the state). The Root Hash can be used by these nodes to check that their state has been correctly calculated.

Applicability in practice

Through Merkle Trees we can efficiently share which transaction outputs are unspent, the chain history, and even the account state and smart contract storage.

Concluding

Kelvin is a layer that separates Merkle tree data structures from the DB backend. We have created Kelvin to reduce a lot of the overhead caused by DBs that are designed for mutable data structures. Kelvin introduces optimizations for append-only operations and makes it easy to swap between various types of DS and DBs at will. The latter is useful since traditionally the type of Merkle Tree / DS used creates inflexibility in regards to which DBs you could choose from.

You can read more about Kelvin on our Github (click!)

About Dusk Network

Dusk Network is an open-source and privacy-oriented blockchain based on years of academic research. You can use Dusk Network to create smart contracts that control digital assets and securities.