Bitcoin Forum
May 02, 2024, 02:43:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bip32 wallet structure for electrum  (Read 4095 times)
ThomasV (OP)
Moderator
Legendary
*
Offline Offline

Activity: 1896
Merit: 1353



View Profile WWW
August 15, 2013, 10:55:28 AM
Merited by canudinho (1)
 #1

Electrum is going to use Hierarchical Deterministic wallet (bip32)

In order to preserve the capability to restore a wallet from its seed, it is now necessary to adopt a convention concerning address allocation.

For the moment I think it would be a bit overkill to restore an entire tree using a tree exploration algorithm, although this might be the case in the future.
I just want to use a simple convention for enumerating accounts derived from a seed.

Here is how I plan to do it:

m/0'/n'/   :   normal accounts, where n is an integer.
m/1'/n/ & m/2'/n/  : "multisig 2of2" accounts.
m/3'/n/ & m/4'/n/ & m/5'/n/ : "multisig 2of3" accounts

In this scheme, each account has a sequence of receiving and change addresses.
example:
m/0'/n'/0/k -> receive addresses
m/0'/n'/1/k -> change addresses

As per bip32 conventions, the prime symbole (') refers to private (type1) derivation, while "no prime" means public (type2) derivation.

Note that normal account creations use private derivation, so the user will need to enter their password in order to generate a new account.
m/0'/ is sufficient to generate normal accounts, so that "m/" (the master key) can be thrown away.

Multisig accounts may be only partially seeded. (for example, we keep m/1'/ and throw away m/ and m/2'/)
Multisig accounts use a private derivation at level 1, and a public derivation at level 2; this is to avoid having to receive master public keys from an external wallet or service when an account is created.

Let me know if you think I missed something.

Electrum: the convenience of a web wallet, without the risks
1714661018
Hero Member
*
Offline Offline

Posts: 1714661018

View Profile Personal Message (Offline)

Ignore
1714661018
Reply with quote  #2

1714661018
Report to moderator
1714661018
Hero Member
*
Offline Offline

Posts: 1714661018

View Profile Personal Message (Offline)

Ignore
1714661018
Reply with quote  #2

1714661018
Report to moderator
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714661018
Hero Member
*
Offline Offline

Posts: 1714661018

View Profile Personal Message (Offline)

Ignore
1714661018
Reply with quote  #2

1714661018
Report to moderator
1714661018
Hero Member
*
Offline Offline

Posts: 1714661018

View Profile Personal Message (Offline)

Ignore
1714661018
Reply with quote  #2

1714661018
Report to moderator
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
August 15, 2013, 11:05:41 AM
 #2

Looks good to me.

I do Bitcoin stuff.
ThomasV (OP)
Moderator
Legendary
*
Offline Offline

Activity: 1896
Merit: 1353



View Profile WWW
August 15, 2013, 03:35:09 PM
 #3

hum, I realize now that a /private/private derivation for normal accounts will prevent wallet synchronization accross machines.

To fix that, it should probably be /private/public, that is, m/0'/n/ 
The type 2 derivation will allow electrum to discover newly created accounts over different machines, like it currently does for addresses within its main account.

Therefore, both normal and multisig accounts should use a /private/public derivation.

Electrum: the convenience of a web wallet, without the risks
apetersson
Hero Member
*****
Offline Offline

Activity: 668
Merit: 501



View Profile
August 15, 2013, 09:11:32 PM
 #4

are you panning to have a lookahead limit that electrum tries to enforce, in order to make recovery easy?
phedny
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile WWW
August 20, 2013, 10:38:14 AM
 #5

m/1'/n/ & m/2'/n/  : "multisig 2of2" accounts.
m/3'/n/ & m/4'/n/ & m/5'/n/ : "multisig 2of3" accounts

That would mean all private keys for 2of2 and 2of3 accounts are derived from a single master key and therefore two co-operating persons cannot each generate a private (sub-)master key themselves and share the public part.
fireduck
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
September 27, 2013, 05:55:50 PM
 #6

Electrum is going to use Hierarchical Deterministic wallet (bip32)

In order to preserve the capability to restore a wallet from its seed, it is now necessary to adopt a convention concerning address allocation.

For the moment I think it would be a bit overkill to restore an entire tree using a tree exploration algorithm, although this might be the case in the future.
I just want to use a simple convention for enumerating accounts derived from a seed.

Here is how I plan to do it:

m/0'/n'/   :   normal accounts, where n is an integer.
m/1'/n/ & m/2'/n/  : "multisig 2of2" accounts.
m/3'/n/ & m/4'/n/ & m/5'/n/ : "multisig 2of3" accounts

In this scheme, each account has a sequence of receiving and change addresses.
example:
m/0'/n'/0/k -> receive addresses
m/0'/n'/1/k -> change addresses

As per bip32 conventions, the prime symbole (') refers to private (type1) derivation, while "no prime" means public (type2) derivation.

Note that normal account creations use private derivation, so the user will need to enter their password in order to generate a new account.
m/0'/ is sufficient to generate normal accounts, so that "m/" (the master key) can be thrown away.

Multisig accounts may be only partially seeded. (for example, we keep m/1'/ and throw away m/ and m/2'/)
Multisig accounts use a private derivation at level 1, and a public derivation at level 2; this is to avoid having to receive master public keys from an external wallet or service when an account is created.

Let me know if you think I missed something.


I am very interested in Hierarchical Deterministic wallets.

I have a few questions, please forgive me if I am misunderstanding something here.

1) In adding what is essentially a type layer of multisig type, isn't that adding a hierarchical layer that isn't in the BIP?  I understand how the math makes that possible I'm just concerned about interoperability with other solutions.

2) Is there any reason that n has to be an integer?  For example, I was thinking it would be cool to be able to create accounts with ascii names.  Of course for recovery the user would have to know their seed and the names of their accounts in order to rediscover the tree.  Actually, this sounds like a really bad idea.  I think the coolest, most important feature of Electrum is the ability to recover from one human readable string.

