-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reintroduce a way verify a transaction #1180
Comments
Automated payjoin receivers must check that the "original psbt" transaction to be augmented can be broadcast as fallback in case the sender doesn't broadcast the payjoin they propose so that they can still get paid in the failure case. This function is useful in that case, and I'd hope to see a reference to That RPC also tests against the UTXO set which is important for this use case. |
Should this be a new build feature in bdk, or should we just include the bitcoinconsensus feature in the dependency for rust-bitcoin? rust bitcoin offers what looks like a fairly convenient API as a method on If we want something more granular, we would likely want to pull in rust-bitcoinconsensus as a new dep. As a first step, I like the idea of making pub fn verify_tx(&self, tx: &Transaction) -> Result<(), VerifyTxError> {
tx.verify(|op: &OutPoint| -> Option<TxOut> { self.tx_graph().get_txout(*op).cloned() })
.map_err(VerifyTxError::BitcoinConsensus)
} |
This |
There's some more discussion for the original feature in #352. |
@notmandatory this is very relevant to #1374. The problem we should solve here is the RBF feature being mis-designed. You shouldn't just RBF a transaction by looking at the inputs and outputs without understanding the semantics of it. How do we know which outputs and inputs have to be there and which can we change. We guess and provide awkward APIs to let the developer hint us ( |
I see how this is valuable especially since we had it in the pre-1.0.0 wallet API, so I agree this should stay in the 1.0.0-alpha milestone. |
Since this can be enabled with a new feature flag without an api change I propose we move this to a post 1.0 milestone. |
Describe the enhancement
In pre-1.0 there was a function to verify a transaction against consensus rules and there should also be a convenient way to do this in BDK 1.0.
See original function
bdk::wallet::verify::verify_tx
.Use case
This function is useful for verifying a transaction is valid before broadcasting it.
Additional context
https://docs.rs/bdk/latest/src/bdk/wallet/verify.rs.html#34-73
The text was updated successfully, but these errors were encountered: