Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 256F595E for ; Mon, 3 Apr 2017 03:36:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sender-of-o52.zoho.com (sender-of-o52.zoho.com [135.84.80.217]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2D332107 for ; Mon, 3 Apr 2017 03:36:24 +0000 (UTC) Received: from [192.168.1.111] (137.189.135.19 [137.189.135.19]) by mx.zohomail.com with SMTPS id 1491190578095694.2786970394118; Sun, 2 Apr 2017 20:36:18 -0700 (PDT) From: Johnson Lau Message-Id: <9820147A-F1E8-4BF6-BBE0-005D20D49653@xbt.hk> Content-Type: multipart/alternative; boundary="Apple-Mail=_1C116E78-B8FE-4131-986A-7A3B0B626FC1" Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Date: Mon, 3 Apr 2017 11:36:13 +0800 In-Reply-To: To: Russell O'Connor References: <2D094CEC-3756-45B0-970F-1EB33DF352C5@xbt.hk> X-Mailer: Apple Mail (2.3259) X-ZohoMailClient: External X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE 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] BIP draft: Extended block header hardfork X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2017 03:36:25 -0000 --Apple-Mail=_1C116E78-B8FE-4131-986A-7A3B0B626FC1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 3 Apr 2017, at 04:39, Russell O'Connor = wrote: >=20 > On Sun, Apr 2, 2017 at 4:13 PM, Johnson Lau via bitcoin-dev = > wrote: > =E2=80=A2 the witness of the first input of the coinbase = transaction MUST have exactly one stack item (the "extended header"), = with the following data: > =E2=80=A2 bytes 0 to 3: nHeight MUST be equal to the = height of this block (signed little endian) >=20 > Someone told me a while back that it would be more natural if we move = the nHeight from the coinbase script to the coinbase locktime. Have you = considered doing this? Yes, it=E2=80=99d look much better. But I=E2=80=99m thinking of a = different approach: instead of using a hash of 0000=E2=80=A6.0000, we = use the hash of previous block for the coinbase input. With some new = SIGHASH design, this allows people to pay to a child of a particular = block. This is actually implemented in my spoonnet2 branch. I=E2=80=99ll = describe it with a BIP soon However, what I=E2=80=99m trying to do in the extended block header is = independent to the design of coinbase tx. Here I=E2=80=99m trying to let = people knowing the height just by a header and extended header (<300 = bytes), without requiring all headers in the history. Also I forgot to post the link of the BIP: = https://github.com/jl2012/bips/blob/spoonnet/bip-extheader.mediawiki = = --Apple-Mail=_1C116E78-B8FE-4131-986A-7A3B0B626FC1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 3 Apr 2017, at 04:39, Russell O'Connor <roconnor@blockstream.io> wrote:

On Sun, Apr 2, 2017 at 4:13 PM, Johnson Lau via bitcoin-dev = <bitcoin-dev@lists.linuxfoundation.org> = wrote:
    =     =E2=80=A2 the witness of the first input of the coinbase = transaction MUST have exactly one stack item (the "extended header"), = with the following data:
                =E2=80=A2 bytes = 0 to 3: nHeight MUST be equal to the height of this block (signed little = endian)

 Someone told me a while back that = it would be more natural if we move the nHeight from the coinbase script = to the coinbase locktime.  Have you considered doing this?

Yes, it=E2=80=99d look much better. But I=E2=80=99m thinking = of a different approach: instead of using a hash of 0000=E2=80=A6.0000, = we use the hash of previous block for the coinbase input. With some new = SIGHASH design, this allows people to pay to a child of a particular = block. This is actually implemented in my spoonnet2 branch. I=E2=80=99ll = describe it with a BIP soon

However, what I=E2=80=99m trying to do in the extended block = header is independent to the design of coinbase tx. Here I=E2=80=99m = trying to let people knowing the height just by a header and extended = header (<300 bytes), without requiring all headers in the = history.

= --Apple-Mail=_1C116E78-B8FE-4131-986A-7A3B0B626FC1--