Expand description
The tiered commitment tree for Penumbra.
Eternity┃ ╱╲ ◀───────────── Anchor
Tree┃ ╱││╲ = Global Tree Root
┃ * ** * ╮
┃ * * * * │ 8 levels
┃ * * * * ╯
┃ ╱╲ ╱╲ ╱╲ ╱╲
┃ ╱││╲ ╱││╲ ╱││╲ ╱││╲ ◀─── Global Tree Leaf
▲ = Epoch Root
┌──┘
│
│
Epoch┃ ╱╲ ◀───────────── Epoch Root
Tree┃ ╱││╲
┃ * ** * ╮
┃ * * * * │ 8 levels
┃ * * * * ╯
┃ ╱╲ ╱╲ ╱╲ ╱╲
┃ ╱││╲ ╱││╲ ╱││╲ ╱││╲ ◀─── Epoch Leaf
▲ = Block Root
└───┐
│
│
Block┃ ╱╲ ◀───────────── Block Root
Tree┃ ╱││╲
┃ * ** * ╮
┃ * * * * │ 8 levels
┃ * * * * ╯
┃ ╱╲ ╱╲ ╱╲ ╱╲
┃ ╱││╲ ╱││╲ ╱││╲ ╱││╲ ◀─── Block Leaf
= Note CommitmentModules§
- builder
- Builders for individual epochs and blocks: useful when constructing a
Treein parallel, but unnecessary in a single thread. - error
- Errors that can occur when inserting into a
Tree, deserializingProofs, or checking internal invariants. - internal
internal - The internal implementation of the tree, exposed here for documentation.
- r1cs
r1cs - This module defines how to verify TCT auth paths in a rank-1 constraint system.
- storage
- Incremental serialization and non-incremental deserialization for the
Tree. - structure
- A dynamic representation of nodes within the internal tree structure.
- validate
- Validation checks to ensure that
Trees are well-formed.
Structs§
- Forgotten
internal - A version tracking when a particular piece of the tree was explicitly forgotten.
- Position
- The index of a [
Commitment] within aTree. - Proof
- A proof of the inclusion of some [
Commitment] in aTreewith a particularRoot. - Root
- The root hash of a
Tree. - State
Commitment - A commitment to a note or swap.
- Tree
- A sparse merkle tree witnessing up to 65,536 epochs of up to 65,536 blocks of up to 65,536
[
Commitment]s.
Enums§
- Witness
- When inserting a
Commitmentinto aTree, should weKeepit to allow it to be witnessed later, orForgetabout it after updating the root hash of the tree?
Statics§
- DOMAIN_
SEPARATOR internal - The domain separator used for leaves in the tree, and used as a base index for the domain
separators of nodes in the tree (nodes get a domain separator of the form
DOMAIN_SEPARATOR + HEIGHT).