mssmt

A high-performance Merkle-Sum Sparse Merkle Tree.
git clone git://git.jtobin.io/mssmt.git
Log | Files | Refs | README | LICENSE | git.jtobin.io

MSSMT.hs (875B)


      1 {-# OPTIONS_HADDOCK prune #-}
      2 
      3 -- |
      4 -- Module: Data.MSSMT
      5 -- Copyright: (c) 2026 Jared Tobin
      6 -- License: MIT
      7 -- Maintainer: Jared Tobin <jared@jtobin.io>
      8 --
      9 -- High-performance, in-memory merkle-sum sparse merkle trees (MS-SMTs).
     10 --
     11 -- An MS-SMT has 2^256 leaves, addressed by 256-bit keys. Each leaf
     12 -- holds a value and a sum, and each branch commits to its children
     13 -- and to the sum of their sums. Branches can commit to their children
     14 -- in one of two ways, each with its own tree type:
     15 --
     16 -- * "Data.MSSMT.Split": each branch commits to the hash and sum of
     17 --   each of its children. This is the default, re-exported here.
     18 --
     19 -- * "Data.MSSMT.Aggregate": each branch commits to its children's
     20 --   hashes and the sum of their sums, as in Taproot Assets.
     21 
     22 module Data.MSSMT (
     23     module Data.MSSMT.Split
     24   ) where
     25 
     26 import Data.MSSMT.Split
     27 import Prelude hiding (lookup)