3) Will someone be able to create an account, lets says m/0'/7' and then load up an electrum client with just that, without any visibility or awareness of the other chains in the tree?

4) Will the equivalent of the master public key for such an account work with existing electrum address generators like (https://github.com/prusnak/addrgen)?

5) Who can I bribe/bounty/pay for this work to be done?  I would try to help but python is certainly not my strong suit and my EC knowledge is very low.  I'd be willing to pony up 25 BTC if it would help.

Bitrated user: fireduck.
fireduck
Sr. Member
****
Offline Offline

Activity: 392
Merit: 251



View Profile
October 07, 2013, 12:18:13 PM
 #7


5) Who can I bribe/bounty/pay for this work to be done?  I would try to help but python is certainly not my strong suit and my EC knowledge is very low.  I'd be willing to pony up 25 BTC if it would help.

Anyone with any comment?

Bitrated user: fireduck.
harningt
Member
**
Offline Offline

Activity: 63
Merit: 10



View Profile
October 31, 2013, 08:48:26 PM
 #8

Regarding #2 the ascii names... that's better suited to an external mechanism (ex: take the public key, derive some unique value, and use the Label sync service out there).

If integers were not used, then BIP32 fails since it relies on this fact for calculations.


#3 not sure, but that is a feature on my down-the-road task for my Java library + Android app... months due to time constraints and getting the initial release out

#4 - I'll have a Java library capable of mucking around with BIP32 values, so... writing up an additional tool would not be difficult at all (though I bet a python tool would be quicker at the moment)

#5 - if you were somehow able to buy time itself, I could do it Wink... however... extending the hours in a day in such a way that sanity is maintained - well... that's more like the work for a Time Lord...

And for completeness, for #1... I'm not sure how that's supposed to work out at all. Perhaps multisig addresses are addresses that would be associated with multisig - that way they would be separated from normal transactions - that way you could simplify user interface...
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!