pub struct OrchardWitness(/* private fields */);
Expand description
A cryptographic witness proving that a Orchard note commitment exists in the note commitment tree.
OrchardWitness
is a specialized form of incremental Merkle tree witness for the
Orchard protocol. It proves that a specific note commitment is included in the
global Orchard note commitment tree, which is necessary when spending a note.
§Zcash Concept Relation
In Zcash’s Orchard protocol:
- Note Commitment Tree: A Merkle tree containing all Orchard note commitments
- Merkle Path: The path from a leaf (note commitment) to the root of the tree
- Witness: The authentication path proving a leaf exists in the tree
- Anchors: Root hashes of the note commitment tree at specific blockchain heights
When spending a Orchard note, a zero-knowledge proof must demonstrate that the note’s commitment exists in the tree at a specific anchor (root hash), without revealing which specific commitment is being spent. The witness provides the necessary path information to create this proof.
§Data Preservation
During wallet migration, complete witness data must be preserved for all unspent notes. This includes:
- The authentication path (sequence of hashes forming the Merkle path)
- The position of the note commitment in the tree
- The tree depth used (32 for Orchard)
Without this witness data, unspent notes cannot be spent as it would be impossible to prove their inclusion in the note commitment tree.
Trait Implementations§
Source§impl Clone for OrchardWitness
impl Clone for OrchardWitness
Source§fn clone(&self) -> OrchardWitness
fn clone(&self) -> OrchardWitness
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OrchardWitness
impl Debug for OrchardWitness
Source§impl From<OrchardWitness> for Envelope
impl From<OrchardWitness> for Envelope
Source§fn from(value: OrchardWitness) -> Self
fn from(value: OrchardWitness) -> Self
Source§impl PartialEq for OrchardWitness
impl PartialEq for OrchardWitness
Source§impl TryFrom<Envelope> for OrchardWitness
impl TryFrom<Envelope> for OrchardWitness
impl Eq for OrchardWitness
impl StructuralPartialEq for OrchardWitness
Auto Trait Implementations§
impl Freeze for OrchardWitness
impl RefUnwindSafe for OrchardWitness
impl Send for OrchardWitness
impl Sync for OrchardWitness
impl Unpin for OrchardWitness
impl UnwindSafe for OrchardWitness
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> EnvelopeEncodable for T
impl<T> EnvelopeEncodable for T
Source§fn into_envelope(self) -> Envelope
fn into_envelope(self) -> Envelope
Converts the value into an envelope by using its Into<Envelope>
implementation.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more