Understand immudb proof data structures
masterimmudb uses a combination of Merkle Trees and linear chains to provide verifiable data integrity. Understanding these structures is essential for verifying that data has not been tampered with.
Key Data Structures
- Main Merkle Tree: A persistent tree where each leaf is a transaction hash (
Alh). It provides logarithmic complexity for proofs of historical data. - Internal Merkle Tree: A transient tree built per transaction from its Key-Value-Metadata entries. Its root hash is
EH(Entries Hash). - Linear Proof (Accumulated Linear Hash -
Alh): A linear chain of transaction hashes. Each transaction'sAlhis derived from the previous transaction'sAlh, creating a continuous chain of the entire database history.
Verification Strategy
To optimize performance, immudb uses the Main Merkle Tree to prove history up to a specific transaction (BlTxID), and then uses the Linear Proof to bridge the gap from that point to the current state. This combines logarithmic complexity for old history with linear complexity for recent, high-velocity writes.