Skip to content

Add SPV inclusion check that returns block heights#140

Open
olga24912 wants to merge 1 commit into
mainfrom
feat/tx_validation_and_block_number
Open

Add SPV inclusion check that returns block heights#140
olga24912 wants to merge 1 commit into
mainfrom
feat/tx_validation_and_block_number

Conversation

@olga24912
Copy link
Copy Markdown
Collaborator

Summary

  • New view method verify_transaction_inclusion_with_heights(TxInclusionProof) -> Option<TxInclusionInfo> returning the tx's block height and the current mainchain tip height in one call.
  • Existing verify_transaction_inclusion (bool, with confirmations) preserved — now delegates to the new method and applies the confirmations check on top.
  • New types in btc-types::contract_args: TxInclusionProof, TxInclusionInfo, TxBlockMeta. Existing ProofArgs is unchanged, no protocol break.

Motivation

btc-connector needs to aggregate transferred amounts per block, so it needs the tx's block height alongside the inclusion proof. It also wants to apply the confirmation-depth policy adaptively on its side rather than committing to a single threshold at call time. The new method returns both heights in a single call and avoids a follow-up query just to get the height.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant