<oembed><type>rich</type><version>1.0</version><author_name>npub1jqxs4ftunmm8qjyw9s80hpcayewkjfhpxund29l9qvzy7xqx4duq85jqeg</author_name><author_url>https://nostr.ae/npub1jqxs4ftunmm8qjyw9s80hpcayewkjfhpxund29l9qvzy7xqx4duq85jqeg</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2021-02-12&#xA;📝 Original message:On Thu, Feb 11, 2021 at 3:05 PM Christopher Allen via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; What Blockchain Commons (and the Airgapped Wallet Community) call a policy&#xA;&gt; map would be&#xA;&gt;&#xA;&gt; ```&#xA;&gt; wsh(sortedmulti(1,,,))&#xA;&gt; ```&#xA;&gt;&#xA;&gt; A PBKDF of that as would be unique for all 2 of 3 segwig transactions.&#xA;&gt; With the addition of the addition of the Policy Map creators optional note,&#xA;&gt; it would be truly unique. The Policy Map and/or PBKDF are small and could&#xA;&gt; easily added to existing APIs.&#xA;&gt;&#xA;&gt; So for legacy hardware, we can use existing 48&#39; subtree, but 3&#39; as the&#xA;&gt; format for this form (2&#39; is segwit), then the desktop can just ask for the&#xA;&gt; /48&#39;/0&#39;/0&#39;/3&#39;/PBKDF&#39; when it requests a new xpub from the hardware token.&#xA;&gt; More sophisticated Airgapped apps you can send&#xA;&gt; &#34;wsh(sortedmulti(1,,,))&#34;+label and let the cosigner app do the PBKDF, and&#xA;&gt; optionally allow it return something different in a full keyset (i.e.&#xA;&gt; &#34;[90081696/48&#39;/0&#39;/0&#39;/3&#39;/af3948cg…&#39;/]xpub6DYLEk…&#34;, and then the requesting&#xA;&gt; app, knowing that it is different from the PBKDF can know what to do if it&#xA;&gt; needs to what to ask for in the future.&#xA;&gt;&#xA;&#xA;Thanks Christopher, very interesting ideas... A couple of thoughts:&#xA;1/ Generating the path index using the policy is clever. However, I think&#xA;it has 2 problems. Number #1 is with the above scheme now you have a hard&#xA;dependency on (policy map + note) - losing (policy map + note) means that&#xA;you will lose access to PBKDF&#39;, and hence the funds permanently. At least&#xA;with the current soluttions, you can look up what the most common&#xA;derivation paths and indices are to recover funds in the worst case.&#xA;2/ Number #2 is that this wouldn&#39;t necessarily prevent XPUB reuse. It seems&#xA;like the above scheme depends on (a) the Coordinator keeping track&#xA;accurately of all the existing PBKDF-ed indices and (b) the Signer&#xA;truthfully gives the XPUB at the path that the Coordinator asks for. In&#xA;reality, neither of these conditions can be guaranteed. For example, the&#xA;Signer could lie about the XPUB at /48&#39;/0&#39;/0&#39;/3&#39;/PBKDF&#39; when it just keeps&#xA;reusing the XPUB at /48&#39;/0&#39;/0&#39;/2&#39;&#xA;3/ Preventing XPUB reuse is an interesting problem, but IMHO it is beyond&#xA;the scope of the current proposal. Maybe worth a separate BIP?&#xA;&#xA;Best,&#xA;Hugo&#xA;&#xA;&#xA;&#xA;On Thu, Feb 11, 2021 at 3:05 PM Christopher Allen via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; I think the key issue here is avoiding xpub key reuse in multisig. Not&#xA;&gt; only in the future with Schnorr, but we need it today!&#xA;&gt;&#xA;&gt; Current common practice by hardware wallets is the 48&#39;/0&#39;/0&#39;/2&#39; derivation&#xA;&gt; for segwit multsig ( e.g.&#xA;&gt; [90081696/48&#39;/0&#39;/0&#39;/2&#39;]xpub6DYLEkDfCdHzh5FHGHDJksQvFqu6kYANa1sfo6fA8n5ZWkSwyCRVVzyq9LY2eNGB6T9BKDeGJp2ZarjRZHd7WB95nSaFEDhFMK6zSV6D49b&#xA;&gt; ) is the only one used for ALL multisigs offered by that hardware wallet.&#xA;&gt;&#xA;&gt; As Pieter said, leveraging a HD path parameters can help, but we need a&#xA;&gt; better, less reusable path for the index.&#xA;&gt;&#xA;&gt; I personally suggest a simpler solution, which is to create an index using&#xA;&gt; a PBKDF of the Account Policy (a descriptor with all xpubs and keys&#xA;&gt; removed), plus optional notes. (BTW, I think double sha256 or HMAC is&#xA;&gt; overkill).&#xA;&gt;&#xA;&gt; Example: for the reference bit descriptor that might result in:&#xA;&gt;&#xA;&gt; ```&#xA;&gt;&#xA;&gt; wsh(sortedmulti(2,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))&#xA;&gt; ```&#xA;&gt;&#xA;&gt; What Blockchain Commons (and the Airgapped Wallet Community) call a policy&#xA;&gt; map would be&#xA;&gt;&#xA;&gt; ```&#xA;&gt; wsh(sortedmulti(1,,,))&#xA;&gt; ```&#xA;&gt;&#xA;&gt; A PBKDF of that as would be unique for all 2 of 3 segwig transactions.&#xA;&gt; With the addition of the addition of the Policy Map creators optional note,&#xA;&gt; it would be truly unique. The Policy Map and/or PBKDF are small and could&#xA;&gt; easily added to existing APIs.&#xA;&gt;&#xA;&gt; So for legacy hardware, we can use existing 48&#39; subtree, but 3&#39; as the&#xA;&gt; format for this form (2&#39; is segwit), then the desktop can just ask for the&#xA;&gt; /48&#39;/0&#39;/0&#39;/3&#39;/PBKDF&#39; when it requests a new xpub from the hardware token.&#xA;&gt; More sophisticated Airgapped apps you can send&#xA;&gt; &#34;wsh(sortedmulti(1,,,))&#34;+label and let the cosigner app do the PBKDF, and&#xA;&gt; optionally allow it return something different in a full keyset (i.e.&#xA;&gt; &#34;[90081696/48&#39;/0&#39;/0&#39;/3&#39;/af3948cg…&#39;/]xpub6DYLEk…&#34;, and then the requesting&#xA;&gt; app, knowing that it is different from the PBKDF can know what to do if it&#xA;&gt; needs to what to ask for in the future.&#xA;&gt;&#xA;&gt; The other advantage of this technique is that the cosigner app can know&#xA;&gt; what policy it is participating in, before the descriptor is completed. It&#xA;&gt; may decide it doesn&#39;t want to participate in some funky 4:9 with a weird&#xA;&gt; script, and not return an xpub at all.&#xA;&gt;&#xA;&gt; Long term I think a commitment scheme should be used, so that you don&#39;t&#xA;&gt; reveal what xpub you offered until all the parties xpubs are shared, but as&#xA;&gt; Pieter said, we can do that at the same time we do the musig. But we need&#xA;&gt; to prevent xpub reuse NOW, and I think my proposal easy and could the job.&#xA;&gt;&#xA;&gt; -- Christopher Allen, Blockchain Commons&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210212/bfb1f588/attachment.html&gt;</html></oembed>