aztec-nr - noir_aztec::protocol::data

Function public_data_storage_read

pub fn public_data_storage_read(
    public_data_tree_root: Field,
    public_data_leaf_slot: Field,
    witness: MembershipWitness<40>,
    leaf_preimage: PublicDataTreeLeafPreimage,
) -> Field

Read the value from public storage at the given leaf_slot.

Parameters:

  • public_data_tree_root: The root of the public data tree.
  • public_data_leaf_slot: The slot of the leaf in the public data tree.
  • witness: A hint to prove that the leaf_preimage exists in the tree.

The slot could either exist (has been initialized) in the tree or not:

  • If it's in the tree, leaf_preimage should be the preimage for the slot.
  • If it's not in the tree, leaf_preimage should be the preimage for the low leaf of the slot.

Returns:

  • Field: The value read from the public data tree.