From 71dd5c44e831bf2c87633455291592ef2decae24 Mon Sep 17 00:00:00 2001 From: jl2012 Date: Wed, 2 Dec 2015 02:03:30 +0800 Subject: [PATCH 1/3] Full description of the behavior of the OP_CLTV --- bip-0065.mediawiki | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bip-0065.mediawiki b/bip-0065.mediawiki index b48fa759..a960e543 100644 --- a/bip-0065.mediawiki +++ b/bip-0065.mediawiki @@ -16,11 +16,17 @@ some point in the future. ==Summary== -CHECKLOCKTIMEVERIFY redefines the existing NOP2 opcode. When executed it -compares the top item on the stack to the nLockTime field of the transaction -containing the scriptSig. If that top stack item is greater than the transaction's -nLockTime field the script fails immediately, otherwise script evaluation continues -as though a NOP was executed. +CHECKLOCKTIMEVERIFY redefines the existing NOP2 opcode. When executed, if +any of the following conditions are true, the script interpreter will terminate +with an error: + +* the stake is empty; or +* the top item on the stack is less than 0; or +* the lock-time type (height vs. timestamp) of the top stake item and the nLockTime field are not the same; or +* the top stack item is greater than the transaction's nLockTime field; or +* the nLockTime feature is disabled by setting the nSequence field of the txin to 0xffffffff; + +Otherwise, script execution will continue as if a NOP had been executed. The nLockTime field in a transaction prevents the transaction from being mined until either a certain block height, or block time, has been reached. By From 004be2e8225d582fa1bfd27f08b856996c981586 Mon Sep 17 00:00:00 2001 From: jl2012 Date: Sun, 6 Dec 2015 23:52:42 +0800 Subject: [PATCH 2/3] Update bip-0065.mediawiki --- bip-0065.mediawiki | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bip-0065.mediawiki b/bip-0065.mediawiki index a960e543..a90be623 100644 --- a/bip-0065.mediawiki +++ b/bip-0065.mediawiki @@ -20,9 +20,9 @@ CHECKLOCKTIMEVERIFY redefines the existing NOP2 opcode. When executed, if any of the following conditions are true, the script interpreter will terminate with an error: -* the stake is empty; or +* the stack is empty; or * the top item on the stack is less than 0; or -* the lock-time type (height vs. timestamp) of the top stake item and the nLockTime field are not the same; or +* the lock-time type (height vs. timestamp) of the top stack item and the nLockTime field are not the same; or * the top stack item is greater than the transaction's nLockTime field; or * the nLockTime feature is disabled by setting the nSequence field of the txin to 0xffffffff; From abc7ae83a0ae3f31e83bf7933bcf26ed4f6b529d Mon Sep 17 00:00:00 2001 From: jl2012 Date: Wed, 9 Dec 2015 00:37:25 +0800 Subject: [PATCH 3/3] Update bip-0065.mediawiki the nLockTime feature may still be active as other inputs may not be final --- bip-0065.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0065.mediawiki b/bip-0065.mediawiki index a90be623..84bad657 100644 --- a/bip-0065.mediawiki +++ b/bip-0065.mediawiki @@ -24,7 +24,7 @@ with an error: * the top item on the stack is less than 0; or * the lock-time type (height vs. timestamp) of the top stack item and the nLockTime field are not the same; or * the top stack item is greater than the transaction's nLockTime field; or -* the nLockTime feature is disabled by setting the nSequence field of the txin to 0xffffffff; +* the nSequence field of the txin is 0xffffffff; Otherwise, script execution will continue as if a NOP had been executed.