Skip to content

Commit 8364e25

Browse files
committed
[BIP-119] Clarify Draft Deployment Params
1 parent a79eb55 commit 8364e25

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

bip-0119.mediawiki

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,15 @@ specification for the semantics of OP_CHECKTEMPLATEVERIFY.
139139
case OP_CHECKTEMPLATEVERIFY:
140140
{
141141
// if flags not enabled; treat as a NOP4
142-
if (!(flags & SCRIPT_VERIFY_DEFAULT_CHECK_TEMPLATE_VERIFY_HASH)) break;
142+
if (!(flags & SCRIPT_VERIFY_DEFAULT_CHECK_TEMPLATE_VERIFY_HASH)) {
143+
if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
144+
return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS);
145+
break;
146+
}
147+
143148
if (stack.size() < 1)
144149
return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
150+
145151
// If the argument was not 32 bytes, treat as OP_NOP4:
146152
switch (stack.back().size()) {
147153
case 32:
@@ -210,16 +216,24 @@ A PayToBareDefaultCheckTemplateVerifyHash output matches the following template:
210216
211217
==Deployment==
212218

213-
Deployment should be done via BIP 9 VersionBits.
219+
Deployment should be done via BIP 9 VersionBits deployed through Speedy Trial.
214220

215221
The start time and bit in the implementation are currently set to bit 5 and
216-
March 1st, 2020, but this is subject to change while the BIP is a draft.
222+
NEVER_ACTIVE/NO_TIMEOUT, but this is subject to change while the BIP is a draft.
217223

218-
For the avoidance of unclarity, the parameters are:
224+
For the avoidance of unclarity, the parameters to be determined are:
219225

226+
// Deployment of CTV (BIP 119)
220227
consensus.vDeployments[Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY].bit = 5;
221-
consensus.vDeployments[Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY].nStartTime = 1583020800; // March 1, 2020
222-
consensus.vDeployments[Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY].nTimeout = 1614556800; // March 1, 2021
228+
consensus.vDeployments[Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
229+
consensus.vDeployments[Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
230+
consensus.vDeployments[Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY].min_activation_height = 0;
231+
232+
Until BIP-119 reaches ACTIVE state and the
233+
SCRIPT_VERIFY_DEFAULT_CHECK_TEMPLATE_VERIFY_HASH flag is set, the network should
234+
execute a NOP4 as SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS for policy and a NOP for
235+
consensus.
236+
223237

224238
In order to facilitate using CHECKTEMPLATEVERIFY, the common case of a
225239
PayToBareDefaultCheckTemplateVerifyHash
@@ -529,10 +543,15 @@ for an OP_NOP are a soft fork, so existing software will be fully functional wit
529543
for mining and block validation. Similar soft forks for OP_CHECKSEQUENCEVERIFY and OP_CHECKLOCKTIMEVERIFY
530544
(see BIP-0065 and BIP-0112) have similarly changed OP_NOP semantics without introducing compatibility issues.
531545

546+
In contrast to previous forks, OP_CHECKTEMPLATEVERIFY will not make scripts
547+
valid for policy until the new rule is active.
548+
532549
Older wallet software will be able to accept spends from OP_CHECKTEMPLATEVERIFY outputs, but will
533550
require an upgrade in order to treat PayToBareDefaultCheckTemplateVerifyHash chains with a confirmed ancestor as
534551
being "trusted" (i.e., eligible for spending before the transaction is confirmed).
535552

553+
554+
536555
Backports of OP_CHECKTEMPLATEVERIFY can be trivially prepared (see the reference implementation)
537556
for older node versions that can be patched but not upgraded to a newer major release.
538557

0 commit comments

Comments
 (0)