gb_merkle_trees Erlang library has been released. It provides a dictionary-like storage for binaries using general balanced binary Merkle trees.
Its interface and mechanism are similar to stdlib’s
gb_trees, with a notable difference that all trees are also Merkle trees. What follows, values are stored only on leaf nodes. Having an agreement only on the root hash of a tree, one can prove that a particular key and value combination belongs to the tree.
Applications include storing states for blockchains — see Tendermint’s Application Blockchain Interface which represents application state as Merkle root hash.
Patches, comments and other feedback are welcome.