pub struct DebugTxoProof(pub TxoProof);
Expand description
A debug wrapper around a TxoProof
Tuple Fields§
§0: TxoProof
Methods from Deref<Target = TxoProof>§
Sourcepub fn verify(
&self,
block_height: u32,
block_header: &Header,
external_block_hash: Option<&BlockHash>,
prev_filter_header: &FilterHeader,
outpoint_watches: &[OutPoint],
secp: &Secp256k1<All>,
) -> Result<(), VerifyError>
pub fn verify( &self, block_height: u32, block_header: &Header, external_block_hash: Option<&BlockHash>, prev_filter_header: &FilterHeader, outpoint_watches: &[OutPoint], secp: &Secp256k1<All>, ) -> Result<(), VerifyError>
Verify the proof. For each of the watched outpoints, check that it was proven as unspent or that a matched spending transaction was included in the SPV sub-proof. For each matched transaction, also check that its outputs were proven as unspent or that a further spending transaction was included in the SPV sub-proof.
After calling this, you can securely use [get_spending_transaction()
]
for outputs in [outpoint_watches
] or for outputs of matched spending transactions.
external_block_hash
is the block hash of the block that was provided externally
to the proof. It must be provided iff the proof is an external block proof.
Correctness argument:
- the attestation proves that the block hash was the tip of the chain at the time of the attestation
- the attestation covers the compact filter
- if there is a false positive, the whole block is included, and it can be verified via its hash
- if a spending transaction is omitted, a watched outpoint will match the compact filter and verification will fail
- if an incorrect spending transaction is included, the SPV proof will fail
Sourcepub fn filter_header(&self) -> FilterHeader
pub fn filter_header(&self) -> FilterHeader
Get the filter header for the block
Sourcepub fn spending_transaction(&self, outpoint: &OutPoint) -> Option<Transaction>
pub fn spending_transaction(&self, outpoint: &OutPoint) -> Option<Transaction>
Get the matched transaction that spends this outpoint, if it is spent in the block.
You must call [verify()
] first.
Trait Implementations§
Source§impl Debug for DebugTxoProof
impl Debug for DebugTxoProof
Source§impl Decodable for DebugTxoProof
impl Decodable for DebugTxoProof
Auto Trait Implementations§
impl Freeze for DebugTxoProof
impl RefUnwindSafe for DebugTxoProof
impl Send for DebugTxoProof
impl Sync for DebugTxoProof
impl Unpin for DebugTxoProof
impl UnwindSafe for DebugTxoProof
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> Downcast for T
impl<T> Downcast for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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