<oembed><type>rich</type><version>1.0</version><author_name>npub15wz8j5cse6sexlw6f5q7arc5efe5hxn6kcxxyy222et8qms4u3lsemaru8</author_name><author_url>https://nostr.ae/npub15wz8j5cse6sexlw6f5q7arc5efe5hxn6kcxxyy222et8qms4u3lsemaru8</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2016-01-07&#xA;📝 Original message:Maybe I&#39;m being dense, but I don&#39;t see why 2**80 storage is required for&#xA;this attack.  Also, I don&#39;t see why the attacker ever needs to get the&#xA;victim to accept &#34;arbitrary_data&#34;.  Perhaps I&#39;m wrong about how the&#xA;collision attack works:&#xA;&#xA;   1. Create a script which is perfectly acceptable and would pass the&#xA;   sniff test Gavin proposed (no arbitrary_data).&#xA;   2. Set off CPU power to construct a second script that lets attacker&#xA;   keep his coins and has the same hash. (This is where you get&#xA;   &#34;arbitrary_data&#34;).&#xA;   3. Send a transaction with the first script to the seller as payment.&#xA;   4. Wait for the transaction to be included in a block.&#xA;   5. Redeem the transaction with the second script, thus stealing the&#xA;   coins back.&#xA;&#xA;So the seller would never see the I&#39;d appreciate any correction to my&#xA;understanding here.  Where do you need 2**80 storage?  And when does the&#xA;seller have to accept &#34;arbitrary_data&#34;?&#xA;Thanks!&#xA;&#xA;On Thu, Jan 7, 2016 at 11:19 AM, Adam Back via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; You could say 256 bit ECDSA is overkill lets go to 160 equivalently.&#xA;&gt; Saves even more bytes.&#xA;&gt;&#xA;&gt; The problem with arguing down is where to stop.&#xA;&gt;&#xA;&gt; As Matt said these things dont degrade gracefully so a best practice&#xA;&gt; is to aim for a bit of extra margin.&#xA;&gt;&#xA;&gt; 256-bit is quite common at this point since AES, SHA256 etc even in&#xA;&gt; things with much less at stake than Bitcoin.&#xA;&gt;&#xA;&gt; You could send the compressed (unhashed) pubkey then there&#39;s no hash&#xA;&gt; (and omit it from the sig).  Greg had mentioned that in the past.&#xA;&gt;&#xA;&gt; I think it might be possible to do both (reclaim the hash bits in the&#xA;&gt; serialisation of the pub key).&#xA;&gt;&#xA;&gt; Adam&#xA;&gt;&#xA;&gt; On 7 January 2016 at 20:02, Gavin Andresen via bitcoin-dev&#xA;&gt; &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; &gt; I&#39;m hoisting this from some private feedback I sent on the segregated&#xA;&gt; &gt; witness BIP:&#xA;&gt; &gt;&#xA;&gt; &gt; I said:&#xA;&gt; &gt;&#xA;&gt; &gt; &#34;I&#39;d also use RIPEMD160(SHA256()) as the hash function and save the 12&#xA;&gt; &gt; bytes-- a successful preimage attack against that ain&#39;t gonna happen&#xA;&gt; before&#xA;&gt; &gt; we&#39;re all dead. I&#39;m probably being dense, but I just don&#39;t see how a&#xA;&gt; &gt; collision attack is relevant here.&#34;&#xA;&gt; &gt;&#xA;&gt; &gt; Pieter responded:&#xA;&gt; &gt;&#xA;&gt; &gt; &#34;The problem case is where someone in a contract setup shows you a&#xA;&gt; script,&#xA;&gt; &gt; which you accept as being a payment to yourself. An attacker could use a&#xA;&gt; &gt; collision attack to construct scripts with identical hashes, only one of&#xA;&gt; &gt; which does have the property you want, and steal coins.&#xA;&gt; &gt;&#xA;&gt; &gt; So you really want collision security, and I don&#39;t think 80 bits is&#xA;&gt; &gt; something we should encourage for that. Normal pubkey hashes don&#39;t have&#xA;&gt; that&#xA;&gt; &gt; problem, as they can&#39;t be constructed to pay to you.&#34;&#xA;&gt; &gt;&#xA;&gt; &gt; ... but I&#39;m unconvinced:&#xA;&gt; &gt;&#xA;&gt; &gt; &#34;But it is trivial for contract wallets to protect against collision&#xA;&gt; &gt; attacks-- if you give me a script that is &#34;gavin_pubkey CHECKSIG&#xA;&gt; &gt; arbitrary_data OP_DROP&#34; with &#34;I promise I&#39;m not trying to rip you off,&#xA;&gt; just&#xA;&gt; &gt; ignore that arbitrary data&#34; a wallet can just refuse. Even more likely, a&#xA;&gt; &gt; contract wallet won&#39;t even recognize that as a pay-to-gavin transaction.&#xA;&gt; &gt;&#xA;&gt; &gt; I suppose it could be looking for some form of &#34;gavin_pubkey&#xA;&gt; &gt; somebody_else_pubkey CHECKMULTISIG ... with the attacker using&#xA;&gt; &gt; somebody_else_pubkey to force the collision, but, again, trivial contract&#xA;&gt; &gt; protocol tweaks (&#34;send along a proof you have the private key&#xA;&gt; corresponding&#xA;&gt; &gt; to the public key&#34; or &#34;everybody pre-commits pubkeys they&#39;ll use at&#xA;&gt; protocol&#xA;&gt; &gt; start&#34;) would protect against that.&#xA;&gt; &gt;&#xA;&gt; &gt; Adding an extra 12 bytes to every segwit to prevent an attack that takes&#xA;&gt; &gt; 2^80 computation and 2^80 storage, is unlikely to be a problem in&#xA;&gt; practice,&#xA;&gt; &gt; and is trivial to protect against is the wrong tradeoff to make.&#34;&#xA;&gt; &gt;&#xA;&gt; &gt; 20 bytes instead of 32 bytes is a savings of almost 40%, which is&#xA;&gt; &gt; significant.&#xA;&gt; &gt;&#xA;&gt; &gt; The general question I&#39;d like to raise on this list is:&#xA;&gt; &gt;&#xA;&gt; &gt; Should we be worried, today, about collision attacks against RIPEMD160&#xA;&gt; (our&#xA;&gt; &gt; 160-bit hash)?&#xA;&gt; &gt;&#xA;&gt; &gt; Mounting a successful brute-force collision attack would require at least&#xA;&gt; &gt; O(2^80) CPU, which is kinda-sorta feasible (Pieter pointed out that&#xA;&gt; Bitcoin&#xA;&gt; &gt; POW has computed more SHA256 hashes than that). But it also requires&#xA;&gt; O(2^80)&#xA;&gt; &gt; storage, which is utterly infeasible (there is something on the order of&#xA;&gt; &gt; 2^35 bytes of storage in the entire world).  Even assuming doubling every&#xA;&gt; &gt; single year (faster than Moore&#39;s Law), we&#39;re four decades away from an&#xA;&gt; &gt; attacker with THE ENTIRE WORLD&#39;s storage capacity being able to mount a&#xA;&gt; &gt; collision attack.&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; References:&#xA;&gt; &gt;&#xA;&gt; &gt; https://en.wikipedia.org/wiki/Collision_attack&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; https://vsatglobalseriesblog.wordpress.com/2013/06/21/in-2013-the-amount-of-data-generated-worldwide-will-reach-four-zettabytes/&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; --&#xA;&gt; &gt; --&#xA;&gt; &gt; Gavin Andresen&#xA;&gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; _______________________________________________&#xA;&gt; &gt; bitcoin-dev mailing list&#xA;&gt; &gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; &gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt; &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;&#xA;&#xA;&#xA;-- &#xA;I like to provide some work at no charge to prove my value. Do you need a&#xA;techie?&#xA;I own Litmocracy &lt;http://www.litmocracy.com&gt; and Meme Racing&#xA;&lt;http://www.memeracing.net&gt; (in alpha).&#xA;I&#39;m the webmaster for The Voluntaryist &lt;http://www.voluntaryist.com&gt; which&#xA;now accepts Bitcoin.&#xA;I also code for The Dollar Vigilante &lt;http://dollarvigilante.com/&gt;.&#xA;&#34;He ought to find it more profitable to play by the rules&#34; - Satoshi&#xA;Nakamoto&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20160107/b5c2e636/attachment.html&gt;</html></oembed>