feat(chain): Add verify_tx for TxGraph#1339
feat(chain): Add verify_tx for TxGraph#1339ValuedMammal wants to merge 3 commits intobitcoindevkit:masterfrom
verify_tx for TxGraph#1339Conversation
verify_tx for TxGraphverify_tx for TxGraph
|
I can't decide whether we need this in Would love some input on this. |
|
Right, I'm curious if anyone has specifically asked for this functionality in bdk. |
|
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 #352 where this verify functionality could be used. |
|
Ok per @LLFourn comments in bitcoindevkit/bdk_wallet#127 I think this should stay in the 1.0.0-alpha milestone. |
|
@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. |
|
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. |
* Add feature `bitcoinconsensus` to Cargo.toml
Check we can verify a transaction when `TxGraph` has knowledge of the coins being spent. Also check that verification fails either due to missing prevouts or a malformed input.
* Add feature `bitcoinconsensus` to Cargo.toml
bc589b6 to
4bd918a
Compare
verify_tx for TxGraphverify_tx for TxGraph
|
Rebased on 4942cc6 |
|
Dunno if we should expand the scope of this PR but I'd expect there to be a way to construct a tx_graph such that every tx is verified in so far as the input spks are already available. Probably want to make this available for I'd guess this is actually what a user wants here to just have blanket protection against a malicious server trying to make it appear as though inputs that have not been spent are in fact spent. |
Want to note that you probably don't want to lean to much on |
For this we could implement a simplified version of Core's mining logic for package selection (miner.cpp) and leverage the existing features of |
|
Removing from 1.1 milestone since this is still in draft. |
|
Reminder: the |
Reintroduce a way to verify a transaction.
This adds a new feature to
bdk_chainthat uses featurebitcoin/bitcoinconsensus, and exposes the same through bdk wallet asbdk_chain/bitcoinconsensus.closes bitcoindevkit/bdk_wallet#127
Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: