Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 423F4A45 for ; Thu, 7 Jan 2016 23:52:30 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9A4FC191 for ; Thu, 7 Jan 2016 23:52:29 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id l65so116388064wmf.1 for ; Thu, 07 Jan 2016 15:52:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=XizQpQS3r9BkYr0MvnBHL0i9Ls44QRVNGMucNltt/NA=; b=I3CFl1ayXOdt6WPXCq6IoCO+eIqNzjDKDzmiXf1iWpHkHt4wIRpxpouxn5/EgeYUmm r/NWU8K4r5vx0HinrdX5vi1w9xKi/la/eV6efbFloQu+sEqnSCnTo6fvq4uWDa5q+g3V dPYhCvRUk5o8LiFdA4b584EN6C/sfY0kcNLlItEgktCXSGeW14kzpAr+/mH1YGE/ZshB Aq3SQkXSrUtov302OQ2k5IofefCLuXWTH2h8WEGLk9IytnEStJg7C/Kg+n8dXnQb4DNx iY/3KQHyex9DqBFmDcoaSwTe7kgOeLKjZOpT7Bnc3lver7QuaYHnLxfXq59Vded9hq3v k2QQ== MIME-Version: 1.0 X-Received: by 10.28.174.77 with SMTP id x74mr18344982wme.99.1452210748211; Thu, 07 Jan 2016 15:52:28 -0800 (PST) Received: by 10.194.190.100 with HTTP; Thu, 7 Jan 2016 15:52:27 -0800 (PST) Received: by 10.194.190.100 with HTTP; Thu, 7 Jan 2016 15:52:27 -0800 (PST) In-Reply-To: References: Date: Fri, 8 Jan 2016 00:52:27 +0100 Message-ID: From: Pieter Wuille To: Gavin Andresen Content-Type: multipart/alternative; boundary=001a11444344c94aab0528c729ed X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Bitcoin Dev Subject: Re: [bitcoin-dev] Time to worry about 80-bit collision attacks or not? X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Development Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2016 23:52:30 -0000 --001a11444344c94aab0528c729ed Content-Type: text/plain; charset=UTF-8 > "The problem case is where someone in a contract setup shows you a script, which you accept as being a payment to yourself. An attacker could use a collision attack to construct scripts with identical hashes, only one of which does have the property you want, and steal coins. > > So you really want collision security, and I don't think 80 bits is something we should encourage for that. Normal pubkey hashes don't have that problem, as they can't be constructed to pay to you." > > ... but I'm unconvinced: > > "But it is trivial for contract wallets to protect against collision attacks-- if you give me a script that is "gavin_pubkey CHECKSIG arbitrary_data OP_DROP" with "I promise I'm not trying to rip you off, just ignore that arbitrary data" a wallet can just refuse. Even more likely, a contract wallet won't even recognize that as a pay-to-gavin transaction. > > I suppose it could be looking for some form of "gavin_pubkey somebody_else_pubkey CHECKMULTISIG ... with the attacker using somebody_else_pubkey to force the collision, but, again, trivial contract protocol tweaks ("send along a proof you have the private key corresponding to the public key" or "everybody pre-commits pubkeys they'll use at protocol start") would protect against that. Yes, this is what I worry about. We're constructing a 2-of-2 multisig escrow in a contract. I reveal my public key A, you do a 80-bit search for B and C such that H(A and B) = H(B and C). You tell me your keys B, and I happily send to H(A and B), which you steal with H(B and C). Sending along a proof does not help, you can't prove that you do not know of a collision. Pre-committing does help, but is a very non-obvious security requirement, something I strongly believe is far riskier in practice. Bitcoin does have parts that rely on economic arguments for security or privacy, but can we please stick to using cryptography that is up to par for parts where we can? It's a small constant factor of data, and it categorically removes the worry about security levels. -- Pieter --001a11444344c94aab0528c729ed Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

> "The problem case is where someone in a contract s= etup shows you a script, which you accept as being a payment to yourself. A= n attacker could use a collision attack to construct scripts with identical= hashes, only one of which does have the property you want, and steal coins= .
>
> So you really want collision security, and I don't think 80 bits i= s something we should encourage for that. Normal pubkey hashes don't ha= ve that problem, as they can't be constructed to pay to you."
>
> ... but I'm unconvinced:
>
> "But it is trivial for contract wallets to protect against collis= ion attacks-- if you give me a script that is "gavin_pubkey CHECKSIG a= rbitrary_data OP_DROP" with "I promise I'm not trying to rip = you off, just ignore that arbitrary data" a wallet can just refuse. Ev= en more likely, a contract wallet won't even recognize that as a pay-to= -gavin transaction.
>
> I suppose it could be looking for some form of "gavin_pubkey some= body_else_pubkey CHECKMULTISIG ... with the attacker using somebody_else_pu= bkey to force the collision, but, again, trivial contract protocol tweaks (= "send along a proof you have the private key corresponding to the publ= ic key" or "everybody pre-commits pubkeys they'll use at prot= ocol start") would protect against that.

Yes, this is what I worry about. We're constructing a 2-= of-2 multisig escrow in a contract. I reveal my public key A, you do a 80-b= it search for B and C such that H(A and B) =3D H(B and C). You tell me your= keys B, and I happily send to H(A and B), which you steal with H(B and C).=

Sending along a proof does not help, you can't prove tha= t you do not know of a collision. Pre-committing does help, but is a very n= on-obvious security requirement, something I strongly believe is far riskie= r in practice.

Bitcoin does have parts that rely on economic arguments for = security or privacy, but can we please stick to using cryptography that is = up to par for parts where we can? It's a small constant factor of data,= and it categorically removes the worry about security levels.

--
Pieter

--001a11444344c94aab0528c729ed--