LearnBitcoin

Bitcoin Dev Archive 2013

Double-Spending Fast Payments in Bitcoin due to Client versions 0.8.1

5 messages, 27 Jun 2013. Started by Arthur Gervais.

Arthur Gervais (2), Greg Maxwell (2), Jeff Garzik

Permalink Original thread on gnusha.org

Arthur Gervais permalink original

Dear Bitcoin developers,

We would like to report a vulnerability which might lead, under some assumptions, to a double-spending attack in a fast payment scenario. The vulnerability has been introduced due to signature encoding incompatibilities between versions 0.8.2 (or 0.8.3) and earlier Bitcoin versions.

Please find at the following link a detailed description of this vulnerability: ftp://ftp.inf.ethz.ch/pub/publications/tech-reports/7xx/789.pdf

We contacted and informed Gavin earlier about this problem.

With best regards, Arthur Gervais

Greg Maxwell in reply to Arthur Gervais permalink original

On Thu, Jun 27, 2013 at 3:23 AM, Arthur Gervais <arthur.gervais@inf•ethz•ch> wrote:

Quoted text (14 lines)
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dear Bitcoin developers,
>
> We would like to report a vulnerability which might lead, under some
> assumptions, to a double-spending attack in a fast payment scenario.
> The vulnerability has been introduced due to signature encoding
> incompatibilities between versions 0.8.2 (or 0.8.3) and earlier
> Bitcoin versions.
>
> Please find at the following link a detailed description of this
> vulnerability:
> ftp://ftp.inf.ethz.ch/pub/publications/tech-reports/7xx/789.pdf

It would be kind if your paper cited the one of the prior discussions of this transaction pattern:

E.g. https://bitcointalk.org/index.php?topic=196990.msg2048297#msg2048297 (I think there are a couple others)

The family of transaction patterns you describe is one of the ones I specifically cite as an example of why taking non-reversible actions on unconfirmed transactions is unsafe (and why most of the Bitcoin community resources) council the same. You can get similar patterns absent changes in the IsStandard rule through a number of other means. One obvious one is through concurrent announcement: You announce conflicting transactions at the same time to many nodes and one excludes another. By performing this many times and using chains of unconfirmed transactions and seeing which family your victim observes you can create input mixes that are only accepted by very specific subsets of the network.

Arthur Gervais in reply to Greg Maxwell permalink original

On 6/27/13 1:04 PM, Gregory Maxwell wrote:

Quoted text (35 lines)
> On Thu, Jun 27, 2013 at 3:23 AM, Arthur Gervais
> <arthur.gervais@inf•ethz•ch> wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Dear Bitcoin developers,
>>
>> We would like to report a vulnerability which might lead, under some
>> assumptions, to a double-spending attack in a fast payment scenario.
>> The vulnerability has been introduced due to signature encoding
>> incompatibilities between versions 0.8.2 (or 0.8.3) and earlier
>> Bitcoin versions.
>>
>> Please find at the following link a detailed description of this
>> vulnerability:
>> ftp://ftp.inf.ethz.ch/pub/publications/tech-reports/7xx/789.pdf
>
> It would be kind if your paper cited the one of the prior discussions
> of this transaction pattern:
>
> E.g. https://bitcointalk.org/index.php?topic=196990.msg2048297#msg2048297
> (I think there are a couple others)
>
> The family of transaction patterns you describe is one of the ones I
> specifically cite as an example of why taking non-reversible actions
> on unconfirmed transactions is unsafe (and why most of the Bitcoin
> community resources) council the same.  You can get similar patterns
> absent changes in the IsStandard rule through a number of other means.
>  One obvious one is through concurrent announcement: You announce
> conflicting transactions at the same time to many nodes and one
> excludes another.  By performing this many times and using chains of
> unconfirmed transactions and seeing which family your victim observes
> you can create input mixes that are only accepted by very specific
> subsets of the network.
>

Thank you for the reference! This is indeed a very interesting issue, affecting the same Bitcoin version. However we think it is complementary, since our reported problem has nothing to do with fees, dust, nor is it necessary to send the two double-spending transaction at the same time. In our setting, double-spending still works if the second transaction is sent after minutes (and the first transaction has not yet been included into a block).

Clearly, we have outlined the limits of the security of zero-confirmation payments in an earlier work.

Our only intention is to raise the awareness for merchants who have to accept zero-confirmation transactions. They should be aware of the signature encoding difference between Bitcoin versions and the possible consequences.

Greg Maxwell in reply to Arthur Gervais permalink original

On Thu, Jun 27, 2013 at 9:03 AM, Arthur Gervais <arthur.gervais@inf•ethz•ch> wrote:

Quoted text (6 lines)
> affecting the same Bitcoin version. However we think it is
> complementary, since our reported problem has nothing to do with fees,
> dust, nor is it necessary to send the two double-spending transaction at
> the same time. In our setting, double-spending still works if the second
> transaction is sent after minutes (and the first transaction has not yet
> been included into a block).

It works just the same for dust based or any other criteria that makes transactions non-standard— including the double spending working if the second transaction is sent minutes after. Exactly the same code is executed and the same behavior observed for any case of a non-standard transaction being used to achieve inconsistent forwarding.

Quoted text (2 lines)
> Our only intention is to raise the awareness for merchants who have to
> accept zero-confirmation transactions.

That is great and I'm certainly glad to see people doing that.

Though take care it that your focus on signature encoding differences doesn't create a misunderstanding. This isn't only an issue with these particular versions: There is always mining and relay behavior inhomogeneity in the network. The level of inhomogeneity changes over time— I believe its greatest when new reference client software that changes IsStandard but it is never zero as there are large miners with customized acceptance rules (also mempool state also creates inhomogeneity). The greater inhomogeneity results in higher success rates which may be important since some service could conceivable only be profitable exploited with a high enough success rate.

Jeff Garzik in reply to Arthur Gervais permalink original

On Thu, Jun 27, 2013 at 12:03 PM, Arthur Gervais <arthur.gervais@inf•ethz•ch> wrote:

Quoted text (4 lines)
> Our only intention is to raise the awareness for merchants who have to
> accept zero-confirmation transactions. They should be aware of the
> signature encoding difference between Bitcoin versions and the possible
> consequences.

Certainly. Though given current P2P network node version distributions, it is increasing difficult to relay the older version of transaction, and will only become more so in the future.

It also remains the case that merchants who accept zero confirmation transactions are likely already aware of the risk level, and make a business decision. One can see tiny digital downloads often at zero confirmation, but rarely a Porsche or house or bitcoin exchange deposit.