Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1AF7BC002D for ; Tue, 26 Jul 2022 21:50:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 2E7174032C for ; Tue, 26 Jul 2022 21:50:53 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 2E7174032C Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=achow101.com header.i=@achow101.com header.a=rsa-sha256 header.s=protonmail3 header.b=PbJsv8XM X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.102 X-Spam-Level: X-Spam-Status: No, score=-2.102 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V6m1NIXwuyXW for ; Tue, 26 Jul 2022 21:50:51 +0000 (UTC) X-Greylist: delayed 00:09:15 by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 0F6F040213 Received: from mail-41104.protonmail.ch (mail-41104.protonmail.ch [185.70.41.104]) by smtp4.osuosl.org (Postfix) with ESMTPS id 0F6F040213 for ; Tue, 26 Jul 2022 21:50:50 +0000 (UTC) Date: Tue, 26 Jul 2022 21:41:12 +0000 Authentication-Results: mail-41104.protonmail.ch; dkim=pass (2048-bit key) header.d=achow101.com header.i=@achow101.com header.b="PbJsv8XM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=achow101.com; s=protonmail3; t=1658871683; x=1659130883; bh=7uq+3v9UaTPccuwFTh7VB/f0k+hJl6rvspdTISz8NEo=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=PbJsv8XMFN6dOeoNFji3o0qUNoxtt6FxyPkgVTyfMHC1qS+ikE2dMpNFE2xmnlAvZ LxRfzTLX3eqv4CcFFb8pVWDUgsTOJlWK/nadKikwAjReX9qiImv9jcYT4R2khuPI6Z wOkzfnelBr2KBXWpMW0/SMIrLALK7tbWxR1FDT38C3/Acoa5sfQZrh1CQE7bfbspTK 8AqmLUGjePXeycBYRwpmFm0yvERuuBRmMHPt9ksHVNTKxCVLm97FafxVElZYJeNTAw wBXG4fuAOg8vlRq2Z0L8Xl1ZI7KaHtIQDlzTG9lDjsYDj2RLGKjJSPUxXl8+0hy39n Y/xL1TplOXCCA== To: bitcoin-dev@lists.linuxfoundation.org From: Andrew Chow Reply-To: Andrew Chow Message-ID: Feedback-ID: 6230017:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [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: Tue, 26 Jul 2022 21:50:54 -0000 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-des= cs.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 ---
 =C2=A0 BIP: multipath-descs
 =C2=A0 Layer: Applications
 =C2=A0 Title: Multipath Descriptor Key Expressions
 =C2=A0 Author: Andrew Chow 
 =C2=A0 Comments-Summary: No comments yet.
 =C2=A0 Comments-URI:
https://github.com/bitcoin/bips/wiki/Comments:BIP-multipath-descs
 =C2=A0 Status: Draft
 =C2=A0 Type: Informational
 =C2=A0 Created: 2022-07-26
 =C2=A0 License: BSD-2-Clause
=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: * 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)=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 /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> =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: < 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. =3D=3DReference Implementation=3D=3D https://github.com/bitcoin/bitcoin/pull/22838