3

I have a 3 days old unconfirmed Bitcoin transaction that has 13 inputs, 2 outputs and a low fee.

I want to remove the small value inputs because as it increases the size, it also increases the minimum fee needed for the transaction to be confirmed and it's not worth to include them.

https://www.blockchain.com/explorer/transactions/btc/4ec9b5b267fd4e58137d805544dbb6728f2f0a69df5913b6266405790092be58

So I would like a transaction to replace the above one and only include these 2 inputs

  • 0.09980000 BTC (bc1q5mzf7fhs8h4vz28aerd464wsswxys9qalm63jj)
  • 0.00040000 BTC (bc1qgq84rlg2mgjz39cg8hqu0fz398830zk42lvcx5)

How can I achieve this using the Bitcoin Core Windows client console ?

Also, how about the low value inputs, are there anyways of consolidating them into a single wallet so I can make any use of them?

Thanks

2 Answers 2

2

I think this should work (this is from just looking at the API, I have not tested this flow):

Use createrawtransaction to specify the two inputs you want to use and the recipient output. Use the resulting hex in fundrawtransaction with add_inputs: false to specify the fee_rate and automatically create a change output. Verify that the resulting transaction matches your intent. Then call signrawtransaction and sendrawtransaction.

If any of this gives you grief about the inputs already being spent, you may need to call abandontransaction on the transaction you’re trying to replace.

I think you could also use createrawtransaction to do it all, but in that case you need to explicitly define the change output (and to know the amount for the latter, manually calculate the appropriate fee).

0

Save these nodes in config and run bitcoin core with mempoolfullrbf=1:

addnode=full-rbf1.btc.petertodd.net
addnode=full-rbf2.btc.petertodd.net
addnode=full-rbf3.btc.petertodd.net
addnode=full-rbf4.btc.petertodd.net

Use walletcreatefundedpsbt to create a transaction with 2 inputs, 1 output and appropriate fee rate. Finalize and broadcast this transaction to replace earlier transaction.

1
  • 3
    The transaction already signals for RBF so there is no need for preferential peering. And walletcreatefundedpsbt would not re-spend coins already spent by an unconfirmed transaction. May 10, 2023 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.