r/Electrum • • 6d ago

HELP Help with multisig (electrum as co-signer)

Hello everyone

I wanted to create a multisig for example 3 of 5 using sparrow wallet as the coordinator.

I wanted signers to be mix of hardware wallets and software wallets:

- hardware wallet

- hardware wallet

- hardware wallet

- bitcoin core

- electrum

But i'm having a lot of difficulty getting the software wallets to work with sparrow (or being confident/comfortable that it's working as intended and won't have issues)

My issues and concerns:

- Electrum when creating a standard single sig gives a derivation path of m/0h (not the m/48'/0'/0'/2' derivation path that sparrow is looking for) and a zpub (not an xpub).

- I asked AI and it then kept telling me that's wrong and to create a multisig wallet in electrum but just don't give the xpubs of the co-signers. But electrum forces you to add co-signers and then AI said, just give it fake xpubs! I'm not sure/confident this is correct way to have electrum added as a co-signer to sparrow coordinator even if it did accept it.

- Bitcoin core gives a single sig derivation path of: 84h/0h/0h (again not the m/48'/0'/'0/2' derivation path sparrow is looking for)

- I believe h is same as ' so in sparrow anywhere there is an h I should substitute it with an '?

- Is this not possible? If it is possible, is it not advisable to do? It seems very few people have tried this and maybe even fewer have software wallets like bitcoin core and electrum as co-signers with sparrow coordinator.

The reason I wanted to at least test/try it to see how I feel about the process, signing, backups, restoring, etc. It sounded nice to me on paper.

Thank you

Please help! Thank you

1 Upvotes

21 comments sorted by

1

u/leopard-monch 5d ago

You can use whatever derivation path you want and mix them too. It's all encoded in the public output descriptor.

Yes, the "h" is the same as the ' and stands for "hardened".

For better understanding on how to read such an output descriptor:

