From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id DFB27C0001 for ; Sun, 14 Mar 2021 15:13:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C108183AB9 for ; Sun, 14 Mar 2021 15:13:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -0.099 X-Spam-Level: X-Spam-Status: No, score=-0.099 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=protonmail.com 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 tmMxqu-X9UNp for ; Sun, 14 Mar 2021 15:13:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail-40132.protonmail.ch (mail-40132.protonmail.ch [185.70.40.132]) by smtp1.osuosl.org (Postfix) with ESMTPS id 1BC8083AB4 for ; Sun, 14 Mar 2021 15:13:45 +0000 (UTC) Date: Sun, 14 Mar 2021 15:13:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1615734822; bh=Vp6EfGM8H0di/XFNPJHoYEnEWLMHq23De3HfHZAGzfo=; h=Date:To:From:Reply-To:Subject:From; b=XlcqXqrqy35N7Z13V47FTzpNaCUdRP2Qd9BFXojlZISaAj+td0fVk8HWV/0UnC9/b N/NZDy/k2fVsPrMwsi5CbxvmxgAGkZTi6mal6XVQuOSpZ0+3cz9mcWyHqpFmd7Ij7V NMehD9jTfENTnbtXR2tw0WVizol4U7TqbCyVmi5s= To: Bitcoin Protocol Discussion , Robert Spigler From: SomberNight Reply-To: SomberNight Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 16 Mar 2021 12:17:44 +0000 Subject: Re: [bitcoin-dev] Signature and Script Independent Hierarchy for Deterministic Wallets. 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: Sun, 14 Mar 2021 15:13:48 -0000 See some replies inline. (quoted text from BIP draft) > Date: Sun, 14 Mar 2021 01:51:15 +0000 > From: Robert Spigler > Subject: [bitcoin-dev] Signature and Script Independent Hierarchy for Det= erministic Wallets. > There are many issues with the current standards. As background, BIP 44/4= 9/84 specifies: > `m / purpose' / coin_type' / account' / change / address_index` > where the BIP43 `purpose'` path is separate for each script (P2PKH, P2WPK= H-in-P2SH, and P2WPKH respectively). However, these per-script derivations= are made redundant with descriptors > We should not be mixing keys and scripts in the same layer. The wallet sh= ould create extended private/public keys independent of the script or signa= ture type You say that keys and scripts should not be mixed in the same layer, and im= ply that this was solely done due to these standards predating output scrip= t descriptors. Even if this was the case, it is not the only reason for doi= ng it. BIP44/49/84 mixing scripts and keys in the same layer makes recovery= from seed/mnemonic much easier. Note the significant overlap between the authors of BIP39 and BIP44. I am f= airly certain BIP44 was designed with recovering from a BIP39 seed (and no = additional information backed up) in mind. Note the "Account discovery" sec= tion of BIP44. (Electrum seeds go even further, as such seeds contain a version number tha= t encodes both the script type and the key derivation path to use.) > We define the following 5 levels in the BIP32 path: > `m / purpose' / coin_type' / account' / change / address_index` > [Account] > It is crucial that this level is increased for each new wallet joined or = private/public keys created; for both privacy and cryptographic purposes. > For example, in multisignature wallets, before sending a new key record t= o a coordinator, the wallet must increment the `account'` level. Before cr= eating it's own single signature wallet, the `account'` level must again be= incremented. Imagine a user who has a BIP39 (or similar) seed. Even today, recovering mo= st non-singlesig scripts from that is obviously infeasible. However, all si= nglesig scripts at least can be discovered if the keys are using the sugges= ted derivation paths. By trying to create a standard that mixes discoverable and non-discoverable= scripts in the same derivation scheme and incrementing a single index, you= are turning all scripts into being non-discoverable. Note that even if a user only used singlesig scripts and followed this prop= osal, during recovery from seed the wallet would have to check all script t= ypes for all account indices (which is only ever going to get more expensiv= e as new script types come). The workaround and I imagine your suggested solution is clearly to backup b= oth seed words and output script descriptors; and to keep appending new out= put script descriptors to existing backups when the account index is increm= ented. While much less user-friendly than backing up just a seed, it is mor= e generic and extendable. My point is simply that your proposal is making a tradeoff here. The tradeo= ff itself seems easy to miss on first read of the text, so I just wanted to= explicitly point it out for the record. ghost43 / SomberNight