<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:2016-01-07&#xA;📝 Original message:I&#39;m hoisting this from some private feedback I sent on the segregated&#xA;witness BIP:&#xA;&#xA;I said:&#xA;&#xA;&#34;I&#39;d also use RIPEMD160(SHA256()) as the hash function and save the 12&#xA;bytes-- a successful preimage attack against that ain&#39;t gonna happen before&#xA;we&#39;re all dead. I&#39;m probably being dense, but I just don&#39;t see how a&#xA;collision attack is relevant here.&#34;&#xA;&#xA;Pieter responded:&#xA;&#xA;&#34;The problem case is where someone in a contract setup shows you a script,&#xA;which you accept as being a payment to yourself. An attacker could use a&#xA;collision attack to construct scripts with identical hashes, only one of&#xA;which does have the property you want, and steal coins.&#xA;&#xA;So you really want collision security, and I don&#39;t think 80 bits is&#xA;something we should encourage for that. Normal pubkey hashes don&#39;t have&#xA;that problem, as they can&#39;t be constructed to pay to you.&#34;&#xA;... but I&#39;m unconvinced:&#xA;&#xA;&#34;But it is trivial for contract wallets to protect against collision&#xA;attacks-- if you give me a script that is &#34;gavin_pubkey CHECKSIG&#xA;arbitrary_data OP_DROP&#34; with &#34;I promise I&#39;m not trying to rip you off, just&#xA;ignore that arbitrary data&#34; a wallet can just refuse. Even more likely, a&#xA;contract wallet won&#39;t even recognize that as a pay-to-gavin transaction.&#xA;&#xA;I suppose it could be looking for some form of &#34;gavin_pubkey&#xA;somebody_else_pubkey CHECKMULTISIG ... with the attacker using&#xA;somebody_else_pubkey to force the collision, but, again, trivial contract&#xA;protocol tweaks (&#34;send along a proof you have the private key corresponding&#xA;to the public key&#34; or &#34;everybody pre-commits pubkeys they&#39;ll use at&#xA;protocol start&#34;) would protect against that.&#xA;&#xA;Adding an extra 12 bytes to every segwit to prevent an attack that takes&#xA;2^80 computation and 2^80 storage, is unlikely to be a problem in practice,&#xA;and is trivial to protect against is the wrong tradeoff to make.&#34;&#xA;&#xA;20 bytes instead of 32 bytes is a savings of almost 40%, which is&#xA;significant.&#xA;&#xA;The general question I&#39;d like to raise on this list is:&#xA;&#xA;Should we be worried, today, about collision attacks against RIPEMD160 (our&#xA;160-bit hash)?&#xA;&#xA;Mounting a successful brute-force collision attack would require at least&#xA;O(2^80) CPU, which is kinda-sorta feasible (Pieter pointed out that Bitcoin&#xA;POW has computed more SHA256 hashes than that). But it also requires&#xA;O(2^80) storage, which is utterly infeasible (there is something on the&#xA;order of 2^35 bytes of storage in the entire world).  Even assuming&#xA;doubling every single year (faster than Moore&#39;s Law), we&#39;re four decades&#xA;away from an attacker with THE ENTIRE WORLD&#39;s storage capacity being able&#xA;to mount a collision attack.&#xA;&#xA;&#xA;References:&#xA;&#xA;https://en.wikipedia.org/wiki/Collision_attack&#xA;&#xA;https://vsatglobalseriesblog.wordpress.com/2013/06/21/in-2013-the-amount-of-data-generated-worldwide-will-reach-four-zettabytes/&#xA;&#xA;&#xA;-- &#xA;--&#xA;Gavin Andresen&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20160107/09860830/attachment.html&gt;</html></oembed>