Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-06-26 Thread Peter Todd via bitcoin-dev
On Mon, May 29, 2017 at 10:55:37AM -0400, Russell O'Connor wrote: > > This doesn't hold true in the case of pruned trees, as for the pruning to > > be > > useful, you don't know what produced the left merkleRoot, and thus you > > can't > > guarantee it is in fact a midstate of a genuine SHA256 hash

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-06-01 Thread Russell O'Connor via bitcoin-dev
On Mon, May 29, 2017 at 12:10 PM, Peter Todd wrote: > On Mon, May 29, 2017 at 10:55:37AM -0400, Russell O'Connor wrote: > > Some of this proposal can be salvaged, I think, by putting the hash of > the > > tags into Sha256Compress's first argument: > > > > merkleRoot : Tree BitString -> Word25

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-29 Thread Peter Todd via bitcoin-dev
On Mon, May 29, 2017 at 10:55:37AM -0400, Russell O'Connor wrote: > > This doesn't hold true in the case of pruned trees, as for the pruning to > > be > > useful, you don't know what produced the left merkleRoot, and thus you > > can't > > guarantee it is in fact a midstate of a genuine SHA256 hash

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-29 Thread Russell O'Connor via bitcoin-dev
On Sun, May 28, 2017 at 4:26 AM, Peter Todd wrote: > On Mon, May 22, 2017 at 03:05:49AM -0400, Russell O'Connor via bitcoin-dev > wrote: > > Not all of the inputs to the SHA256 compression function are created > > equal. Only the second argument, the chunk data, is applied to the > SHA256 > > ex

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-28 Thread Peter Todd via bitcoin-dev
On Mon, May 22, 2017 at 03:05:49AM -0400, Russell O'Connor via bitcoin-dev wrote: > Not all of the inputs to the SHA256 compression function are created > equal. Only the second argument, the chunk data, is applied to the SHA256 > expander. `merkleRoot` is designed to ensure that the first argum

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-27 Thread Russell O'Connor via bitcoin-dev
On May 28, 2017 06:09, "Russell O'Connor" wrote: On May 28, 2017 03:16, "Peter Todd" wrote: On Mon, May 22, 2017 at 06:32:38PM -0400, Russell O'Connor wrote: > On May 22, 2017 23:05, "Peter Todd" wrote: > > On Mon, May 22, 2017 at 03:05:49AM -0400, Russell O'Connor via bitcoin-dev > wrote: >

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-27 Thread Peter Todd via bitcoin-dev
On Mon, May 22, 2017 at 06:32:38PM -0400, Russell O'Connor wrote: > On May 22, 2017 23:05, "Peter Todd" wrote: > > On Mon, May 22, 2017 at 03:05:49AM -0400, Russell O'Connor via bitcoin-dev > wrote: > > MerkleRoot := SHA256(SHA256(LeftRoot ⋅ RightRoot)) > > sha256Compress : Word256 × Word

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-22 Thread Bram Cohen via bitcoin-dev
On Mon, May 22, 2017 at 12:05 AM, Russell O'Connor via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > The SHA256 compression function takes two inputs: > > 1. A 256-bit value for the previous chunk in a chain, or an initial vector > in the case of the first chunk. > 2. A 512-bit chu

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-22 Thread Russell O'Connor via bitcoin-dev
On May 22, 2017 23:05, "Peter Todd" wrote: On Mon, May 22, 2017 at 03:05:49AM -0400, Russell O'Connor via bitcoin-dev wrote: > MerkleRoot := SHA256(SHA256(LeftRoot ⋅ RightRoot)) > sha256Compress : Word256 × Word512 -> Word256 To be clear, what math operations do you mean by "⋅" and "×"?

Re: [bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-22 Thread Peter Todd via bitcoin-dev
On Mon, May 22, 2017 at 03:05:49AM -0400, Russell O'Connor via bitcoin-dev wrote: > MerkleRoot := SHA256(SHA256(LeftRoot ⋅ RightRoot)) > sha256Compress : Word256 × Word512 -> Word256 To be clear, what math operations do you mean by "⋅" and "×"? -- https://petertodd.org 'peter'[:-1]@pete

[bitcoin-dev] A Method for Computing Merkle Roots of Annotated Binary Trees

2017-05-22 Thread Russell O'Connor via bitcoin-dev
## Introduction This document aims to specify and justify a method for computing Merkle roots for tree structures whose nodes are annotated with other data. While this proposal could be used to replace Bitcoin's Merkle root calculation, it is primarily aimed at new applications such as MAST, (U)TX