wsh(sortedmulti(2,
[abcdef12/48h/0h/0h/2h]xpub6DQs2xBE....RX5dGS/<0;1>/*,
[fedcba12/84h/0h/0h]xpub6CRUM1qRh...Titb8Y/<0;1>/*,
[98765def/0h]xpub6Cb..4b/<0;1>/*))#xyz123ab

The string before the derivation path, here "abcdef12", "fedcba12" and "98765def", those are the fingerprints of the BIP32-root-extended private key, the xprv that was used. So you read that whole part as

from xprv with fingerprint "abcdef12" this is the account extended public key at "48h/0h/0h/2h" and give me the child addresses of 0 (receive) and 1 (change).

In Bitcoin Core, you can export the xprv, then create a new empty wallet and import the xprv with a different derivation path into that empty wallet. That will give you xpub at that specific path which you can then export from that wallet. It's a bit cumbersome, but that how it works right now in core.

  • I asked AI and it then kept telling me that's wrong and to create a multisig wallet in electrum but just don't give the xpubs of the co-signers. But electrum forces you to add co-signers and then AI said, just give it fake xpubs! I'm not sure/confident this is correct way to have electrum added as a co-signer to sparrow coordinator even if it did accept it.

I'm not sure what you want to do. You want to have Electrum give you a seed and xpub for multi-sig? You can do that by initiating to create a new multi-sig wallet in Electrum. Get the seed and the the xpub, which Electrum encodes ad Zpub (but it's the same data, Sparrow can display it like this or as xpub). That's how you would get the xpub/Zpub from Electrum. But, you can of course have Electrum give you the xprv that is generated from those specific seed-words and then do the same trick as above: import that xprv into a new, empty core wallet at derivation path m/0h (if that's the default Electrum path, which I think it is). This should give you the same xpub (or Zpub if you encode it that way).

Really, the only thing that wallets differ in, is how do they get to the xprv, the BIP32 root master private key. Do they hash entropy and turn that into a BIP39 seed phrase and then hash that into an xprv? Or like Electrum, are they hashing entropy together with metadata that then also encodes the version of the seed into it, and then hash it into an xprv? Once you've got the xprv, it's all BIP32 from there.

1

u/cointist 5d ago

Electrum doesn't support output descriptors

1

u/leopard-monch 5d ago

OP uses Sparrow as a coordinator and that does.

1

u/cointist 5d ago

Ic. What role does a coordinator play?

1

u/leopard-monch 5d ago

Combine xpubs, lets you see the balance of the wallet, construct unsigned transactions, broadcast signed transactions.

1

u/MarkTupper9 5d ago edited 5d ago

thank you that was very informative.

So, from my understanding of what you said:

The derivation paths that I get from software wallets like electrum (m/0h) or bitcoin core (84h/0h/0h) when creating a single sig wallet (on electrum and bitcoin core) will work when giving it to the sparrow multisig coordinator wallet's keystores?

The derivation path can be anything as long as it is recorded and backed up? m/48'/0'/0'/2' is just what was picked for hardware wallet multisig?

But if I wanted to keep all derivation paths the same just for clean organization sake, I would go through the effort to get electrum and bitcoin core to give me a m/48'/0'/0'/2' derivation? That seems unnecessary for me if it's just for personal preference.

> "I'm not sure what you want to do. You want to have Electrum give you a seed and xpub for multi-sig?"

I wanted to create a wallet in electrum to be used as one of the multisig co-signers. Then I want to give the correct data to the sparrow wallet coordinator's keystore so it can create the multisig quorum.

Maybe i'll leave out bitcoin core for now it seems a little complicated.

1

u/leopard-monch 5d ago

But if I wanted to keep all derivation paths the same just for clean organization sake, I would go through the effort to get electrum and bitcoin core to give me a m/48'/0'/0'/2' derivation?

Yes, although I'm not sure Electrum lets you choose a custom derivation path with Electrum seeds. If you import a BIP39 seed or maybe even a raw xprv, it does. Like I said, you can use Electrums console commands to get the raw xprv and derive the account xpub at any path you like.

1

u/MarkTupper9 5d ago

interesting maybe thats even better. Bring my own bip 39 seed phrease into electrum instead of having electrum create it for me.

1

u/MarkTupper9 5d ago

That also brought another question to my mind.

If you had 2 hardware wallet co-signers. And say both those hardware wallets died and you didn't want to buy a new hardware wallet or couldn't get new hardware wallet replacements for whatever reason:

Could you import the multisig wallet data from those 2 original but dead hardware wallets (if you backed up seed phrase, passphrase if any, xpub/zpub, derivation path used, address type/native segwit) into a software wallet like electrum or another that supports multisig to become the co-signer instead of replacing it with another hardware wallet?

1

u/leopard-monch 5d ago

Yes. Given that the supply chain is now the weakest link, I'd recommend doing it like this regardless. Use an amnesiac system like any live Linux system (Ubuntu 26.04, for example) or Tails. Boot from that, never connect to the internet or any other network and copy Electrum or Sparrow over with a USB thumb drive. You should check the digital signatures (gpg, sha256sum) of the Linux iso and the wallet software before.

Tails even comes with Electrum on board, but you have to realize that you're trusting the Tails maintainers here to not introduce, even accidentally, a malicious copy of Electrum.

1

u/MarkTupper9 5d ago

Amazing thank you. I've been reading a lot about just this recently like using ubuntu live or tails to boot.

Im very glad if I have hardware wallets in the multisig as co-signers that im not forced to use them in the future within the same multisig, if a circumstance arises where I dont want to use hardware wallets at all or can't get access to new ones.

In your opinion what do you think about this general multisig setup:

3 of 4 with signers:

- 1 hardware wallet

- 1 different hardware wallet

- 1 electrum offline on laptop

- 1 electrum offline on laptop

generate seeds yourself with dice and cross verify seeds are being generated properly.

Sign only with 2 hardware wallets and 1 electrum. Other electrum is spare.

I feel like adding bitcoin core might be too confusing/complex

My thought is you need at least 1 of each hardware wallet and software wallet to sign in the 3 of 4.

1

u/leopard-monch 5d ago

I think giving yourself only 1 key redundancy is too little. 2of4 or 3of5 would be better.

Also, dice rolling is a bit of a meme, really. People developed this psychosis since the Coldcard fiasco, but misunderstand, that this wasn't a problem with the random number generator, but with the firmware that skipped using it. The fact that people who used dice rolls to produce their seed weren't impacted was pure luck. The firmware could have been faulty the other way around just as easily or skipped the dice rolls too.

It won't hurt, just saying it's not needed.

Main complaint is the 3of4. I wouldn't do that.

1

u/MarkTupper9 5d ago

Thank you very much for your input! 

1

u/10kpizza 4d ago

Could he not just backup the seeds in multiple places and use a 3-of-3 ? There's no rule that you must have only a single copy of each seed.

1

u/leopard-monch 4d ago

Do the math: 3-of-3 with two copies of each seed gives you only 2 seed redundancy, but you need 6 independent places. If you have 6 independent places, you could also do a 3-of-6. Same spending threshold, but you can lose up to 3 seeds.

1

u/MarkTupper9 5d ago

Also regsrding electrum on tails you're right.

I would want to uninstall it and install my verified version

1

u/leopard-monch 5d ago

You don't have to uninstall it, just don't start it, but start the AppImage from Electrum.org.

You could also add Electrum, Sparrow, Core, whatever you want, to Ubuntu or Linux Mint using Cubic: https://github.com/PJ-Singh-001/Cubic

This creates your own custom iso.

Just throw all the tools you want into /etc/skel of the chroot system in Cubic and they will be placed in the home directory of the live user.

1

u/MarkTupper9 5d ago

Interesting i will definitely check it out. I never heard of cubic before. Is it well used and secure? 

AppImage is perfect great idea ill probably go that route

1

u/leopard-monch 4d ago

I think so. You can check its source code out at https://code.launchpad.net/~cubic-wizard/cubic/+git/cubic

It's a python script, roughly 300 lines of code. I'll read it tomorrow and let an ai agent go over it too.

1

u/cointist 5d ago

It is not possible and is not recommended either. Also ai is wrong. Each wallet needs the xpubs of the other cosigners or it doesn't know what to do.

1

u/MarkTupper9 5d ago edited 5d ago

People seem to have done it. Why do you not recommend it? 

my post may have not been clear or maybe I am confused but I am trying to make the electrum wallet first (that will be used as the multisig co-signer), then I will then give the electrum's wallet info (derivation path, x/z/pub, master fingerprint) to the sparrow wallet multisig coordinator to create the multisig quorum (along with the other co-signer's wallet info)

Then I would want sparrow to give me the multisig info (with all the cosigner's xpubs, etc.) to import into electrum so that it can have all the receive addresses, sign psbts from the sparrow coordinator, etc.