Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 95E65A84 for ; Tue, 5 Sep 2017 22:29:02 +0000 (UTC) X-Greylist: delayed 00:15:10 by SQLgrey-1.7.6 Received: from blaine.gmane.org (unknown [195.159.176.226]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1226D402 for ; Tue, 5 Sep 2017 22:29:00 +0000 (UTC) Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dpM69-0003Ed-Vo for bitcoin-dev@lists.linuxfoundation.org; Wed, 06 Sep 2017 00:13:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bitcoin-dev@lists.linuxfoundation.org From: Andreas Schildbach Date: Wed, 6 Sep 2017 00:13:12 +0200 Message-ID: References: <43636dd6-ab9e-da15-59ae-f31eb11ff7ff@electrum.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@blaine.gmane.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 In-Reply-To: <43636dd6-ab9e-da15-59ae-f31eb11ff7ff@electrum.org> Content-Language: en-US X-Spam-Status: No, score=2.4 required=5.0 tests=DKIM_ADSP_ALL,RDNS_NONE autolearn=disabled version=3.3.1 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: Re: [bitcoin-dev] Proposal: bip32 version bytes for segwit scripts 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: Tue, 05 Sep 2017 22:29:02 -0000 Generally I like the idea, but maybe we should come up with a (Bech32-based?) new standard that also includes the key birthdate (aka "wallet birthdate"). Also I heard Core will mix addresses of all types on the same HD chain. What prefix would it pick? "*pub"? On 09/05/2017 12:25 PM, Thomas Voegtlin via bitcoin-dev wrote: > BIP32 extended public/private keys have version bytes that result in the > user visible xpub/xprv prefix. The BIP's recommendation is to use > different version bytes for other networks (such as tpub/tprv for testnet) > > I would like to use additional version bytes to indicate the type of > output script used with the public keys. > > I believe the change should be user visible, because users are exposed > to master public keys. I propose the following prefixes: > > ========== =========== =================================== > Version Prefix Description > ========== =========== =================================== > 0x0488ade4 xprv P2PKH or P2SH > 0x0488b21e xpub P2PKH or P2SH > 0x049d7878 yprv (P2WPKH or P2WSH) nested in P2SH > 0x049d7cb2 ypub (P2WPKH or P2WSH) nested in P2SH > 0x04b2430c zprv P2WPKH or P2WSH > 0x04b24746 zpub P2WPKH or P2WSH > ========== =========== =================================== > (source: http://docs.electrum.org/en/latest/seedphrase.html) > > I have heard the argument that xpub/xprv serialization is a format for > keys, and that it should not be used to encode how these keys are used. > However, the very existence of version bytes, and the fact that they are > used to signal whether keys will be used on testnet or mainnet goes > against that argument. > > If we do not signal the script type in the version bytes, I believe > wallet developers are going to use dirtier tricks, such as the bip32 > child number field in combination with bip43/bip44/bip49.