MerkleMap
Constructors
new MerkleMap()
new MerkleMap(): MerkleMap
Creates a new, empty Merkle Map.
Returns
A new MerkleMap
Source
Properties
tree
tree: MerkleTree;
Source
Methods
_keyToIndex()
_keyToIndex(key: Field): bigint
Parameters
• key: Field
Returns
bigint
Source
get()
get(key: Field): Field
Returns a value given a key. Values are by default Field(0).
Parameters
• key: Field
The key to get the value from.
Returns
The value stored at the key.
Source
getRoot()
getRoot(): Field
Returns the root of the Merkle Map.
Returns
The root of the Merkle Map.
Source
getWitness()
getWitness(key: Field): MerkleMapWitness
Returns a circuit-compatible witness (also known as Merkle Proof or Merkle Witness) for the given key.
Parameters
• key: Field
The key to make a witness for.
Returns
A MerkleMapWitness, which can be used to assert changes to the MerkleMap, and the witness's key.
Source
set()
set(key: Field, value: Field): void
Sets a key of the merkle map to a given value.
Parameters
• key: Field
The key to set in the map.
• value: Field
The value to set.
Returns
void