Class ProvableDeepSparseMerkleSubTree<K, V>

ProvableDeepSparseMerkleSubTree is a deep sparse merkle subtree for working on only a few leafs in circuit.

ProvableDeepSparseMerkleSubTree

Type Parameters

  • K
  • V

Constructors

  • Creates an instance of ProvableDeepSparseMerkleSubTree.

    Type Parameters

    • K
    • V

    Parameters

    • root: Field

      merkle root

    • keyType: Provable<K>
    • valueType: Provable<V>
    • Optional options: {
          hashKey: boolean;
          hashValue: boolean;
          hasher: Hasher;
      } = ...

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

      • hashKey: boolean
      • hashValue: boolean
      • hasher: Hasher

    Returns ProvableDeepSparseMerkleSubTree<K, V>

    Memberof

    ProvableDeepSparseMerkleSubTree

Properties

config: {
    hashKey: boolean;
    hashValue: boolean;
}

Type declaration

  • hashKey: boolean
  • hashValue: boolean
hasher: Hasher
keyType: Provable<K>
nodeStore: Map<string, Field[]>
root: Field
valueStore: Map<string, Field>
valueType: Provable<V>

Methods

  • Update a new value for a key in the tree and return the new root of the tree.

    Parameters

    • key: K
    • Optional value: V

    Returns Field

    {Field}

    Memberof

    ProvableDeepSparseMerkleSubTree