Class CSMTUtils

Collection of utility functions for compact sparse merkle tree

Hierarchy

  • CSMTUtils

Constructors

Methods

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

    Static

    Returns

    {boolean}

    Memberof

    CSMTUtils

    Type Parameters

    • K

    • V

    Parameters

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

    Returns boolean

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

    Static

    Returns

    {boolean}

    Memberof

    CSMTUtils

    Type Parameters

    • K

    • V

    Parameters

    • proof: CompactSparseMerkleProof
    • expectedRoot: Field
    • key: K
    • keyType: Provable<K>
    • Optional options: {
          hashKey: boolean;
          hasher: Hasher;
      } = ...
      • hashKey: boolean
      • hasher: Hasher

    Returns boolean

  • Verify Compact Proof for Compact Sparse Merkle Tree

    Static

    Returns

    {boolean}

    Memberof

    CSMTUtils

    Type Parameters

    • K

    • V

    Parameters

    • cproof: CSparseCompactMerkleProof
    • expectedRoot: Field
    • key: K
    • keyType: Provable<K>
    • Optional value: V
    • Optional valueType: Provable<V>
    • Optional options: {
          hashKey: boolean;
          hashValue: boolean;
          hasher: Hasher;
      } = ...
      • hashKey: boolean
      • hashValue: boolean
      • hasher: Hasher

    Returns boolean

  • Verify Proof of Compact Sparse Merkle Tree

    Static

    Returns

    {boolean}

    Memberof

    CSMTUtils

    Type Parameters

    • K

    • V

    Parameters

    • proof: CompactSparseMerkleProof
    • root: Field
    • key: K
    • keyType: Provable<K>
    • Optional value: V
    • Optional valueType: Provable<V>
    • Optional options: {
          hashKey: boolean;
          hashValue: boolean;
          hasher: Hasher;
      } = ...
      • hashKey: boolean
      • hashValue: boolean
      • hasher: Hasher

    Returns boolean

  • Verify a merkle proof, return result and updates.

    Static

    Returns

    {({ ok: boolean; updates: [Field, Field[]][] | null; })}

    Memberof

    CSMTUtils

    Type Parameters

    • K

    • V

    Parameters

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

    Returns {
        ok: boolean;
        updates: null | [Field, Field[]][];
    }

    • ok: boolean
    • updates: null | [Field, Field[]][]

Generated using TypeDoc