<oembed><type>rich</type><version>1.0</version><author_name>npub1r3san9v5njl6798hvauyu9ntm6r9c7u8s0t65wls58gpfdcvqp5sa48d0u</author_name><author_url>https://nostr.ae/npub1r3san9v5njl6798hvauyu9ntm6r9c7u8s0t65wls58gpfdcvqp5sa48d0u</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-09-27&#xA;📝 Original message:Agree with all CLTV and nVersionBits points. We should deploy a lock-time&#xA;soft-fork ASAP, using the tried and true IsSuperMajoirty test.&#xA;&#xA;However your information regarding BIPs 68 (sequence numbers), 112&#xA;(checksequenceverify) and 113 (median time past) is outdated. Debate&#xA;regarding semantics has been settled, and there are working implementations&#xA;ready for merge on github. See pull requests #6312, #6564, and #6566. I&#xA;don’t know what the hold up has been regarding further reviews and merging,&#xA;but it is ready.&#xA;&#xA;If you believe there are reasons #6312, #6564, or #6566 should not be&#xA;merged, please speak up. Otherwise it appears there is consensus on these&#xA;changes. They are related, and there is no reason not to include them in&#xA;the soft-fork, delaying applications using these features by 6-12 months.&#xA;&#xA;On Sun, Sep 27, 2015 at 11:50 AM, Peter Todd via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; Summary&#xA;&gt; -------&#xA;&gt;&#xA;&gt; It&#39;s time to deploy BIP65 CHECKLOCKTIMEVERIFY.&#xA;&gt;&#xA;&gt; I&#39;ve backported the CLTV op-code and a IsSuperMajority() soft-fork to&#xA;&gt; the v0.10 and v0.11 branches, pull-reqs #6706 and #6707 respectively. A&#xA;&gt; pull-req for git HEAD for the soft-fork deployment has been open since&#xA;&gt; June 28th, #6351 - the opcode implementation itself was merged two&#xA;&gt; months ago.&#xA;&gt;&#xA;&gt; We should release a v0.10.3 and v0.11.1 with CLTV and get the ball&#xA;&gt; rolling on miner adoption. We have consensus that we need CLTV, we have&#xA;&gt; a well tested implementation, and we have a well-tested deployment&#xA;&gt; mechanism. We also don&#39;t need to wait for other soft-fork proposals to&#xA;&gt; catch up - starting the CLTV deployment process isn&#39;t going to delay&#xA;&gt; future soft-forks, or for that matter, hard-forks.&#xA;&gt;&#xA;&gt; I think it&#39;s possible to safely get CLTV live on mainnet before the end&#xA;&gt; of the year. It&#39;s time we get this over with and done.&#xA;&gt;&#xA;&gt;&#xA;&gt; Detailed Rational&#xA;&gt; -----------------&#xA;&gt;&#xA;&gt; 1) There is a clear need for CLTV&#xA;&gt;&#xA;&gt; Escrow and payment channels both benefit greatly from CLTV. In&#xA;&gt; particular, payment channel implementations are made significantly&#xA;&gt; simpler with CLTV, as well as more secure by removing the malleability&#xA;&gt; vulnerability.&#xA;&gt;&#xA;&gt; Why are payment channels important? There&#39;s a lot of BTC out there&#xA;&gt; vulnerable to theft that doesn&#39;t have to be. For example, just the other&#xA;&gt; day I was talking with Nick Sullivan about ChangeTip&#39;s vulnerability to&#xA;&gt; theft, as well as regulatory uncertainty about whether or not they&#39;re a&#xA;&gt; custodian of their users&#39; funds. With payment channels ChangeTip would&#xA;&gt; only be able to spend as much of a deposit as a user had spent, keeping&#xA;&gt; the rest safe from theft. Similarly, in the other direction - ChangeTip&#xA;&gt; to their users - in many cases it is feasible to also use payment&#xA;&gt; channels to immediately give users control of their funds as they&#xA;&gt; receive them, again protecting users and helping make the case that&#xA;&gt; they&#39;re not a custodian. In the future I&#39;m sure we&#39;ll see fancy&#xA;&gt; bi-directional payment channels serving this role, but lets not let&#xA;&gt; perfect be the enemy of good.&#xA;&gt;&#xA;&gt;&#xA;&gt; 2) We have consensus on the semantics of the CLTV opcode&#xA;&gt;&#xA;&gt; Pull-req #6124 - the implementation of the opcode itself - was merged&#xA;&gt; nearly three months ago after significant peer review and discussion.&#xA;&gt; Part of that review process included myself(1) and mruddy(2) writing&#xA;&gt; actual demos of CLTV. The chance of the CLTV semantics changing now is&#xA;&gt; near-zero.&#xA;&gt;&#xA;&gt;&#xA;&gt; 3) We have consensus that Bitcoin should adopt CLTV&#xA;&gt;&#xA;&gt; The broad peer review and discussion that got #6124 merged is a clear&#xA;&gt; sign that we expect CLTV to be eventually adopted. The question isn&#39;t if&#xA;&gt; CLTV should be added to the Bitcoin protocol, but rather when.&#xA;&gt;&#xA;&gt;&#xA;&gt; 4) The CLTV opcode and IsSuperMajority() deployment code has been&#xA;&gt;    thoroughly tested and reviewed&#xA;&gt;&#xA;&gt; The opcode implementation is very simple, yet got significant review,&#xA;&gt; and it has solid test coverage by a suite of tx-(in)valid.json tests.&#xA;&gt; The tests themselves have been reviewed by others, resulting in Esteban&#xA;&gt; Ordano&#39;s pull-req #6368 by Esteban Ordano which added a few more cases.&#xA;&gt;&#xA;&gt; As for the deployment code, both the actual IsSuperMajority() deployment&#xA;&gt; code and associated unit-tests tests were copied nearly line-by-line&#xA;&gt; from the succesful BIP66. I did this deliberately to make all the peer&#xA;&gt; review and testing of the deployment mechanism used in BIP66 be equally&#xA;&gt; valid for CLTV.&#xA;&gt;&#xA;&gt;&#xA;&gt; 5) We can safely deploy CLTV with IsSuperMajority()&#xA;&gt;&#xA;&gt; We&#39;ve done two soft-forks so far with the IsSuperMajority() mechanism,&#xA;&gt; BIP34 and BIP66. In both cases the IsSuperMajority() mechanism itself&#xA;&gt; worked flawlessly. As is well-known BIP66 in combination with a large %&#xA;&gt; of the hashing power running non-validating &#34;SPV&#34; mining operations did&#xA;&gt; lead to a temporary fork, however the root cause of this issue is&#xA;&gt; unavoidable and not unique to IsSuperMajority() soft-forks.&#xA;&gt;&#xA;&gt; Pragmatically speaking, now that miners are well aware of the issue it&#xA;&gt; will be easy for them to avoid a repeat of that fork by simply adding&#xA;&gt; IsSuperMajority() rules to their &#34;SPV&#34; mining code. Equally turning off&#xA;&gt; SPV mining (temporarily) is perfectly feasable.&#xA;&gt;&#xA;&gt;&#xA;&gt; 6) We have the necessary consensus to deploy CLTV via IsSuperMajority()&#xA;&gt;&#xA;&gt; The various &#34;nVersion bits&#34; proposals - which I am a co-author of - have&#xA;&gt; the primary advantage of being able to cleanly deal with the case where&#xA;&gt; a soft-fork fails to get adopted. However, we do have broad consensus,&#xA;&gt; including across all sides of the blocksize debate, that CLTV should be&#xA;&gt; adopted. The risk of CLTV failing to get miner adoption, and thus&#xA;&gt; blocking other soft-forks, is very low.&#xA;&gt;&#xA;&gt;&#xA;&gt; 7) Using IsSuperMajority() to deploy CLTV doesn&#39;t limit or delay other&#xA;&gt; upgrades&#xA;&gt;&#xA;&gt; It _is_ possible for multiple IsSuperMajority() soft-forks to coexist,&#xA;&gt; in the sense that if one soft-fork is &#34;in flight&#34; that doesn&#39;t prevent&#xA;&gt; another soft-fork from also being deployed simultaneously.&#xA;&gt;&#xA;&gt; In particular, if we deploy CLTV via IsSuperMajority() that does _not_&#xA;&gt; impact the adoption schedule for other future soft-forks, including&#xA;&gt; soft-forks using a future nVersion bits deployment mechanism.&#xA;&gt;&#xA;&gt; For instance, suppose we start deployment of CLTV right now with&#xA;&gt; nVersion=4 blocks. In three months we have 25% miner support, and start&#xA;&gt; deploying CHECKSEQUENCEVERIFY with nVersion=5 blocks. For miners&#xA;&gt; supporting only OP_CLTV, the nVersion=5 blocks still trigger OP_CLTV;&#xA;&gt; miners creating nVersion=5 blocks are simply stating that they support&#xA;&gt; both soft-forks. Equally, if in three months we finish a nVersion bits&#xA;&gt; proposal, those miners will be advertising nVersion=(1 &lt;&lt; 29) blocks,&#xA;&gt; which also advertise OP_CLTV support.&#xA;&gt;&#xA;&gt;&#xA;&gt; 8) BIP101 miners have not proved to be a problem for CLTV deployment&#xA;&gt;&#xA;&gt; While there was concern that BIP101&#39;s use of nVersion would cause&#xA;&gt; issues with a IsSuperMajority() softfork, the % of blocks with BIP101&#xA;&gt; nVersion&#39;s never reached more than 1%, and currently is hovering at&#xA;&gt; around 0.1%&#xA;&gt;&#xA;&gt; As Gavin Andresen has stated that he is happy to add CLTV to BIP101, and&#xA;&gt; thus Bitcoin XT, I believe we can expect those miners to safely support&#xA;&gt; CLTV well before soft-fork enforcement happens. Secondly, the 95%&#xA;&gt; enforcement threshold means we can tolerate a fairly high % of miners&#xA;&gt; running pre-CLTV BIP101 implementations without fatal effects in the&#xA;&gt; unlikely event that those miners don&#39;t upgrade.&#xA;&gt;&#xA;&gt;&#xA;&gt; 9) Doing another IsSuperMajority() soft-fork doesn&#39;t &#34;burn a bit&#34;&#xA;&gt;&#xA;&gt; This is a common myth! All nVersion bits proposals involve permanently&#xA;&gt; setting a high-order bit to 1, which results in nVersion &gt;= all prior&#xA;&gt; IsSuperMajority() soft-forks. In short, we can do a nearly unlimited&#xA;&gt; number of IsSuperMajority() soft-forks without affecting future nVersion&#xA;&gt; bits soft-forks at all.&#xA;&gt;&#xA;&gt;&#xA;&gt; 10) Waiting for nVersion bits and CHECKSEQUENCEVERIFY will significantly&#xA;&gt;     delay deployment of CLTV&#xA;&gt;&#xA;&gt; It&#39;s been proposed multiple times that we wait until we can do a single&#xA;&gt; soft-fork with CSV using the nVersion bits mechanism.&#xA;&gt;&#xA;&gt; nVersion bits doesn&#39;t even have an implementation yet, nor has solid&#xA;&gt; consensus been reached on the exact semantics of how nVersion bits&#xA;&gt; should work. The stateful nature of nVersion bits soft-forks requires a&#xA;&gt; significant amount of new code compared to IsSuperMajority() soft-forks,&#xA;&gt; which in turn will require a significant amount of testing. (again I&#39;ll&#xA;&gt; point out I&#39;m a co-author to all the nVersion bits proposals)&#xA;&gt;&#xA;&gt; CSV has an implementation, but there is still debate going on about what&#xA;&gt; the exact semantics of it should be. Getting the semantics right is&#xA;&gt; especially important as part of CSV includes changing the meaning of&#xA;&gt; nSequence, restricting future uses of that field. There have been many&#xA;&gt; proposals to use nSequence, e.g. for proof-of-stake blocksize voting,&#xA;&gt; and it has the unique capability of being a field that is both unused,&#xA;&gt; and signed by scriptSigs. We shouldn&#39;t take potentially restricting&#xA;&gt; future uses of it lightly.&#xA;&gt;&#xA;&gt; CSV is also significantly more complex and invasive than CLTV in terms&#xA;&gt; of code changes. A large % of the mining power is running forks&#xA;&gt; of Bitcoin Core with custom changes - modifying these forks with new&#xA;&gt; features is a labor intensive and slow process.&#xA;&gt;&#xA;&gt; If CLTV is ready now, why delay it - potentially for 6-12 months - for&#xA;&gt; other proposals to catch up? Equally if they do catch up, great! As&#xA;&gt; explained above an in-flight CLTV soft-fork won&#39;t delay future upgrades.&#xA;&gt;&#xA;&gt;&#xA;&gt; 11) Even if CLTV is broken/obsoleted there is very little carrying cost&#xA;&gt;     to having it&#xA;&gt;&#xA;&gt; Suppose we decide in two years that CLTV was botched and we need to fix&#xA;&gt; it. What&#39;s the &#34;carrying cost&#34; of having implemented CLTV in the first&#xA;&gt; place?&#xA;&gt;&#xA;&gt; We&#39;ll have used up one of our ten soft-forkable NOPs, but if we ever&#xA;&gt; &#34;run out&#34; it&#39;s easy to use extension NOPs(3). Similarly, future script&#xA;&gt; improvements like OP_MAST - or even a hard-fork - can easily expand the&#xA;&gt; range of NOPs to the point where this is a non-issue.&#xA;&gt;&#xA;&gt; If you don&#39;t use OP_CLTV in your scripts there is zero effect on your&#xA;&gt; transactions; we&#39;re not limiting future improvements to Bitcoin in any&#xA;&gt; way other than using up a NOP by implementing CLTV.&#xA;&gt;&#xA;&gt;&#xA;&gt; References&#xA;&gt; ----------&#xA;&gt;&#xA;&gt; 1) https://github.com/petertodd/checklocktimeverify-demos&#xA;&gt; 2) https://github.com/mruddy/bip65-demos&#xA;&gt; 3) https://github.com/bitcoin/bitcoin/pull/5496#issuecomment-101293403&#xA;&gt; 4) https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki&#xA;&gt;&#xA;&gt; --&#xA;&gt; &#39;peter&#39;[:-1]@petertodd.org&#xA;&gt; 000000000000000006a257845da185433cbde54a74be889b1c046a267dcf4ab2&#xA;&gt;&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150927/7fbbbfa6/attachment-0001.html&gt;</html></oembed>