Describe the bug
When a v3 (TRUC) transaction produces a change output back into the BDK wallet, that unconfirmed output enters BDK's UTXO pool like any other coin. Bitcoin Core's TRUC policy (BIP-431) requires that any transaction spending an unconfirmed v3 output must itself be v3. BDK's coin selection is unaware of this constraint and freely includes unconfirmed v3 change outputs when building standard v2 transactions, which bitcoind then rejects with TRUC-violation, non-version=3 tx cannot spend from version=3 tx.
Once the v3 parent confirms, its outputs become ordinary UTXOs spendable by any transaction version — so the issue only manifests while the v3 parent is still in the mempool.
To Reproduce
- Create and broadcast a v3 (TRUC) transaction that returns change to the BDK wallet (e.g. a CPFP child for an Ark exit).
- Sync the wallet so BDK sees the unconfirmed v3 change output.
- Use TxBuilder to build a standard (v2) transaction — BDK's coin selection may pick the unconfirmed v3 output.
- Sign and broadcast → bitcoind rejects with:
sendrawtransaction RPC error -26: TRUC-violation, non-version=3 tx <v2_txid> cannot spend from version=3 tx <v3_txid>
Expected behavior
BDK should either:
- Automatically exclude unconfirmed v3 outputs from coin selection when building non-v3 transactions, or
- Expose enough metadata (parent transaction version) for callers to filter them out, or
- Provide a TxBuilder option to exclude UTXOs whose unconfirmed parent is v3
Note: TxBuilder::exclude_unconfirmed (added in 2.1.0) is a partial workaround but too broad — it excludes unconfirmed UTXOs, not just those subject to TRUC rules.
Build environment
- BDK tag/commit: bdk_wallet 2.1.0
- OS+version: macOS 26.3.1 (aarch64)
- Rust/Cargo version: 1.90.0
- Rust/Cargo target: aarch64-apple-darwin
Which backend(s) are relevant (if any)?
Is this blocking production use?
Project or organization (optional)
Ark (Second) — during Ark exits, a CPFP child (v3) is broadcast to bump the exit transaction. Its change output lands in the on-chain wallet, and any subsequent on-chain send fails until the CPFP confirms. Exit tx can claimed/secured once the CPFP confirms.
Additional context
Reproduction evidence from signet:
VTXO exited: d4c0eb4e49a064c6d8224efe4e384aa9c8f746dc785ba7cfe07c5204560120a3:0
CPFP child: 77274504eae4eeb0d82af9cee679cad918c67f9b64a40764450ec41caa0c354c
Change UTXO: 77274504...354c:0 (9723 sat, unconfirmed, v3)
Failed send: a7d53ec248ecdd0d264589657ddfa054052e2e4d90e06b99e5d26d4eb0395b74 (non-v3)
Error: "sendrawtransaction RPC error -26: TRUC-violation, non-version=3 tx a7d53ec2...
cannot spend from version=3 tx 77274504..."
Describe the bug
When a v3 (TRUC) transaction produces a change output back into the BDK wallet, that unconfirmed output enters BDK's UTXO pool like any other coin. Bitcoin Core's TRUC policy (BIP-431) requires that any transaction spending an unconfirmed v3 output must itself be v3. BDK's coin selection is unaware of this constraint and freely includes unconfirmed v3 change outputs when building standard v2 transactions, which bitcoind then rejects with
TRUC-violation, non-version=3 tx cannot spend from version=3 tx.Once the v3 parent confirms, its outputs become ordinary UTXOs spendable by any transaction version — so the issue only manifests while the v3 parent is still in the mempool.
To Reproduce
sendrawtransaction RPC error -26: TRUC-violation, non-version=3 tx <v2_txid> cannot spend from version=3 tx <v3_txid>Expected behavior
BDK should either:
Note:
TxBuilder::exclude_unconfirmed(added in 2.1.0) is a partial workaround but too broad — it excludes unconfirmed UTXOs, not just those subject to TRUC rules.Build environment
Which backend(s) are relevant (if any)?
bdk_chain,bdk_core)____Is this blocking production use?
Project or organization (optional)
Ark (Second) — during Ark exits, a CPFP child (v3) is broadcast to bump the exit transaction. Its change output lands in the on-chain wallet, and any subsequent on-chain send fails until the CPFP confirms. Exit tx can claimed/secured once the CPFP confirms.
Additional context
Reproduction evidence from signet: