-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Describe the bug
In Bark we create TRUC transactions using ephemeral anchors to perform unilateral exits. The parent transaction in the TRUC originates outside of the wallet and we use BDK's tx builder to create a child transaction that spends the P2A output. Currently the fee system can't calculate the effective fee rate of the TRUC package and that is fine, we work around it by looping and calculating an absolute fee based on the generated child transaction.
The problem we do have is that if we wish to RBF the child transaction from the same users wallet we are unable to use build_fee_bump because the P2A spend input doesn't originate from the users wallet. Unfortunately I can't find a method to remove the unconfirmed TRUC child from the wallet to then generate a new one and reuse the existing UTXOs. This puts us in a situation where we have to recommend users keep multiple UTXOs spare for the purpose of fee bumping which isn't necessarily ideal in an emergency unilateral exit situation.
To Reproduce
- Create a transaction with a ephemeral anchor output outside the wallet
- Use
build_txto start building a new transaction with the wallet - Use
add_foreign_utxoto add the P2A spend as an input into the child transaction - Finish creating the transaction and persist it in the wallet
- Use
build_fee_bumpto create an RBF transaction with the TX ID of the newly created child transaction - Notice that an error is returned because the origin of the P2A spend input isn't the wallet itself
Expected behavior
If I use a foreign UTXO when building a transaction I should be able to use build_fee_bump to RBF the newly built transaction. Having some way to specify an input as foreign to bypass the UTXO checks would be ideal, alternatively if I could remove the unconfirmed transaction from the history of the wallet entirely that would also be helpful.
Build environment
- BDK tag/commit: v2.1.0
- OS+version: MacOS 15.5
- Rust/Cargo version 1.88
- Rust/Cargo target: aarch64-apple-darwin
Which backend(s) are relevant (if any)?
- Electrum
- Esplora
- Bitcoin Core RPC
- None / not backend-related (e.g.
bdk_chain,bdk_core) - Other (please specify):
____
Is this blocking production use?
- Yes
- No
Project or organization (optional)
Second
Additional context
Some logs showing the error:
Attempting to bump the fee of wallet tx b7572a182ccf392634a5178010cfd4e48bee7ccb72b58a0e8d086c5e87810e7e for exit 48a0caba9f5ec585d1c26e5c9edf3c36cf26e7f66b7254e044e33f1ed85233e4
Error creating signed P2A CPFP: Failed to bump wallet tx b7572a182ccf392634a5178010cfd4e48bee7ccb72b58a0e8d086c5e87810e7e: UTXO not found in the internal database with txid: 48a0caba9f5ec585d1c26e5c9edf3c36cf26e7f66b7254e044e33f1ed85233e4, vout: 1
Links to our code:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status