<oembed><type>rich</type><version>1.0</version><author_name>npub13dagfmmgd537ep30xplt2vp84nvtyw3qxn5cze7hafg2pw6enjss5z3aep</author_name><author_url>https://nostr.ae/npub13dagfmmgd537ep30xplt2vp84nvtyw3qxn5cze7hafg2pw6enjss5z3aep</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-03-27&#xA;📝 Original message:On Wed, Mar 26, 2014 at 6:01 PM, Alan Reiner &lt;etotheipi at gmail.com&gt; wrote:&#xA;&#xA;&gt;  This might be tangential, but the comment about &#34;refund&#34; chains reminded&#xA;&gt; me.  Armory will be implementing multi-sig/linked wallets where a each&#xA;&gt; device has a parallel HDW branch and produces P2SH addresses.  For those&#xA;&gt; types of wallets, I plan to allocate two chains *per signing authority*.&#xA;&gt; If you have a shared 2-of-2 wallet split between your phone and your&#xA;&gt; spouse&#39;s phone, your phone would distribute addresses on P2SH chain 0 and&#xA;&gt; generate change addresses on P2SH chain 1.  Your spouse&#39;s phone would use&#xA;&gt; chains 2 and 3.&#xA;&gt;&#xA;&gt; So if you and your spouse switch to a new app that supports M-of-N linked&#xA;&gt; wallets, it should search for coin history along the first 2*N chains.&#xA;&gt;&#xA;&#xA;In general with multisig, we should probably discourage using a common root&#xA;keychain for multiple keys in the same P2SH address.  The reason is because&#xA;if you have the single, root private key, you can sign them all. This&#xA;generally goes against the point of multisig - which was trying to&#xA;introduce a system which had multiple keys required to unlock :-)&#xA;&#xA;For the BitGo BIP32 implementation we are doing the following:&#xA;   - users create 2 extended keys&#xA;   - bitgo creates 1 extended key for that user&#xA;   - the user can create any number of separate branches (accounts) of P2SH&#xA;addresses from those extended keys.&#xA;   - change/public addresses are generated from the 0/1 branches&#xA;   - new addresses are generated from there.&#xA;   - each time a new change address is generated, all 3 keys in the P2SH&#xA;are rotated.  This makes it so that for any chain depth *i* of the P2SH&#xA;address, we&#39;re using the *i*th key in each keychain.  For privacy reasons,&#xA;we don&#39;t need to rotate all keys.  But I think it makes management simpler&#xA;and probably more ready for interop.&#xA;&#xA;So the paths in a user&#39;s keychain look exactly like BIP32&#39;s layout:&#xA;     m/&lt;AccountIndex&gt;/&lt;ExternalOrInternal&gt;/&lt;AddressIndex&gt;&#xA;&#xA;Another issue unique to P2SH addresses is order of the keys. There has been&#xA;talk in this list of how to sort them.  While sorting is simplifying for&#xA;interop if you never use new change addresses, I believe sorting makes&#xA;wallet management more difficult when BIP32 is introduced.&#xA;&#xA;Specifically, imagine a P2SH address with keys held by Bob, Charlie, and&#xA;Dana.  If you sort the pubkeys, then with each BIP32 chain, the order of&#xA;the keys could be different.  By maintaining key order, we always know&#xA;which of the pubkeys belongs to which user without having to do any lookups.&#xA;&#xA;Obviously this can all be calculated too.  But the sorting seems gratuitous&#xA;to me - it adds complexity but offers little value.  On the other hand, it&#xA;can be really handy to know that key #0 for this address is always Bob&#39;s&#xA;key, regardless of how deep the chaining goes.&#xA;&#xA;Mike&#xA;&#xA;&#xA;&#xA;&gt;&#xA;&gt; -Alan&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; On 03/26/2014 07:37 PM, Andreas Schildbach wrote:&#xA;&gt;&#xA;&gt; Thanks for starting the discussion on finding a better structure.&#xA;&gt;&#xA;&gt; For me, the most important thing is either we&#39;re 100% interoperable or&#xA;&gt; 0%. There should not be anything inbetween, as users will delete seeds&#xA;&gt; without knowing there is still money in them on another implementation.&#xA;&gt; I heard from multiple sources that using this standard some wallets will&#xA;&gt; only see a subset of the addresses/keys of some other wallets.&#xA;&gt; Implementation differences can always happen (and should addresses as&#xA;&gt; bugs), but I think its unacceptable that this source of issues is by design.&#xA;&gt;&#xA;&gt; I suggest we agree on an even simpler least common denominator and&#xA;&gt; wallets that want to implement some feature on top of that can do but&#xA;&gt; are encouraged to pick a totally different &#34;cointype&#34;. I guess that&#xA;&gt; would mean removing reserved and account.&#xA;&gt;&#xA;&gt; I&#39;m still thinking it might be a good idea to have a separate chain for&#xA;&gt; &#34;refunds&#34;. Refunds will be rarely used and thus need a much slower&#xA;&gt; moving window than receiving addresses or change.&#xA;&gt;&#xA;&gt;&#xA;&gt; On 03/26/2014 09:49 PM, Mike Hearn wrote:&#xA;&gt;&#xA;&gt;  Myself, Thomas V (Electrum) and Marek (Trezor) got together to make sure&#xA;&gt; our BIP32 wallet structures would be compatible - and I discovered that&#xA;&gt; only I was planning to use the default structure.&#xA;&gt;&#xA;&gt; Because I&#39;m hopeful that we can get a lot of interoperability between&#xA;&gt; wallets with regards to importing 12-words paper wallets, we&#xA;&gt; brainstormed to find a structure acceptable to everyone and ended up with:&#xA;&gt;&#xA;&gt;   /m/cointype/reserved&#39;/account&#39;/change/n&#xA;&gt;&#xA;&gt; The extra levels require some explanation:&#xA;&gt;&#xA;&gt;   * cointype:  This is zero for Bitcoin. This is here to support two&#xA;&gt;     things, one is supporting alt coins based off the same root seed.&#xA;&gt;     Right now nobody seemed very bothered about alt coins but sometimes&#xA;&gt;     feature requests do come in for this. Arguably there is no need and&#xA;&gt;     alt coins could just use the same keys as Bitcoin, but it may help&#xA;&gt;     avoid confusion if they don&#39;t.&#xA;&gt;&#xA;&gt;     More usefully, cointype can distinguish between keys intended for&#xA;&gt;     things like multisig outputs, e.g. for watchdog services. This means&#xA;&gt;     if your wallet does not know about the extra protocol layers&#xA;&gt;     involved in this, it can still import the &#34;raw&#34; money and it will&#xA;&gt;     just ignore/not see the keys used in more complex transactions.&#xA;&gt;&#xA;&gt;   * reserved is for &#34;other stuff&#34;. I actually don&#39;t recall why we ended&#xA;&gt;     up with this. It may have been intended to split out multisig&#xA;&gt;     outputs etc from cointype. Marek, Thomas?&#xA;&gt;&#xA;&gt;   * account is for keeping essentially wallets-within-a-wallet to avoid&#xA;&gt;     mixing of coins. If you want that.&#xA;&gt;&#xA;&gt;   * change is 0 for receiving addresses, 1 for change addresses.&#xA;&gt;&#xA;&gt;   * n is the actual key index&#xA;&gt;&#xA;&gt; For bitcoinj we&#39;re targeting a deliberately limited feature set for hdw&#xA;&gt; v1 so I would just set the first three values all to zero and that is a&#xA;&gt; perfectly fine way to be compatible.&#xA;&gt;&#xA;&gt; The goal here is that the same seed can be written down once, and meet&#xA;&gt; all the users needs, whilst still allowing some drift between what&#xA;&gt; wallets support.&#xA;&gt;&#xA;&gt; Pieter made the I think valid point that you can&#39;t really encode how&#xA;&gt; keys are meant to be used into just an HDW hierarchy and normally you&#39;d&#xA;&gt; need some metadata as well. However, I feel interop between wallets is&#xA;&gt; more important than arriving at the most perfect possible arrangement,&#xA;&gt; which feels a little like bikeshedding, so I&#39;m happy to just go with the&#xA;&gt; flow on this one.&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; ------------------------------------------------------------------------------&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; _______________________________________________&#xA;&gt; Bitcoin-development mailing listBitcoin-development at lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/bitcoin-development&#xA;&gt;&#xA;&gt;  ------------------------------------------------------------------------------&#xA;&gt; _______________________________________________&#xA;&gt; Bitcoin-development mailing listBitcoin-development at lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/bitcoin-development&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; ------------------------------------------------------------------------------&#xA;&gt;&#xA;&gt; _______________________________________________&#xA;&gt; Bitcoin-development mailing list&#xA;&gt; Bitcoin-development at lists.sourceforge.net&#xA;&gt; https://lists.sourceforge.net/lists/listinfo/bitcoin-development&#xA;&gt;&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20140326/3f6fcb3b/attachment.html&gt;</html></oembed>