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