Strong Anti-Replay via Coinbase Transactions [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2017-03-29T09:15:57+00:00


Summary:

On March 25th, 2017, Cameron Garnham proposed a Bitcoin Improvement Proposal (BIP) aimed at protecting users from potential loss of funds due to transaction replay attacks during a chain split. The proposal suggests the activation of a soft fork that includes the creation of a new OpCode called 'OP_ANTI_REPLAY'. This OpCode would be defined as an unused NoOp and can only be created in a coinbase transaction with a value of one Satoshi.According to the proposal, every block's coinbase transaction should create exactly 1000 new OP_ANTI_REPLAY outputs, up to a total of 100,000. If an OP_ANTI_REPLAY output is spent in a block, a corresponding new OP_ANTI_REPLAY must be included in the same block. Miners are advised to account for the size of an OP_ANTI_REPLAY transaction as the sum of the transaction size and the size of an OP_ANTI_REPLAY output in the coinbase.In the event of a chain split after the implementation of this BIP, miners are expected to recycle all the OP_ANTI_REPLAY outputs by spending and recreating them in new blocks. This process would renew the protection for the new chain. However, it is noted that this recycling process may be spammy and require frequent updating due to regular chain splits.The proposal emphasizes the convenience it would provide for wallets to automate the inclusion of new coinbase inputs into transactions that spend potentially repayable transactions. However, the document acknowledges the difficulty of checking for competing transactions, which may make this convenience unattainable. Instead, it suggests using a single reserved output to recycle transactions.The soft fork proposed in this document is intended to enable users to make transactions with confidence that they cannot be replayed on a different chain. It is compatible with all existing bitcoin software, and once activated, all deployed Bitcoin Full Nodes will enforce the anti-replay provisions for Bitcoin Users. However, only upgraded nodes will enforce the additional requirements related to OP_ANTI_REPLAY.The BIP also introduces Opt-In-RBF enforcement, where higher-fee transactions take priority in case of conflicting spends of OP_ANTI_REPLAY outputs, creating competition among users for this resource. The document does not discuss SegWit Compatibility.This proposal is dual licensed as BSD 3-clause and Creative Commons CC0 1.0 Universal, and it includes a reference implementation to be developed, although its feasibility is uncertain given the challenges mentioned earlier.


Updated on: 2023-08-01T19:55:39.267984+00:00