public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Thomas Voegtlin <thomasv@electrum•org>
To: "bitcoin-dev@lists•linuxfoundation.org"
	<bitcoin-dev@lists•linuxfoundation.org>
Subject: Re: [bitcoin-dev] Proposal: Extended serialization format for BIP-32 wallets
Date: Thu, 7 Sep 2017 22:39:17 +0200	[thread overview]
Message-ID: <9e74dc17-105c-b43c-7780-4fa690043fe2@electrum.org> (raw)
In-Reply-To: <84f4a4b8-fcbd-433b-9556-174ec5475f61@satoshilabs.com>



On 07.09.2017 18:23, Pavol Rusnak wrote:
> On 07/09/17 06:29, Thomas Voegtlin via bitcoin-dev wrote:
>> A solution is still needed to wallets who do not wish to use BIP43
> 
> What if we added another byte field OutputType for wallets that do not
> follow BIP43?
> 
> 0x00 - P2PKH output type
> 0x01 - P2WPKH-in-P2SH output type
> 0x02 - native Segwit output type
> 
> Would that work for you?
> 
> The question is whether this field should be present only if depth==0x00
> or at all times. What is your suggestion, Thomas?
> 


well, in my initial proposal, I wrote that this value should be user
visible. That is why I used version bytes. If you create an extra byte
field, and then use base58 or bech32 encoding, the value will not be
user visible anymore.

The initial implementation of segwit xpub/xprv in Electrum used a flag
that was not user visible (I added 1 to the bip32 version bytes, which
leaves the xpub/xprv prefix unchanged). I have experimented with that
invisible flag for more than 6 months now, and I am now convinced that
it is better to make that flag user visible.

The reason is that when users create wallets with multisig scripts, they
need to combine several master public keys. However, these master public
keys should all be of the same type: it would not make sense to create a
2 of 3 multisig wallet with a one xpub, one ypub and one zpub. By
imposing that all master keys are of the same type, we ensure that all
cosigners agree on the script type that will be used to derive addresses.

In other words, if users are exposed to master keys and need to
manipulate them, it is better to let them see what they are doing.

OTOH if you do not plan to expose your users to these keys, you probably
do not need a serialization format.


  parent reply	other threads:[~2017-09-07 20:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 22:29 Pavol Rusnak
2017-09-07  3:52 ` Kabuto Samourai
2017-09-07 16:25   ` Pavol Rusnak
2017-09-07 16:30     ` Kabuto Samourai
2017-09-07 16:37       ` Pavol Rusnak
2017-09-07 18:02         ` Peter Todd
2017-09-07  4:29 ` Thomas Voegtlin
2017-09-07 16:23   ` Pavol Rusnak
2017-09-07 16:33     ` Kabuto Samourai
2017-09-07 19:35     ` Andreas Schildbach
2017-09-07 20:00       ` Pavol Rusnak
2017-09-07 20:39     ` Thomas Voegtlin [this message]
2017-09-07 16:47 ` Jonas Schnelli
2017-09-07 18:09   ` Peter Todd
2017-09-07 18:38   ` Pavol Rusnak

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=9e74dc17-105c-b43c-7780-4fa690043fe2@electrum.org \
    --to=thomasv@electrum$(echo .)org \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.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