prepare_btc_rbf_bump
Replace a stuck Bitcoin mempool transaction by creating a BIP-125 RBF bump that preserves recipients and absorbs the fee increase from the change output, with clear-signing on Ledger.
Instructions
Build a BIP-125 Replace-By-Fee replacement for a stuck mempool BTC tx. Reuses the original tx's exact input set, preserves every recipient verbatim, and shrinks the change output to absorb the fee bump. Sequence stays at 0xFFFFFFFD so the replacement is itself RBF-eligible (the user can bump again if the new rate is still too low). Returns a 15-min handle the agent forwards to send_transaction; the Ledger BTC app clear-signs every output + new fee on-screen, so there is NO blind-sign hash to pre-match in chat. Refusal cases: original tx already confirmed; no input is BIP-125-eligible; any input belongs to a wallet other than wallet (multi-source RBF out of scope); no change output (no headroom to absorb the bump — CPFP territory); BIP-125 rule 4 violation (new fee must be >= old fee + 1 sat/vB × new vsize); bumped change below the 546-sat dust threshold; fee exceeds the safety cap (override with allowHighFee: true). Phase 1 source-side scope: native segwit + taproot only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet | Yes | Paired Bitcoin source address that signed the original tx. Phase 1 scope: native segwit (`bc1q...`) and taproot (`bc1p...`) only. Multi-source RBF (replacing a tx whose inputs span several wallets) is out of scope — every input on the original tx must come from this single address. | |
| txid | Yes | 64-hex txid of the stuck mempool tx to replace. Must currently be unconfirmed and BIP-125 RBF-eligible (sequence < 0xFFFFFFFE on at least one input — true by default for every tx `prepare_btc_send` produces). Already-confirmed and final-marked txs are refused. | |
| newFeeRate | Yes | New fee rate in sat/vB. Must satisfy BIP-125 rule 4: the new absolute fee must be at least the old absolute fee plus 1 sat/vB × new vsize. The replacement preserves every recipient verbatim and shrinks the change output to absorb the bump — refused if the bump would push change below the dust threshold (546 sats). | |
| allowHighFee | No | Override the fee-cap guard. The cap is `max(10 × newFeeRate × vbytes, 2% of recipient output value)`. Legitimate priority bumps through heavy congestion can exceed it; pass true after confirming with the user. |