<oembed><type>rich</type><version>1.0</version><author_name>npub1xvnnyhz8e4eklaakjc9xgm5w8pzkuckt923uacz2cftqdqx23g7q3c5rqg</author_name><author_url>https://nostr.ae/npub1xvnnyhz8e4eklaakjc9xgm5w8pzkuckt923uacz2cftqdqx23g7q3c5rqg</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-03-26&#xA;📝 Original message:For every branch (say multiple accounts), how would a new wallet be able to&#xA;know how many sequence items to scan?  It seems like not only do you need&#xA;to have standard rules for the hierarchy, but how the usage can be&#xA;detected.  The other scanning seems pretty straightforward.  For accounts,&#xA;it seems like you could have a situation where you want to initially set up&#xA;10 different accounts, but only account #10 gets any transactions.  If a&#xA;new wallet was trying to scan with this seed, it would have to know to keep&#xA;scanning each account until it found the account.  The user would have to&#xA;be responsible for knowing how many accounts there are, or some rules would&#xA;need to be in place to not allow creating accounts until earlier accounts&#xA;can be proven to have existed in the blockchain.  Or I am missing something.&#xA;&#xA;-Allen&#xA;&#xA;On Wed, Mar 26, 2014 at 3:49 PM, Mike Hearn &lt;mike at plan99.net&gt; wrote:&#xA;&#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 brainstormed&#xA;&gt; 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. Right now&#xA;&gt;    nobody seemed very bothered about alt coins but sometimes feature requests&#xA;&gt;    do come in for this. Arguably there is no need and alt coins could just use&#xA;&gt;    the same keys as Bitcoin, but it may help 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 if&#xA;&gt;    your wallet does not know about the extra protocol layers involved in this,&#xA;&gt;    it can still import the &#34;raw&#34; money and it will just ignore/not see the&#xA;&gt;    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 outputs etc&#xA;&gt;    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 v1&#xA;&gt; 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 all&#xA;&gt; the users needs, whilst still allowing some drift between what wallets&#xA;&gt; support.&#xA;&gt;&#xA;&gt; Pieter made the I think valid point that you can&#39;t really encode how keys&#xA;&gt; are meant to be used into just an HDW hierarchy and normally you&#39;d need&#xA;&gt; some metadata as well. However, I feel interop between wallets is more&#xA;&gt; important than arriving at the most perfect possible arrangement, which&#xA;&gt; feels a little like bikeshedding, so I&#39;m happy to just go with the flow on&#xA;&gt; this one.&#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/48a94563/attachment.html&gt;</html></oembed>