public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: "Jeremy Spilman" <jeremy@taplink•co>
To: Natanael <natanael.l@gmail•com>, "Peter Todd" <pete@petertodd•org>
Cc: bitcoin-development@lists•sourceforge.net
Subject: Re: [Bitcoin-development] bitcoinj 0.11 released, with p2sh, bip39 and payment protocol support
Date: Tue, 04 Feb 2014 23:57:36 -0800	[thread overview]
Message-ID: <op.xastqaf9yldrnw@laptop-air> (raw)
In-Reply-To: <20140204160414.GA23803@savin>

Well the point of the Merkle tree is that if I all you have is the top,  
and all I give you is a leaf node and the siblings of all parents of that  
leaf, then by simply hashing you can check if the node was actually  
present in the tree.

The only reason this works is because it's hard for an attacker to come up  
with the list of values which would ultimately hash together to produce  
the expected top value. But if the hash function is actually just XOR, it  
becomes completely trivial for me to claim any value I want was in the  
tree.

1) Pick the fake value you want to claim was in the tree (leaf node)
2) Choose some random values to fake the depth in the tree
3) Calculate the last value as 'Prev (x) Top'
4) When your victim goes to verify set membership, they will get the top  
value they expected



On Tue, 04 Feb 2014 08:04:14 -0800, Peter Todd <pete@petertodd•org> wrote:

> On Tue, Feb 04, 2014 at 04:17:47PM +0100, Natanael wrote:
>> Because it's trivial to create collisions! You can choose exactly what
>> output you want. That's why XOR is a very bad digest scheme.
>
> You're close, but not quite.
>
> So, imagine you have a merkle tree, and you're trying to timestamp some
> data at the bottom of the tree. Now you can successfully timestamp the
> top digest in the Bitcoin blockchain right, and be sure that digest
> existed before some time. But what about the digests at the bottom of
> the tree? What can an attacker do exactly to make a fake timestamp if
> the tree is using XOR rather than a proper hash function?




  reply	other threads:[~2014-02-05  7:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-04 12:01 Mike Hearn
2014-02-04 13:03 ` Peter Todd
2014-02-04 13:13   ` Mike Hearn
2014-02-04 13:17     ` Peter Todd
2014-02-04 14:43       ` Jeff Garzik
2014-02-04 14:46         ` Peter Todd
2014-02-04 15:17       ` Natanael
2014-02-04 16:04         ` Peter Todd
2014-02-05  7:57           ` Jeremy Spilman [this message]
2014-02-05 15:09           ` Brooks Boyd
2014-02-07  9:21   ` Peter Todd
2014-02-07 10:48     ` Mike Hearn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.xastqaf9yldrnw@laptop-air \
    --to=jeremy@taplink$(echo .)co \
    --cc=bitcoin-development@lists$(echo .)sourceforge.net \
    --cc=natanael.l@gmail$(echo .)com \
    --cc=pete@petertodd$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox