Difference between revisions of "Fee sniping"

From Bitcoin Wiki
Jump to: navigation, search
(Create page)
(No difference)

Revision as of 12:28, 10 June 2021

Fee sniping is a hypothetical outcome of bad incentives to bitcoin mining in the low-inflation future.

For a large miner the value of the transactions in the best block and the mempool can be exceeded by the cost of deliberately attempting to mine two blocks to orphan the best block. However with anti-fee-sniping protection using nLockTime or nSequence the bad miner will soon run out of transactions that can be put in the first block, which means they now need to go in the second. Anti-fee-sniping adds to the incentive to move the blockchain forward.

The nLockTime field is being used this way today. It is implemented in Bitcoin Core[1] and Electrum[2], and adopted by approximately 20% of all transactions[3] as of 2021.

As of 2021 the subsidy is high enough, and transaction volume low enough, that fee sniping isn't a problem yet, but by implementing a fix now we ensure code won't be written that makes assumptions about nLockTime that preclude a fix later.

The widespread use of nLockTime and nSequence also provides a greater anonymity set for transactions which use these fields to implement smart contracts. For example if an observer of the block chain sees a spend with an nSequence value, then that could be either: a regular spend from a wallet, or an off-chain settlement transaction spent with a timelock. The two cases would be indistinguishable, and this could greatly improve the privacy and fungibility of bitcoin.