Author

Topic: Derive a complete wallet from another bip32 master private key (Read 2802 times)

newbie
Activity: 7
Merit: 0
Quote
In practice, this doesn't get you very far today. The only wallet software I'm aware of which can easily do (1) is Mycelium for Android, and the only wallet software which can easily do (2) is Mycelium for Android and Electrum (on the plus side, the two are compatible—you can export an xprv from Mycelium into Electrum and result in the same keys/addresses).

Well I guess I need to use Mycelium then, because I dont want to take any risks (and modifying the wallet file like this seems to be a risk  Grin)

Quote
How does it respond to a protobuf with no deterministic seed at all (it's an optional protobuf record, after all)? That should be a bit safer if it works, yes?
The first time I tried this, the wallet app couldn't read the backup, but this could be due to another problem. I didn't investigate further, as I thought omitting the seed results in an invalid wallet file.

Thank you, btchris!!  Smiley
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
If you want to remain a bit more standards-compliant, it sounds to me that what you'd want is wallet software which:

  1. Creates multiple BIP-44 accounts from a single seed, and allows you to export the account extended private keys.
  2. Allows the import of an individual account extended private key.

In practice, this doesn't get you very far today. The only wallet software I'm aware of which can easily do (1) is Mycelium for Android, and the only wallet software which can easily do (2) is Mycelium for Android and Electrum (on the plus side, the two are compatible—you can export an xprv from Mycelium into Electrum and result in the same keys/addresses).

If you'd like to stick with the Bitcoin Wallet for Android, I think what you're doing is about as good as you can get.

So I tried to write a new protobuf wallet file which contains:

  • a fake deterministic seed
  • 4 main keys (m, m/0', m/0'/0, m/0'/1')

which kind of does what I want: I derived the main private key m from my SMpK, so it really is m=m/0' with m being my SMpK. As I understand this, bitcoinj derives its keys from the 4 main keys.

I am still worried though, that at some point, bitcoinj could regenerate the wallet from the seed, which is just a placeholder now...

I'd be a bit worried too.

How does it respond to a protobuf with no deterministic seed at all (it's an optional protobuf record, after all)? That should be a bit safer if it works, yes?

Also, I wonder if you could "trick" Bitcoin Wallet into accepting a BIP-44 account? In other words, generate a BIP-44 account at m/44'/0'/#', and then create a protobuf with m/0' equal to the generated xprv, and also include m/0'/0 and m/0'/1'. Do not include either the deterministic seed nor the key at path m (just to make sure Bitcoinj doesn't overwrite m/0' with the wrong xprv).
newbie
Activity: 7
Merit: 0
So I tried to write a new protobuf wallet file which contains:

  • a fake deterministic seed
  • 4 main keys (m, m/0', m/0'/0, m/0'/1')

which kind of does what I want: I derived the main private key m from my SMpK, so it really is m=m/0' with m being my SMpK. As I understand this, bitcoinj derives its keys from the 4 main keys.

I am still worried though, that at some point, bitcoinj could regenerate the wallet from the seed, which is just a placeholder now...
newbie
Activity: 7
Merit: 0
Hi!
I'd like to generate one single HD wallet (mnemonic) seed which gives me a master private key (bip 32&39), lets call it a SMpK (super master private key). Then I want to generate new "child master private keys" from the SMpK which I use as master private keys for different wallets: for example the schildbach wallet app. The advantage would be the fact, that I have to backup a single seed only to recover all wallets I will ever use (even in different apps which support HD keys). The disadvantage is, that there are no mnemonic seeds for the derived child master keys (as they are not bip39 generated but derived from the SMpK with bip32) and here I need help from you: how will the schildbach wallet react to a protobuf wallet file which does not contain a word seed but a mpk/byte seed only? Is this even possible?

What are other (dis)advantages of this approach? Other ideas?

Thanks and have a good evening!
Jump to: