<oembed><type>rich</type><version>1.0</version><author_name>npub1tjephawh7fdf6358jufuh5eyxwauzrjqa7qn50pglee4tayc2ntqcjtl6r</author_name><author_url>https://nostr.ae/npub1tjephawh7fdf6358jufuh5eyxwauzrjqa7qn50pglee4tayc2ntqcjtl6r</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2016-01-07&#xA;📝 Original message:&gt; &#34;The problem case is where someone in a contract setup shows you a&#xA;script, which you accept as being a payment to yourself. An attacker could&#xA;use a collision attack to construct scripts with identical hashes, only one&#xA;of which does have the property you want, and steal coins.&#xA;&gt;&#xA;&gt; 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;&gt;&#xA;&gt; ... but I&#39;m unconvinced:&#xA;&gt;&#xA;&gt; &#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;&gt;&#xA;&gt; 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;Yes, this is what I worry about. We&#39;re constructing a 2-of-2 multisig&#xA;escrow in a contract. I reveal my public key A, you do a 80-bit search for&#xA;B and C such that H(A and B) = H(B and C). You tell me your keys B, and I&#xA;happily send to H(A and B), which you steal with H(B and C).&#xA;&#xA;Sending along a proof does not help, you can&#39;t prove that you do not know&#xA;of a collision. Pre-committing does help, but is a very non-obvious&#xA;security requirement, something I strongly believe is far riskier in&#xA;practice.&#xA;&#xA;Bitcoin does have parts that rely on economic arguments for security or&#xA;privacy, but can we please stick to using cryptography that is up to par&#xA;for parts where we can? It&#39;s a small constant factor of data, and it&#xA;categorically removes the worry about security levels.&#xA;&#xA;-- &#xA;Pieter&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20160108/e2e921fb/attachment.html&gt;</html></oembed>