<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-08&#xA;📝 Original message:Hi all,&#xA;I would like to propose a new BIP for Secure Multisig Setup.&#xA;This proposal has taken inputs from folks at Coldcard, Shift Crypto and&#xA;Cobo -- listed below as co-authors.&#xA;&#xA;This was inspired by my own experience working with hardware wallets on the&#xA;market, as well as existing research into the challenges of multisig.&#xA;&#xA;Cheers,&#xA;Hugo&#xA;&#xA;&lt;pre&gt;&#xA;  BIP: To be determined&#xA;  Layer: Applications&#xA;  Title: Bitcoin Secure Multisig Setup (BSMS)&#xA;  Author: Hugo Nguyen &lt;hugo at nunchuk.io&gt;, Peter Gray &lt;peter at coinkite.com&gt;,&#xA;Marko Bencun &lt;marko at shiftcrypto.ch&gt;, Aaron Chen &lt;aarondongchen at gmail.com&gt;,&#xA;Rodolfo Novak &lt;rodolfo at coinkite.com&gt;&#xA;  Comments-Summary: No comments yet.&#xA;  Comments-URI:&#xA;  Status: Proposed&#xA;  Type: Standards Track&#xA;  Created: 2020-11-10&#xA;  License: BSD-2-Clause&#xA;&lt;/pre&gt;&#xA;&#xA;==Introduction==&#xA;&#xA;===Abstract===&#xA;&#xA;This document proposes a mechanism to set up multisig wallets securely.&#xA;&#xA;===Copyright===&#xA;&#xA;This BIP is licensed under the 2-clause BSD license.&#xA;&#xA;===Motivation===&#xA;&#xA;The Bitcoin multisig experience has been greatly streamlined under [&#xA;https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki BIP-0174&#xA;(Partially Signed Bitcoin Transaction)]. However, what is still missing is&#xA;a standardized process for setting up multisig wallets securely across&#xA;different vendors.&#xA;&#xA;There are a number of concerns when it comes to setting up a multisig&#xA;wallet:&#xA;&#xA;# Whether the multisig configuration, such as Signer membership, script&#xA;type, derivation paths and number of signatures required, is correct and&#xA;not tampered with.&#xA;# Whether Signer persists the multisig configuration in their respective&#xA;storage, and under what format.&#xA;# Whether Signer&#39;s storage is tamper-proof.&#xA;# Whether Signer subsequently uses the multisig configuration to generate&#xA;and verify receive and change addresses.&#xA;&#xA;An attacker who can modify the multisig configuration can steal or hold&#xA;funds to ransom by duping the user into sending funds to the wrong address.&#xA;&#xA;This proposal seeks to address concerns #1 and #2: to mitigate the risk of&#xA;tampering during the initial setup phase, and to define an interoperable&#xA;multisig configuration format.&#xA;&#xA;Concerns #3 and #4 should be handled by Signers and is out of scope of this&#xA;proposal.&#xA;&#xA;==Specification==&#xA;&#xA;===Prerequisites===&#xA;This proposal assumes the parties in the multisig support [&#xA;https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki BIP32], [&#xA;https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md the&#xA;descriptor language] and encryption.&#xA;&#xA;==Roles==&#xA;===Coordinator===&#xA;&#xA;The Coordinator initiates the multisig setup. The Coordinator determines&#xA;what type of multisig is used and how many members and signatures are&#xA;needed. If encryption is enabled, the Coordinator generates a secret token,&#xA;to be shared among the parties for secure communication. The Coordinator&#xA;gathers information from the Signers to generate a descriptor record. The&#xA;Coordinator distributes the descriptor record back to the Signers.&#xA;&#xA;===Signer===&#xA;&#xA;The Signer is a participating member in the multisig. Its responsibilities&#xA;include providing its XPUB to the Coordinator, verifying that its XPUB is&#xA;included in the descriptor record and persisting the descriptor record in&#xA;its storage.&#xA;&#xA;==Setup Process==&#xA;&#xA;===Round 1===&#xA;&#xA;====Coordinator====&#xA;&#xA;* The Coordinator creates a multisig wallet creation session. The&#xA;Coordinator determines the type of multisig script used and the signing&#xA;configuration (&lt;tt&gt;M&lt;/tt&gt; and &lt;tt&gt;N&lt;/tt&gt;).&#xA;* If encryption is enabled, the Coordinator also generates a secret token,&#xA;hereby denoted &lt;tt&gt;TOKEN&lt;/tt&gt;.&#xA;* TOKEN is in ASCII format and must have a minimum of 8 characters. TOKEN&#xA;should expire after some time period determined by the Coordinator, e.g.,&#xA;24 hours.&#xA;* TOKEN acts as an encryption key among the parties. The method of&#xA;encryption is AES, CTR mode. The encryption key can be calculated by&#xA;performing a double hash operation on the TOKEN: &lt;tt&gt;ENCRYPTION_KEY =&#xA;SHA256(SHA256(TOKEN))&lt;/tt&gt;.&#xA;* A TOKEN value of &lt;tt&gt;-1&lt;/tt&gt; means that encryption is disabled and all&#xA;the encryption/decryption steps below can be skipped.&#xA;* The Coordinator shares the TOKEN with all participating Signers over a&#xA;secure channel.&#xA;&#xA;====Signer====&#xA;&#xA;* The Signer generates a key record by prompting the user for the TOKEN and&#xA;a derivation path.&#xA;* The first line in the record must be the &lt;tt&gt;TOKEN&lt;/tt&gt;. If encryption is&#xA;disabled, set the TOKEN to -1. The second line must be the &lt;tt&gt;KEY&lt;/tt&gt;,&#xA;whereas KEY is an XPUB. KEY must include key origin information and written&#xA;in the descriptor-defined format, i.e.: &lt;tt&gt;[{master key&#xA;fingerprint}/{derivation path}]{XPUB}&lt;/tt&gt;. The third line must be a&#xA;&lt;tt&gt;SIG&lt;/tt&gt;, whereas SIG is the signature generated by using the&#xA;corresponding private key to sign the first two lines. Finally, the Signer&#xA;encrypts the entire record with ENCRYPTION_KEY.&#xA;&#xA;===Round 2===&#xA;&#xA;====Coordinator====&#xA;&#xA;* The Coordinator gathers key records from all participating Signers. Abort&#xA;the setup if TOKEN has expired.&#xA;* For each key record, the Coordinator decrypts it using ENCRYPTION_KEY.&#xA;The Coordinator verifies that the included SIG is valid given the KEY.&#xA;* If all key records look good, the Coordinator generates a descriptor&#xA;record, which is simply the descriptor string plus a &lt;tt&gt;CHECKSUM&lt;/tt&gt;, all&#xA;in one line. The CHECKSUM has BECH32 encoding and is described at [&#xA;https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#checksums].&#xA;The Coordinator encrypts this descriptor record with ENCRYPTION_KEY.&#xA;* The Coordinator sends the encrypted descriptor record to all&#xA;participating Signers.&#xA;&#xA;====Signer====&#xA;&#xA;* The Signer imports the descriptor record, decrypts it by prompting the&#xA;user for TOKEN.&#xA;* The Signer calculates and verifies the descriptor’s CHECKSUM. Abort the&#xA;setup if the CHECKSUM is incorrect.&#xA;* The Signer checks whether one of the KEYs in the descriptor belongs to&#xA;it, using path and fingerprint information included in the descriptor. The&#xA;check must perform an exact match on the KEYs, and not using shortcuts such&#xA;as matching fingerprints (which is trivial to spoof). Abort the setup if it&#xA;doesn’t detect its own KEY.&#xA;* For confirmation, the Signer must display to the user the descriptor&#39;s&#xA;CHECKSUM, plus other configurations, such as M and N. The total number of&#xA;Signers, N, is important to prevent a KEY insertion attack. All&#xA;participating Signers should be able to display the same confirmation.&#xA;* If all checks pass, the Signer persists the descriptor record in its&#xA;storage. The Signer should subsequently use the descriptor to generate and&#xA;verify receive and change addresses.&#xA;&#xA;This completes the setup.&#xA;&#xA;==QR Codes==&#xA;For signers that use QR codes to transmit data, key and descriptor records&#xA;can be converted to QR codes, following [&#xA;https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2020-005-ur.md&#xA;the BCR standard].&#xA;&#xA;==Security==&#xA;&#xA;This proposal introduce two layers of protection. The first one is a&#xA;temporary, secret token, used to encrypt the two rounds of communication&#xA;between the Signers and the Coordinator. The second one is through the&#xA;descriptor checksum and visual inspection of the descriptor itself.&#xA;&#xA;The token is only needed during the setup phase, and can be safely thrown&#xA;away afterwards. The token does not guarantee that the Signer membership&#xA;set is not modified, since that depends on the overall security of all&#xA;parties in the setup, but it can make it significantly harder for an&#xA;attacker to do so.&#xA;&#xA;There are three ways an attacker can modify the membership set: by changing&#xA;an existing member, by removing an existing member, or by adding a new&#xA;member.&#xA;&#xA;For the first two methods, one of the Signers will be able to detect that&#xA;its membership has been changed or removed, and reject the final&#xA;descriptor. Thus, it is vital that all participating Signers check that&#xA;their membership is intact in the descriptor. Even one Signer failing to&#xA;check for its membership means that the setup could be compromised.&#xA;&#xA;For the third type of attack, the descriptor checksum and visual inspection&#xA;of the descriptor itself are the only way to guard against malicious&#xA;members from being inserted into the set.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210208/77bca22d/attachment.html&gt;</html></oembed>