Class ProvableCSMTUtils

Collection of utility functions for compact sparse merkle tree in the circuit.

ProvableCSMTUtils

Constructors

Methods

  • Returns true if the value is in the tree and it is at the index from the key

    Type Parameters

    • K
    • V

    Parameters

    • proof: CompactSparseMerkleProof
    • expectedRoot: Field
    • key: K
    • keyType: Provable<K>
    • value: V
    • valueType: Provable<V>
    • Optional options: {
          hashKey: boolean;
          hashValue: boolean;
          treeHasher: TreeHasher<K, V>;
      } = ...

      treeHasher: The tree hasher function to use, defaults to TreeHasher.poseidon; hashKey: whether to hash the key, the default is true; hashValue: whether to hash the value, the default is true.

      • hashKey: boolean
      • hashValue: boolean
      • treeHasher: TreeHasher<K, V>

    Returns Bool

    {Bool}

    Static

    Memberof

    ProvableCSMTUtils

  • Returns true if there is no value at the index from the key

    Type Parameters

    • K
    • V

    Parameters

    • proof: CompactSparseMerkleProof
    • expectedRoot: Field
    • key: K
    • keyType: Provable<K>
    • Optional options: {
          hashKey: boolean;
          treeHasher: TreeHasher<K, V>;
      } = ...

      treeHasher: The tree hasher function to use, defaults to TreeHasher.poseidon; hashKey: whether to hash the key, the default is true

    Returns Bool

    {Bool}

    Static

    Memberof

    ProvableCSMTUtils