bdk icon indicating copy to clipboard operation
bdk copied to clipboard

feat(chain): Add `verify_tx` for TxGraph

Open ValuedMammal opened this issue 1 year ago • 10 comments

Reintroduce a way to verify a transaction.

This adds a new feature to bdk_chain that uses feature bitcoin/bitcoinconsensus, and exposes the same through bdk wallet as bdk_chain/bitcoinconsensus.

closes #1180

Notes to the reviewers

Changelog notice

Checklists

All Submissions:

  • [x] I've signed all my commits
  • [x] I followed the contribution guidelines
  • [x] I ran cargo fmt and cargo clippy before committing

New Features:

  • [ ] I've added tests for the new feature
  • [ ] I've added docs for the new feature

ValuedMammal avatar Feb 12 '24 03:02 ValuedMammal

I can't decide whether we need this in bdk_chain or even in bdk_wallet. On one hand, the bitcoinconsensus API is not difficult so the caller can just import it directly and use it without much difficulty...

Would love some input on this.

evanlinjin avatar Mar 01 '24 08:03 evanlinjin

Right, I'm curious if anyone has specifically asked for this functionality in bdk.

ValuedMammal avatar Mar 08 '24 02:03 ValuedMammal

How about leaving it as a draft until we are ready to scope out a 1.1 release. Maybe by then we'll have a use case, if not we can close it. There is a scenario described in bitcoindevkit/bdk#352 where this verify functionality could be used.

notmandatory avatar Mar 12 '24 22:03 notmandatory

Ok per @LLFourn comments in #1180 I think this should stay in the 1.0.0-alpha milestone.

notmandatory avatar Mar 16 '24 01:03 notmandatory

@notmandatory I don't really have an opinion on this being in any milestone. My opinion is that the main issue is fixing RBF design. Being able to verify a transaction is also a nice to have but if no one needs it then it doesn't have to be in v1.0.0.

LLFourn avatar Mar 17 '24 22:03 LLFourn

I currently use verify_tx in an onchain trading pipeline concept to verify bond transactions that are signed but not published (except cheating occurs). While it may is possible to use bitcoinconsensus the verify_tx function was convenient to use and the bdk docs were understandable as a new bdk user.

Also the old verify_tx was not compatible with the async Esplora backend feature of bdk, maybe it makes sense to consider this in the new implementation from the beginning.

f321x avatar Jul 08 '24 19:07 f321x