Can i program a bitcoin transaction to run when the network is not as busy or when fees are low? If you are not in a rush to complete trx.

  • 1
    I mean, you can just create the transaction with a low feerate and it will get confirmed when the feerates go that low?
    – Murch
    Sep 2 '21 at 22:27
  • If fee rate was too low it might not make it into mempools. You could certainly program a Bitcoin transaction to be broadcast once fees reach a certain level but that would be external to the actual transaction. Sep 2 '21 at 23:13

This is not something you can do at the protocol level, but you probably don't need it. Once you broadcast a transaction, each bitcoin node will hold it in its memory pool until the transaction is confirmed or until the node decides to drop it from its mempool.

Nodes can drop your transaction when maximum mempool size is reached and transactions below a certain fee rate need to be pruned away, or after a certain amount of time passes without the transaction getting confirmed. In Bitcoin Core by default the maximum mempool size is 300 MB and transaction expire time is 2 weeks, although each node can set this to whatever they like.

This means that if your transaction fee is high enough to get your transaction confirmed within 2 weeks and the network congestion isn't at a level where your transaction would get pruned from the mempool, you can simply broadcast your transaction and wait for it to be confirmed. Of course, if this isn't enough for you, there's nothing preventing you from writing a script that would periodically check the network fee rate and broadcast your transaction when fees are low.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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