0115 - Rejected - Standards - Sept. 23, 2016 (9 years, 9 months ago)
23
2016
BIP: 115
Layer: Consensus (soft fork)
Title: Generic anti-replay protection using Script
Author: Luke Dashjr <[email protected]>
Comments-Summary: No comments yet.
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP 115
Status: Rejected
Type: Standards Track
Created: 2016-09-23
License: BSD-2-Clause
This BIP describes a new opcode (
OP_CHECKBLOCKATHEIGHT
)
for the Bitcoin scripting system that allows construction of
transactions which are valid only on specific blockchains.
This BIP is licensed under the BSD 2-clause license.
OP_CHECKBLOCKATHEIGHT
redefines the existing
OP_NOP5
opcode.
When this opcode is executed:
Otherwise, script execution will continue as if a NOP had been executed.
This BIP will be deployed by "version bits" BIP 9 with the name "cbah" and using bit TBD.
For Bitcoin mainnet , the BIP 9 starttime will be TBD (Epoch timestamp TBD) and BIP 9 timeout will be TBD (Epoch timestamp TBD).
For Bitcoin mainnet , the BIP 9 starttime will be TBD (Epoch timestamp TBD) and BIP 9 timeout will be TBD (Epoch timestamp TBD).
In some circumstances, users may wish to spend received bitcoins before they have confirmed on the blockchain (Tx B1). However, if the transaction sending them those bitcoins (Tx A1) is double-spent, the wallet must re-issue their own transaction spending them (Tx B2). So long as the double-spend of the incoming transaction (Tx A2) also pays the wallet, this can be managed by simply updating the outgoing transaction with the new outpoint and resigning. However, if the double-spend does not pay the wallet, the situation is presently irrecoverable: it must spend different, non-conflicting TXOs in Tx B2, which allows an attacker to then reorganise the chain (reversing the incoming transaction's double-spend) and confirm both of his transactions Tx B1 and Tx B2.
By adding
OP_CHECKBLOCKATHEIGHT
, the wallet can issue Tx
B2 with a condition that the block confirming Tx A2 is in the history,
thus eliminating this risk.
In the event of a persistent blockchain split, some mechanism is desired by which the UTXOs valid in either chain may be spent without the transaction being validly replayable on the other chain.
This can be guaranteed by choosing a block which exists only on
either side of the split, and pinning (using
OP_CHECKBLOCKATHEIGHT
) common UTXOs to be spent only on
chains based on that block.
To avoid unnecessary conflicts when a chain is reorganized, wallets should always avoid specifying the last 100 blocks when practical. Wallets that use recent blocks when unavoidable SHOULD actively monitor the network and re-create transactions that are reorganised out with updated block hashes. Unless it conflicts with local/user security policies, wallets SHOULD retain the private key in memory to re-sign such transactions until the pinned block is at least 100 blocks deep into the chain.
For ordinary usage, wallets SHOULD specify the ParamBlockHash as 16 bytes.
How is this different from the transaction's lock-time?
OP_CHECKBLOCKATHEIGHT
, on the other hand,
specifies a specific block's hash.
Why are block heights required to be absolute, rather than relative?
Why are blocks older than 52596 deep in the chain not verified?
Why is ParamBlockHash allowed to match less than the full block hash?
OP_LESSTHAN
) to enable on-chain gambling logic.
What if ParamBlockHash has leading zeros? Should this be prevented?
Why is it safe to allow checking blocks as recently as the immediate previous block?
OP_NOP5
ought to be forbidden by policy by all miners
for future extensions such as this, so old miners will under no
circumstances produce blocks which would now be considered invalid under
the new rules. However, miners must still upgrade to avoid accepting and
building on top of such a possible invalid block as part of an
attack.
Old nodes will likely also not relay transactions using this opcode for the same extensibility reasons, but this is not important since the rule cannot be verified deterministically outside the context of a block.
https://github.com/bitcoin/bitcoin/compare/master ...luke-jr:cbah