All Projects → cosmos → Iavl

cosmos / Iavl

Licence: apache-2.0
Merkleized IAVL+ Tree implementation in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Iavl

Firo
The privacy-focused cryptocurrency
Stars: ✭ 528 (+168.02%)
Mutual labels:  blockchain, merkle-tree, cryptography
Exonum Client
JavaScript client for Exonum blockchain
Stars: ✭ 62 (-68.53%)
Mutual labels:  blockchain, merkle-tree, cryptography
Lightning Rfc
Lightning Network Specifications
Stars: ✭ 1,224 (+521.32%)
Mutual labels:  blockchain, cryptography
Tokenscript
TokenScript schema, specs and paper
Stars: ✭ 89 (-54.82%)
Mutual labels:  blockchain, cryptography
Blockchain Crypto Mpc
Protecting cryptographic signing keys and seed secrets with Multi-Party Computation.
Stars: ✭ 193 (-2.03%)
Mutual labels:  blockchain, cryptography
Savjeecoin
A simple blockchain in Javascript. For educational purposes only.
Stars: ✭ 1,097 (+456.85%)
Mutual labels:  blockchain, cryptography
Waykichain
Public Blockchain as a Decentralized Finance Infrastructure Service Platform
Stars: ✭ 1,117 (+467.01%)
Mutual labels:  blockchain, cryptography
Brightid
Reference mobile app for BrightID
Stars: ✭ 101 (-48.73%)
Mutual labels:  blockchain, cryptography
Merkle Tools
Tools for creating Merkle trees, generating merkle proofs, and verification of merkle proofs.
Stars: ✭ 54 (-72.59%)
Mutual labels:  merkle-tree, cryptography
Merkle Tree
Merkle Trees and Merkle Inclusion Proofs
Stars: ✭ 130 (-34.01%)
Mutual labels:  merkle-tree, cryptography
Multi Party Schnorr
Rust implementation of multi-party Schnorr signatures over elliptic curves.
Stars: ✭ 115 (-41.62%)
Mutual labels:  blockchain, cryptography
Cryptokernel
A SDK for implementing blockchain-based digital currencies
Stars: ✭ 146 (-25.89%)
Mutual labels:  blockchain, cryptography
Coniks Java
A CONIKS implementation in Java
Stars: ✭ 58 (-70.56%)
Mutual labels:  merkle-tree, cryptography
Skale Network
Elastic sidechains
Stars: ✭ 58 (-70.56%)
Mutual labels:  blockchain, cryptography
Ipfsfb
InterPlanetary File System for Business (IPFSfB) is an enterprise blockchain storage network based on InterPlanetary File System.
Stars: ✭ 57 (-71.07%)
Mutual labels:  blockchain, cryptography
Library
Collection of papers in the field of distributed systems, game theory, cryptography, cryptoeconomics, zero knowledge
Stars: ✭ 100 (-49.24%)
Mutual labels:  blockchain, cryptography
Blockchain Java
A simplified blockchain implementation in Java
Stars: ✭ 160 (-18.78%)
Mutual labels:  blockchain, merkle-tree
Exonum
An extensible open-source framework for creating private/permissioned blockchain applications
Stars: ✭ 1,037 (+426.4%)
Mutual labels:  blockchain, cryptography
Waves
⛓️ Reference Waves Blockchain Node (client) implementation on Scala
Stars: ✭ 1,077 (+446.7%)
Mutual labels:  blockchain, cryptography
Coniks Go
A CONIKS implementation in Golang
Stars: ✭ 102 (-48.22%)
Mutual labels:  merkle-tree, cryptography

IAVL+ Tree

version license API Reference codecov Lint Test Discord chat

Note: Requires Go 1.13+

A versioned, snapshottable (immutable) AVL+ tree for persistent data.

The purpose of this data structure is to provide persistent storage for key-value pairs (say to store account balances) such that a deterministic merkle root hash can be computed. The tree is balanced using a variant of the AVL algorithm so all operations are O(log(n)).

Nodes of this tree are immutable and indexed by their hash. Thus any node serves as an immutable snapshot which lets us stage uncommitted transactions from the mempool cheaply, and we can instantly roll back to the last committed state to process transactions of a newly committed block (which may not be the same set of transactions as those from the mempool).

In an AVL tree, the heights of the two child subtrees of any node differ by at most one. Whenever this condition is violated upon an update, the tree is rebalanced by creating O(log(n)) new nodes that point to unmodified nodes of the old tree. In the original AVL algorithm, inner nodes can also hold key-value pairs. The AVL+ algorithm (note the plus) modifies the AVL algorithm to keep all values on leaf nodes, while only using branch-nodes to store keys. This simplifies the algorithm while keeping the merkle hash trail short.

In Ethereum, the analog is Patricia tries. There are tradeoffs. Keys do not need to be hashed prior to insertion in IAVL+ trees, so this provides faster iteration in the key space which may benefit some applications. The logic is simpler to implement, requiring only two types of nodes -- inner nodes and leaf nodes. On the other hand, while IAVL+ trees provide a deterministic merkle root hash, it depends on the order of transactions. In practice this shouldn't be a problem, since you can efficiently encode the tree structure when serializing the tree contents.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].