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