Crate penumbra_tct

source ·
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 Commitment

Modules

  • Builders for individual epochs and blocks: useful when constructing a Tree in parallel, but unnecessary in a single thread.
  • Errors that can occur when inserting into a Tree, deserializing Proofs, or checking internal invariants.
  • The internal implementation of the tree, exposed here for documentation.
  • This module defines how to verify TCT auth paths in a rank-1 constraint system.
  • Incremental serialization and non-incremental deserialization for the Tree.
  • A dynamic representation of nodes within the internal tree structure.
  • Validation checks to ensure that Trees are well-formed.

Structs

Enums

  • When inserting a Commitment into a Tree, should we Keep it to allow it to be witnessed later, or Forget about it after updating the root hash of the tree?

Statics

  • 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).