<oembed><type>rich</type><version>1.0</version><author_name>npub10plv6jx6pktpp5ezldnus6kj8ffg045g2kdjl78w23njrlveqy5s3pfaef</author_name><author_url>https://nostr.ae/npub10plv6jx6pktpp5ezldnus6kj8ffg045g2kdjl78w23njrlveqy5s3pfaef</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-07-20&#xA;📝 Original message:I take it there&#39;s no feasibility in suggesting the script execution code &#xA;has run time maximums? I&#39;m aware these would be much harder to have &#xA;consensus on, but would seem like the better solution if at all possible.&#xA;&#xA;Ross&#xA;&#xA;On 20/07/2015 20:10, Gavin Andresen via bitcoin-dev wrote:&#xA;&gt; Draft BIP to prevent a potential CPU exhaustion attack if a &#xA;&gt; significantly larger maximum blocksize is adopted:&#xA;&gt;&#xA;&gt;   Title: Limit maximum transaction size&#xA;&gt;   Author: Gavin Andresen &lt;gavinandresen at gmail.com &#xA;&gt; &lt;mailto:gavinandresen at gmail.com&gt;&gt;&#xA;&gt;   Status: Draft&#xA;&gt;   Type: Standards Track&#xA;&gt;   Created: 2015-07-17&#xA;&gt;&#xA;&gt; ==Abstract==&#xA;&gt;&#xA;&gt; Mitigate a potential CPU exhaustion denial-of-service attack by limiting&#xA;&gt; the maximum size of a transaction included in a block.&#xA;&gt;&#xA;&gt; ==Motivation==&#xA;&gt;&#xA;&gt; Sergio Demian Lerner reported that a maliciously constructed block could&#xA;&gt; take several minutes to validate, due to the way signature hashes are&#xA;&gt; computed for OP_CHECKSIG/OP_CHECKMULTISIG &#xA;&gt; ([[https://bitcointalk.org/?topic=140078|CVE-2013-2292]] &#xA;&gt; &lt;https://bitcointalk.org/?topic=140078%7CCVE-2013-2292]]&gt;).&#xA;&gt; Each signature validation can require hashing most of the transaction&#39;s&#xA;&gt; bytes, resulting in O(s*b) scaling (where n is the number of signature&#xA;&gt; operations and m is the number of bytes in the transaction, excluding&#xA;&gt; signatures). If there are no limits on n or m the result is O(n^2) &#xA;&gt; scaling.&#xA;&gt;&#xA;&gt; This potential attack was mitigated by changing the default relay and&#xA;&gt; mining policies so transactions larger than 100,000 bytes were not&#xA;&gt; relayed across the network or included in blocks. However, a miner&#xA;&gt; not following the default policy could choose to include a&#xA;&gt; transaction that filled the entire one-megaybte block and took&#xA;&gt; a long time to validate.&#xA;&gt;&#xA;&gt; ==Specification==&#xA;&gt;&#xA;&gt; After deployment, the maximum serialized size of a transaction allowed&#xA;&gt; in a block shall be 100,000 bytes.&#xA;&gt;&#xA;&gt; ==Compatibility==&#xA;&gt;&#xA;&gt; This change should be compatible with existing transaction-creation &#xA;&gt; software,&#xA;&gt; because transactions larger than 100,000 bytes have been considered &#xA;&gt; &#34;non-standard&#34;&#xA;&gt; (they are not relayed or mined by default) for years.&#xA;&gt;&#xA;&gt; Software that assembles transactions into blocks and that validates &#xA;&gt; blocks must be&#xA;&gt; updated to reject oversize transactions.&#xA;&gt;&#xA;&gt; ==Deployment==&#xA;&gt;&#xA;&gt; This change will be deployed with BIP 100 or BIP 101.&#xA;&gt;&#xA;&gt; ==Discussion==&#xA;&gt;&#xA;&gt; Alternatives to this BIP:&#xA;&gt;&#xA;&gt; 1. A new consensus rule that limits the number of signature operations &#xA;&gt; in a&#xA;&gt; single transaction instead of limiting size. This might be more &#xA;&gt; compatible with&#xA;&gt; future opcodes that require larger-than-100,000-byte transactions, &#xA;&gt; although&#xA;&gt; any such future opcodes would likely require changes to the Script &#xA;&gt; validation&#xA;&gt; rules anyway (e.g. the 520-byte limit on data items).&#xA;&gt;&#xA;&gt; 2. Fix the SIG opcodes so they don&#39;t re-hash variations of the &#xA;&gt; transaction&#39;s data.&#xA;&gt; This is the &#34;most correct&#34; solution, but would require updating every&#xA;&gt; piece of transaction-creating and transaction-validating software to &#xA;&gt; change how&#xA;&gt; they compute the signature hash.&#xA;&gt;&#xA;&gt; ==References==&#xA;&gt;&#xA;&gt; [[https://bitcointalk.org/?topic=140078|CVE-2013-2292] &#xA;&gt; &lt;https://bitcointalk.org/?topic=140078%7CCVE-2013-2292]&gt;]: Sergio &#xA;&gt; Demian Lerner&#39;s original report&#xA;&gt;&#xA;&gt;&#xA;&gt;&#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;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20150720/b969dd16/attachment.html&gt;</html></oembed>