-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Labels
merkleRelated to Merkle trees or MMRsRelated to Merkle trees or MMRs
Description
In miden-base, we have AssetWitness
(which wraps an SmtProof
) define the following method:
/// Returns an iterator over every inner node of this witness' merkle path.
pub fn authenticated_nodes(&self) -> impl Iterator<Item = InnerNodeInfo> + '_ {
self.0
.path()
.authenticated_nodes(self.0.leaf().index().value(), self.0.leaf().hash())
.expect("leaf index is u64 and should be less than 2^SMT_DEPTH")
}
and similarly, AccountWitness
(which conceptually wraps an SmtProof
) define the following method:
/// Returns an iterator over every inner node of this witness' merkle path.
pub fn authenticated_nodes(&self) -> impl Iterator<Item = InnerNodeInfo> + '_ {
let leaf = self.leaf();
self.path()
.authenticated_nodes(leaf.index().value(), leaf.hash())
.expect("leaf index is u64 and should be less than 2^SMT_DEPTH")
}
It would be great to have this be available on SmtProof
directly, e.g. SmtProof::authenticated_nodes
.
This came up in 0xMiden/miden-base#1848.
Metadata
Metadata
Assignees
Labels
merkleRelated to Merkle trees or MMRsRelated to Merkle trees or MMRs