From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4D1FCC002D for ; Wed, 27 Jul 2022 07:57:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 10C0381A30 for ; Wed, 27 Jul 2022 07:57:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 10C0381A30 Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Fcb7RPHY X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.098 X-Spam-Level: X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KncEbnm7uqU0 for ; Wed, 27 Jul 2022 07:57:33 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 4986081A33 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by smtp1.osuosl.org (Postfix) with ESMTPS id 4986081A33 for ; Wed, 27 Jul 2022 07:57:33 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id y11so25808296lfs.6 for ; Wed, 27 Jul 2022 00:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=11w7yMHmjYtxhE9CsHBia2Q5nlLKL/yIF84ktxI0H3E=; b=Fcb7RPHYtQ2gP5qunzaYS0AEozUonMK7d6dTD6pbAvJTwwle0wv/t8SuOUH27r/CvE CNcB7Qc+uNNH5yejLOhS3UHgZDPpup7MU+vBXnA7m+V/WzvsvOa2iANzztF6BXZy+srP 1LueiNgUOgt8eXYPuFSvGdJCh7xwH19ZfqlroAVbLhBordJcaRlBbdLC9CI4XDda4Z2+ A5z/HH47Urz3vDvY0HQgkJactx16uxVwzO653uLKDxw4Oxqs4gJezI6icy99OIzSmluK 3JG1m9JqWcx9k5aC5ybLId19QfeSVJ2l2f8tAxO0Pm2gZKByPHl0rNeC1xL2ZXU4fXnU 3J5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=11w7yMHmjYtxhE9CsHBia2Q5nlLKL/yIF84ktxI0H3E=; b=Dw5XPHXJt1JDBMTA1AyruyYja12l6nEFI2dL4hehA1jmjF3jOF4V7K3beDdsyDhgBb +a3XdZOtDY+aeKGJdwKLQxzGwh+6sC5Oi8jSPNl6QQ5l6RWpLi5GQuzqkMtRfEsG7HUC gAF5wgl8S0PbxHP8/JpWWSzwrWZbhK+Zo5R9xY5aqhRM9RLYPfBczzgnR4I9BuGAxy2t MstluhrwZDvB44pqy40iFHu90F+kVTPGteZ0XI+NwB6OIneZlDCWJXljZtCF1TCjgq5K yNdMCAnHUsgw9QeVlBlAh4csUecoG+Do+bZi74AMzvVGVd4pRHvbtMLpfFTsqJ0sYW/R 7jAA== X-Gm-Message-State: AJIora8ABbcfEdAfJaH5nzc3oDx7+eqi85nawb5AaTyLJOYBi3vcn2dx 2j16l3k8A+j+MEkieNJwv8/OC7fGw64YfG30DQ+WUo1g X-Google-Smtp-Source: AGRyM1vGNgm6Q4/31m1y/vrJe1RdQQJwJjhR2my03aKk2VsE5alsofpuxci53/yzoBNjPLZ+2wq9OnoGyiHCIsGtwsE= X-Received: by 2002:a05:6512:3592:b0:48a:8c8d:44c8 with SMTP id m18-20020a056512359200b0048a8c8d44c8mr5601422lfr.436.1658908650818; Wed, 27 Jul 2022 00:57:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Craig Raw Date: Wed, 27 Jul 2022 09:57:19 +0200 Message-ID: To: Andrew Chow , Bitcoin Protocol Discussion Content-Type: multipart/alternative; boundary="000000000000d8ced605e4c4c47d" X-Mailman-Approved-At: Wed, 27 Jul 2022 11:17:43 +0000 Subject: Re: [bitcoin-dev] BIP Proposal: Receiving and Change Derivation Paths in a Single Descriptor X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2022 07:57:35 -0000 --000000000000d8ced605e4c4c47d Content-Type: text/plain; charset="UTF-8" Thanks Andrew for proposing the BIP, I have used this syntax in Sparrow for some time now. I find a single, compact descriptor for a wallet is important when copying out as a backup, particularly onto durable media. More so when it is a multisig wallet that ideally requires a backup of all the xpubs. Multipath descriptors as proposed in this BIP address this need well. Craig On Tue, Jul 26, 2022 at 11:51 PM Andrew Chow via bitcoin-dev < bitcoin-dev@lists.linuxfoundation.org> wrote: > Hi All, > > I would like to propose a BIP that de-duplicates and simplifies how we > represent descriptors for receiving and change addresses. Under the > existing BIPs, this requires two descriptors, where the vast majority of > the descriptors are the same, except for a single derivation path > element. This proposal allows descriptors to have a single derivation > path element that can specify a pair of indexes. Parsers would then > expand these into two almost identical descriptors with the difference > being that the first uses the first of the pair of indexes, and the > second uses the second. > > The proposed notation is ``. As an example, > `wpkh(xpub.../0/<0;1>/*)` would be expanded into `wpkh(xpub.../0/0/*)` > and `wpkh(xpub.../0/1/*)`. > > This also works for descriptors involving multiple keys - the first > element in every pair is used for the first descriptor, and the second > element of each pair in the second descriptor. > > The full text of the BIP can be found at > > https://github.com/achow101/bips/blob/bip-multipath-descs/bip-multipath-descs.mediawiki > and also copied below. An implementation of it to Bitcoin Core is > available at https://github.com/bitcoin/bitcoin/pull/22838. > > Any feedback on this would be appreciated. > > Thanks, > Andrew Chow > > --- > >
>    BIP: multipath-descs
>    Layer: Applications
>    Title: Multipath Descriptor Key Expressions
>    Author: Andrew Chow 
>    Comments-Summary: No comments yet.
>    Comments-URI:
> https://github.com/bitcoin/bips/wiki/Comments:BIP-multipath-descs
>    Status: Draft
>    Type: Informational
>    Created: 2022-07-26
>    License: BSD-2-Clause
> 
> > ==Abstract== > > This document specifies a modification to Key Expressions of Descriptors > that are described in BIP 380. > This modification allows Key Expressions to indicate BIP 32 derivation > path steps that can have multiple values. > > ==Copyright== > > This BIP is licensed under the BSD 2-clause license. > > ==Motivation== > > Descriptors can describe the scripts that are used in a wallet, but > wallets often require at least two descriptors for all of the scripts > that they watch for. > Wallets typically have one descriptor for producing receiving addresses, > and the other for change addresses. > These descriptors are often extremely similar - they produce the same > types of scripts, derive keys from the same master key, and use > derivation paths that are almost identical. > The only differences are in the derivation path where one of the steps > will be different between the descriptors. > Thus it is useful to have a notation to represent both descriptors as a > single descriptor where one of the derivation steps is a pair of values. > > ==Specification== > > For extended keys and their derivations paths in a Key Expression, BIP > 380 states: > > * xpub encoded extended public key or xprv encoded > extended private key (as defined in BIP 32) > ** Followed by zero or more /NUM or /NUMh path > elements indicating BIP 32 derivation steps to be taken after the given > extended key. > ** Optionally followed by a single /* or /*h final > step to denote all direct unhardened or hardened children. > > This is modifed to state: > > * xpub encoded extended public key or xprv encoded > extended private key (as defined in BIP 32) > ** Followed by zero or more /NUM or /NUMh path > elements indicating BIP 32 derivation steps to be taken after the given > extended key. > ** Followed by zero or one / (NUM may be > followed by h to indicated a hardened step) path element > indicating a pair of BIP 32 derivation steps to be taken after the given > extended key. > ** Followed by zero or more /NUM or /NUMh path > elements indicating BIP 32 derivation steps to be taken after the given > extended key. > ** Optionally followed by a single /* or /*h final > step to denote all direct unhardened or hardened children. > > When a / is encountered, parsers should produce two > descriptors where the first descriptor uses the first NUM, and > a second descriptor uses the second NUM. > > The common use case for this is to represent descriptors for producing > receiving and change addresses. > When interpreting for this use case, wallets should use the first > descriptor for producing receiving addresses, and the second descriptor > for producing change addresses. > For this use case, the element will commonly be the value /<0;1> > > ==Test Vectors== > > TBD > > ==Backwards Compatibility== > > This is an addition to the Key Expressions defined in BIP 380. > Key Expressions using the format described in BIP 380 are compatible > with this modification and parsers that implement this will still be > able to parse such descriptors. > However as this is an addition to Key Expressions, older parsers will > not be able to understand such descriptors. > > This modification to Key Expressions uses two new characters: < > and ;. > These are part of the descriptor character set and so are covered by the > checksum algorithm. > As these are previously unused characters, old parsers will not > accidentally mistake them for indicating something else. > > ==Reference Implementation== > > https://github.com/bitcoin/bitcoin/pull/22838 > > > _______________________________________________ > bitcoin-dev mailing list > bitcoin-dev@lists.linuxfoundation.org > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev > --000000000000d8ced605e4c4c47d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Andrew for proposing the BIP, I have used this synt= ax in Sparrow for some time now.=C2=A0

I find a single, = compact=C2=A0descriptor for a wallet is important when copying out as a bac= kup, particularly onto durable media. More so when it is a multisig wallet = that ideally requires a backup of all the xpubs. Multipath descriptors as p= roposed in this BIP address this need well.

Craig<= /div>

On Tue, Jul 26, 2022 at 11:51 PM Andrew Chow via bitcoin-dev <bitcoin-dev@lists.linux= foundation.org> wrote:
Hi All,

I would like to propose a BIP that de-duplicates and simplifies how we
represent descriptors for receiving and change addresses. Under the
existing BIPs, this requires two descriptors, where the vast majority of the descriptors are the same, except for a single derivation path
element. This proposal allows descriptors to have a single derivation
path element that can specify a pair of indexes. Parsers would then
expand these into two almost identical descriptors with the difference
being that the first uses the first of the pair of indexes, and the
second uses the second.

The proposed notation is `<a;b>`. As an example,
`wpkh(xpub.../0/<0;1>/*)` would be expanded into `wpkh(xpub.../0/0/*)= `
and `wpkh(xpub.../0/1/*)`.

This also works for descriptors involving multiple keys - the first
element in every pair is used for the first descriptor, and the second
element of each pair in the second descriptor.

The full text of the BIP can be found at
https://githu= b.com/achow101/bips/blob/bip-multipath-descs/bip-multipath-descs.mediawiki<= /a>
and also copied below. An implementation of it to Bitcoin Core is
available at
https://github.com/bitcoin/bitcoin/pull/2= 2838.

Any feedback on this would be appreciated.

Thanks,
Andrew Chow

---

<pre>
=C2=A0=C2=A0 BIP: multipath-descs
=C2=A0=C2=A0 Layer: Applications
=C2=A0=C2=A0 Title: Multipath Descriptor Key Expressions
=C2=A0=C2=A0 Author: Andrew Chow <andrew@achow101.com>
=C2=A0=C2=A0 Comments-Summary: No comments yet.
=C2=A0=C2=A0 Comments-URI:
https://github.com/bitcoin/bips/wik= i/Comments:BIP-multipath-descs
=C2=A0=C2=A0 Status: Draft
=C2=A0=C2=A0 Type: Informational
=C2=A0=C2=A0 Created: 2022-07-26
=C2=A0=C2=A0 License: BSD-2-Clause
</pre>

=3D=3DAbstract=3D=3D

This document specifies a modification to Key Expressions of Descriptors that are described in BIP 380.
This modification allows Key Expressions to indicate BIP 32 derivation
path steps that can have multiple values.

=3D=3DCopyright=3D=3D

This BIP is licensed under the BSD 2-clause license.

=3D=3DMotivation=3D=3D

Descriptors can describe the scripts that are used in a wallet, but
wallets often require at least two descriptors for all of the scripts
that they watch for.
Wallets typically have one descriptor for producing receiving addresses, and the other for change addresses.
These descriptors are often extremely similar - they produce the same
types of scripts, derive keys from the same master key, and use
derivation paths that are almost identical.
The only differences are in the derivation path where one of the steps
will be different between the descriptors.
Thus it is useful to have a notation to represent both descriptors as a
single descriptor where one of the derivation steps is a pair of values.
=3D=3DSpecification=3D=3D

For extended keys and their derivations paths in a Key Expression, BIP
380 states:

* <tt>xpub</tt> encoded extended public key or <tt>xprv&l= t;/tt> encoded
extended private key (as defined in BIP 32)
** Followed by zero or more <tt>/NUM</tt> or <tt>/NUMh<= ;/tt> path
elements indicating BIP 32 derivation steps to be taken after the given
extended key.
** Optionally followed by a single <tt>/*</tt> or <tt>/*h= </tt> final
step to denote all direct unhardened or hardened children.

This is modifed to state:

* <tt>xpub</tt> encoded extended public key or <tt>xprv&l= t;/tt> encoded
extended private key (as defined in BIP 32)
** Followed by zero or more <tt>/NUM</tt> or <tt>/NUMh<= ;/tt> path
elements indicating BIP 32 derivation steps to be taken after the given
extended key.
** Followed by zero or one <tt>/<NUM;NUM></tt> (<tt>= ;NUM</tt> may be
followed by <tt>h</tt> to indicated a hardened step)=C2=A0 path= element
indicating a pair of BIP 32 derivation steps to be taken after the given extended key.
** Followed by zero or more <tt>/NUM</tt> or <tt>/NUMh<= ;/tt> path
elements indicating BIP 32 derivation steps to be taken after the given
extended key.
** Optionally followed by a single <tt>/*</tt> or <tt>/*h= </tt> final
step to denote all direct unhardened or hardened children.

When a <tt>/<NUM;NUM></tt> is encountered, parsers should= produce two
descriptors where the first descriptor uses the first <tt>NUM</tt&= gt;, and
a second descriptor uses the second <tt>NUM</tt>.

The common use case for this is to represent descriptors for producing
receiving and change addresses.
When interpreting for this use case, wallets should use the first
descriptor for producing receiving addresses, and the second descriptor
for producing change addresses.
For this use case, the element will commonly be the value <tt>/<0;= 1></tt>

=3D=3DTest Vectors=3D=3D

TBD

=3D=3DBackwards Compatibility=3D=3D

This is an addition to the Key Expressions defined in BIP 380.
Key Expressions using the format described in BIP 380 are compatible
with this modification and parsers that implement this will still be
able to parse such descriptors.
However as this is an addition to Key Expressions, older parsers will
not be able to understand such descriptors.

This modification to Key Expressions uses two new characters: <tt><= ;</tt>
and <tt>;</tt>.
These are part of the descriptor character set and so are covered by the checksum algorithm.
As these are previously unused characters, old parsers will not
accidentally mistake them for indicating something else.

=3D=3DReference Implementation=3D=3D

https://github.com/bitcoin/bitcoin/pull/22838


_______________________________________________
bitcoin-dev mailing list
= bitcoin-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mail= man/listinfo/bitcoin-dev
--000000000000d8ced605e4c4c47d--