#tree #commitment #epoch #leaf #penumbra #root #block

penumbra-sdk-tct

The tiered commitment tree for Penumbra

1 unstable release

new 0.82.0-alpha.0 Dec 26, 2024

#2 in #penumbra

Download history 114/week @ 2024-12-21

114 downloads per month
Used in 26 crates (17 directly)

MIT/Apache

4.5MB
103K SLoC

penumbra-tct

The tiered state commitment tree for Penumbra.


lib.rs:

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

Builders for individual epochs and blocks: useful when constructing a Tree in parallel, but unnecessary in a single thread. Build individual epochs to insert into Trees. Build individual blocks to insert into epoch::Builders or Trees.

Dependencies

~38MB
~701K SLoC