@@ -139,9 +139,15 @@ specification for the semantics of OP_CHECKTEMPLATEVERIFY.
139
139
case OP_CHECKTEMPLATEVERIFY:
140
140
{
141
141
// 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
+
143
148
if (stack.size() < 1)
144
149
return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
150
+
145
151
// If the argument was not 32 bytes, treat as OP_NOP4:
146
152
switch (stack.back().size()) {
147
153
case 32:
@@ -210,16 +216,24 @@ A PayToBareDefaultCheckTemplateVerifyHash output matches the following template:
210
216
211
217
==Deployment ==
212
218
213
- Deployment should be done via BIP 9 VersionBits.
219
+ Deployment should be done via BIP 9 VersionBits deployed through Speedy Trial .
214
220
215
221
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.
217
223
218
- For the avoidance of unclarity, the parameters are:
224
+ For the avoidance of unclarity, the parameters to be determined are:
219
225
226
+ // Deployment of CTV (BIP 119)
220
227
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
+
223
237
224
238
In order to facilitate using CHECKTEMPLATEVERIFY, the common case of a
225
239
PayToBareDefaultCheckTemplateVerifyHash
@@ -529,10 +543,15 @@ for an OP_NOP are a soft fork, so existing software will be fully functional wit
529
543
for mining and block validation. Similar soft forks for OP_CHECKSEQUENCEVERIFY and OP_CHECKLOCKTIMEVERIFY
530
544
(see BIP-0065 and BIP-0112) have similarly changed OP_NOP semantics without introducing compatibility issues.
531
545
546
+ In contrast to previous forks, OP_CHECKTEMPLATEVERIFY will not make scripts
547
+ valid for policy until the new rule is active.
548
+
532
549
Older wallet software will be able to accept spends from OP_CHECKTEMPLATEVERIFY outputs, but will
533
550
require an upgrade in order to treat PayToBareDefaultCheckTemplateVerifyHash chains with a confirmed ancestor as
534
551
being "trusted" (i.e., eligible for spending before the transaction is confirmed).
535
552
553
+
554
+
536
555
Backports of OP_CHECKTEMPLATEVERIFY can be trivially prepared (see the reference implementation)
537
556
for older node versions that can be patched but not upgraded to a newer major release.
538
557
0 commit comments