6

Same question as What BIP32 derivation path does Electrum use?

but for multisig. thanks.

6

Electrum uses BIP45.

m / purpose' / cosigner_index / change / address_index

Example for non-change of the first cosigner and first address: m / 45' / 0 / 0 / 0

See: https://bitcointalk.org/index.php?topic=1634517.15 and https://github.com/bitcoin/bips/blob/master/bip-0045.mediawiki

  • thanks for answering, solved here – joe.js Mar 10 '17 at 8:45
  • I find the inclusion of the purpose code and cosigner index to not be present. See my answer below. Thus not BIP45. – user1204270 Dec 20 '18 at 22:44
6

After a lot of struggle, I found out that Electrum uses following root derivation for normal and multisig wallets. For example:

  • root/0/0 for each cosigner. Example:

    • m/44'/0'/0' ==> shared root key (x)

    • x/0/0 ==> address for first receiving multisig (derive in all cosigners shared keys. all 3 keys must be lexicographically ordered).

  • some semi-compatible form of BIP45 for hardware wallets. Didn't test it but here's the code: https://github.com/spesmilo/electrum/blob/master/lib/base_wizard.py#L220

refs:

What BIP32 derivation path does Electrum use?

https://github.com/spesmilo/electrum/issues/2266

https://bitcointalk.org/index.php?topic=1819380

  • I find that the purpose code is not present. See my answer. It is unclear what the m/44'/0'/0 generating the shared root key means in this answer. Starting with an xprv, a path of 0/0 generates the pubkeys used to construct the redeem scripts and the corresponding p2sh address used by Electrum for the first receiving address. – user1204270 Dec 20 '18 at 22:53
0

Here is what works for me when using bip32gen from bip32utils to generate the public keys which are used in the transaction, starting from an xprv master key.

For each xprv master key of a cosigner, use 0/0 for the first receiving address, 0/1 for the second, 1/0 for the first change address, 1/1 for the second change address.

Then use the corresponding public key for each cosigner, sorted into lexicographic order, when constructing the redeem script, and generate the corresponding p2sh address for each address which will be generated by Electrum.

So far as I can tell, there are no purpose codes or cosigner index, as per BIP44 or BIP45. This is with Electrum 3.2.3.

refs: https://bitcointalk.org/index.php?topic=1819380 https://bitcointalk.org/index.php?topic=1816926.msg18101203#msg18101203

See this other stackexchange discussion: What BIP32 derivation path does Electrum use?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.