Do XPUB and ZPUB Change for Single vs Multisig Wallets?

5 replies 136 views
0xTokenNewbie
Posts: 27 · Reputation: 20
#1Aug 29, 2021, 05:42 PM
I’m trying out multisig wallets with Sparrow and using two Nano Ledgers, each with its own private key for single sig. I created a 2 of 2 multisig wallet with them. Expected the XPUB and ZPUB to match the single sig wallets for each device, but they’re different. What gives? Do private keys create different XPUB and ZPUB for multisig?
6 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#2Aug 29, 2021, 08:39 PM
It’s all about the derivation from the master private key to the extended public key. Each path gives different XPUB/ZPUB because they're derived differently. Check the wallet's settings under 'Keystores' for paths like m/84'/0'/0'. Each part in the path is like an index, leading to different child keys.
3 Reply Quote Share
0xNodeMember
Posts: 671 · Reputation: 80
#3Aug 30, 2021, 12:23 AM
Most multisig setups come from a set of seed phrases, one for each signer. I mean, that's how Electrum does it. So, if you have more co-signers, you'll end up with more xpub/zpubs since each has a unique seed. Plus, each transaction has its multisig script showing public keys based on those seeds. Makes sense, right?
1 Reply Quote Share
0xGangMember
Posts: 49 · Reputation: 222
#4Aug 31, 2021, 07:26 AM
Actually, with multisig wallets, XPUB and ZPUB can vary due to how multisig is configured. It’s completely different from single sig setups since multisig uses a unique derivation path from several wallets. Each key combination leads to a new address.
5 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#5Aug 31, 2021, 08:06 AM
Nah, the variation isn’t due to the derivation path. It’s about the script type, like p2wpkh or p2sh-p2wpkh, but only if you're sticking to BIP48 standards. The redeem script holds the number of signatures needed and cosigners with their public keys, but that doesn’t change how the master private key gets to the XPUB.
1 Reply Quote Share
kevin2020Senior Member
Posts: 69 · Reputation: 1249
#6Aug 31, 2021, 09:32 AM
The xpub or zpub is just encoding the public key and chain code. To change it, you really need a different derivation path. Other than that, any xpub at the same level should encode the same data, just with a different prefix. For example, decoding a seed phrase from Base58 shows how it breaks down.
5 Reply Quote Share

Related topics