Struct vls_protocol::msgs::DebugTxoProof
source · 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: &BlockHeader,
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: &BlockHeader, 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.