<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-17&#xA;📝 Original message:Note that this violates present assumptions about transaction validity,&#xA;unless a constraint also exists that any output of such an expiry block is&#xA;not spent for at least 100 blocks.&#xA;&#xA;Do you have a clean way of ensuring this?&#xA;&#xA;On Thu, Sep 17, 2015 at 2:41 PM, jl2012 via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; Fill-or-kill tx is not a new idea and is discussed in the Scaling Bitcoin&#xA;&gt; workshop. In Satoshi&#39;s implementation of nLockTime, a huge range of&#xA;&gt; timestamp (from 1970 to 2009) is wasted. By exploiting this unused range&#xA;&gt; and with compromise in the time resolution, a fill-or-kill system could be&#xA;&gt; built with a softfork.&#xA;&gt;&#xA;&gt; -----------&#xA;&gt; Two new parameters, nLockTime2 and nKillTime are defined:&#xA;&gt;&#xA;&gt; nLockTime2 (Range: 0-1,853,010)&#xA;&gt; 0: Tx could be confirmed at or after block 420,000&#xA;&gt; 1: Tx could be confirmed at or after block 420,004&#xA;&gt; .&#xA;&gt; .&#xA;&gt; 719,999: Tx could be confirmed at or after block 3,299,996 (about 55 years&#xA;&gt; from now)&#xA;&gt; 720,000: Tx could be confirmed if the median time-past &gt;= 1,474,562,048&#xA;&gt; (2016-09-22)&#xA;&gt; 720,001: Tx could be confirmed if the median time-past &gt;= 1,474,564,096&#xA;&gt; (2016-09-22)&#xA;&gt; .&#xA;&gt; .&#xA;&gt; 1,853,010 (max): Tx could be confirmed if the median time-past &gt;=&#xA;&gt; 3,794,966,528 (2090-04-04)&#xA;&gt;&#xA;&gt; nKillTime (Range: 0-2047)&#xA;&gt; if nLockTime2 &lt; 720,000, the tx could be confirmed at or before block&#xA;&gt; (nLockTime2 + nKillTime * 4)&#xA;&gt; if nLockTime2 &gt;= 720,000, the tx could be confirmed if the median&#xA;&gt; time-past &lt;= (nLockTime2 - 720,001 + nKillTime) * 2048&#xA;&gt;&#xA;&gt; Finally, nLockTime = 500,000,000 + nKillTime + nLockTime2 * 2048&#xA;&gt;&#xA;&gt; Setting a bit flag in tx nVersion will activate the new rules.&#xA;&gt;&#xA;&gt; The resolution is 4 blocks or 2048s (34m)&#xA;&gt; The maximum confirmation window is 8188 blocks (56.9 days) or 16,769,024s&#xA;&gt; (48.5 days)&#xA;&gt;&#xA;&gt; For example:&#xA;&gt; With nLockTime2 = 20 and nKillTime = 100, a tx could be confirmed only&#xA;&gt; between block 420,080 and 420,480&#xA;&gt; With nLockTime2 = 730,000 and nKillTime = 1000, a tx could be confirmed&#xA;&gt; only between median time-past of 1,495,042,048 and 1,497,090,048&#xA;&gt;&#xA;&gt; ----------------&#xA;&gt; Why is this a softfork?&#xA;&gt;&#xA;&gt; Remember this formula: nLockTime = 500,000,000 + nKillTime + nLockTime2 *&#xA;&gt; 2048&#xA;&gt;&#xA;&gt; For height based nLockTime2 (&lt;= 719,999)&#xA;&gt;&#xA;&gt; For nLockTime2 = 0 and nKillTime = 0, nLockTime = 500,000,000, which means&#xA;&gt; the tx could be confirmed after 1970-01-01 with the original lock time&#xA;&gt; rule. As the new rule does not allow confirmation until block 420,000, it&#39;s&#xA;&gt; clearly a softfork.&#xA;&gt;&#xA;&gt; It is not difficult to see that the growth of nLockTime will never catch&#xA;&gt; up nLockTime2.&#xA;&gt;&#xA;&gt; At nLockTime2 = 719,999 and nKillTime = 2047, nLockTime = 1,974,559,999,&#xA;&gt; which means 2016-09-22. However, the new rule will not allow confirmation&#xA;&gt; until block 3,299,996 which is decades to go&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; For time based nLockTime2 (&gt; 720,000)&#xA;&gt;&#xA;&gt; For nLockTime2 = 720,000 and nKillTime = 0, nLockTime = 1,974,560,000,&#xA;&gt; which means the tx could be confirmed after median time-past 1,474,560,000&#xA;&gt; (assuming BIP113). However, the new rule will not allow confirmation until&#xA;&gt; 1,474,562,048, therefore a soft fork.&#xA;&gt;&#xA;&gt; For nLockTime2 = 720,000 and nKillTime = 2047, nLockTime = 1,974,562,047,&#xA;&gt; which could be confirmed at 1,474,562,047. Again, the new rule will not&#xA;&gt; allow confirmation until 1,474,562,048. The 1 second difference makes it a&#xA;&gt; soft fork.&#xA;&gt;&#xA;&gt; Actually, for every nLockTime2 value &gt;= 720,000, the lock time with the&#xA;&gt; new rule must be 1-2048 seconds later than the original rule.&#xA;&gt;&#xA;&gt; For nLockTime2 = 1,853,010 and nKillTime = 2047, nLockTime =&#xA;&gt; 4,294,966,527, which is the highest possible value with the 32-bit nLockTime&#xA;&gt;&#xA;&gt; ----------------&#xA;&gt; User&#39;s perspective:&#xA;&gt;&#xA;&gt; A user wants his tx either filled or killed in about 3 hours. He will set&#xA;&gt; a time-based nLockTime2 according to the current median time-past, and set&#xA;&gt; nKillTime = 5&#xA;&gt;&#xA;&gt; A user wants his tx get confirmed in the block 630000, the first block&#xA;&gt; with reward below 10BTC. He is willing to pay high fee but don&#39;t want it&#xA;&gt; gets into another block. He will set nLockTime2 = 210,000 and nKillTime = 0&#xA;&gt;&#xA;&gt; ----------------&#xA;&gt; OP_CLTV&#xA;&gt;&#xA;&gt; Time-based OP_CLTV could be upgraded to support time-based nLockTime2.&#xA;&gt; However, height-based OP_CLTV is not compatible with nLockTime2. To spend a&#xA;&gt; height-based OP_CLTV output, user must use the original nLockTime.&#xA;&gt;&#xA;&gt; We may need a new OP_CLTV2 which could verify both nLockTime and nLockTime2&#xA;&gt;&#xA;&gt; ----------------&#xA;&gt; 55 years after?&#xA;&gt;&#xA;&gt; The height-based nLockTime2 will overflow in 55 years. It is very likely a&#xA;&gt; hard fork will happen to implement a better fill-or-kill system. If not, we&#xA;&gt; could reboot everything with another tx nVersion for another 55 years.&#xA;&gt;&#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;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150917/78f51514/attachment.html&gt;</html></oembed>