Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: aesthete2022 on March 12, 2023, 07:36:52 PM



Title: Master fingerprint
Post by: aesthete2022 on March 12, 2023, 07:36:52 PM
Hi all,

I am trying to get my head around the master fingerprint and fingerprint.

Am I right in thinking that every xpub has a fingerprint, and the master fingerprint is the fingerprint of the signing device?

Many thanks.


Title: Re: Master fingerprint
Post by: aesthete2022 on March 13, 2023, 07:21:09 AM
The fingerprint is the first four bytes of the hash160 of the master private key.


Title: Re: Master fingerprint
Post by: nc50lc on March 13, 2023, 07:38:11 AM
The fingerprint is the first four bytes of the hash160 of the master private key.
It should be hashed from its parent's public key and not the whole xpub either.

Am I right in thinking that every xpub has a fingerprint, and the master fingerprint is the fingerprint of the signing device?
I don't know what you meant by "master fingerprint", perhaps the fingerprint of the master private key?
If so, the master private key which doesn't have a parent has its 'fingerprint', 'Depth' and 'Child Number' all set to 0x00 (with the correct byte size).


Title: Re: Master fingerprint
Post by: aesthete2022 on March 13, 2023, 07:43:07 AM
Quote
I don't know what you meant by "master fingerprint", perhaps the fingerprint of the master private key?
If so, the master private key which doesn't have a parent has its 'fingerprint', 'Depth' and 'Child Number' all set to 0x00.

Sparrow refers to the fingerprint of the master private key as the master fingerprint.

Am I right in thinking that, if the same private key is used on a different derivation path, the fingerprint should remain the same?


Title: Re: Master fingerprint
Post by: nc50lc on March 13, 2023, 08:27:43 AM
Sparrow refers to the fingerprint of the master private key as the master fingerprint.
I've created a test Sparrow wallet to check this and it's indeed talking about the fingerprint of the master private key but it's used for "Descriptors".

Here's some info on my test:
  • Sparrow wallet's fingerprint: 4807233c
  • Master private key derived from the seed: tprv8ZgxMBicQKsPe8tmAeXPxny3zpm5dWPHCCu6ffhHJc4FAeT2NrToDsi6jfMc7RLBmALgxmcwt5x Ti1nFGwsqYNam66kH6KMo8tt8edpJmAC
  • ECDSA Private keys extracted from the master private key: 66c5c77c1e6f08a95c5d7c710d69533e2a7c576abff45596e4a27a02e9437778
  • Compressed public key pair of the above: 03f1daf4af89d74e1ce1ee316611f07eba7e514ded038239d0606aeb813f6ff854
  • SHA256 of the above: fdeb7f8fc5a4183fe66ccc776fead2b6672248cbe678cc60b533c24f9b298537
  • RIPEMD160 of the above: 4807233c55a0065205e18a30871b5b3ee9a101bc
  • First four bytes of the above: 4807233c (same as the "master fingerprint")

Am I right in thinking that, if the same private key is used on a different derivation path, the fingerprint should remain the same?
Yes, if you're talking about Sparrow wallet's master fingerprint
It won't change since it's solely derived from the 'public key' pair of the 'private key' part of 'master private key'.


Title: Re: Master fingerprint
Post by: aesthete2022 on March 13, 2023, 09:23:31 AM
Brilliant, thank you. I guess the same should be true of a HD device used for multisig with Sparrow?


Title: Re: Master fingerprint
Post by: nc50lc on March 13, 2023, 11:03:06 AM
Brilliant, thank you. I guess the same should be true of a HD device used for multisig with Sparrow?
Yes, most Hardware wallets are basically the same as software wallets when it comes with derivation path since it follows BIP39 standard.
Although I don't know what you'll do with the master fingerprint showed in Sparrow since it's not too important when it comes with derivation of the child extended keys.


Title: Re: Master fingerprint
Post by: aesthete2022 on March 14, 2023, 07:48:56 AM
Appreciate that, thanks.

Sparrow requires the fingerprints of all private keys in order to create an active wallet (Coldcard also requires all fingerprints to create the multisig script).


Title: Re: Master fingerprint
Post by: BitPappa on September 24, 2023, 03:01:31 PM
Will there be a new master fingerprint after adding a passphrase?

EDIT/ANSWER: I tested and see there is a new fingerprint when you add a passphrase.


Title: Re: Master fingerprint
Post by: nc50lc on September 25, 2023, 03:25:13 AM
EDIT/ANSWER: I tested and see there is a new fingerprint when you add a passphrase.
The explanation is simple.
Since adding a passphrase to the 'seed phrase' totally changes the 'seed' (more info (https://learnmeabitcoin.com/technical/mnemonic#:~:text=The%20optional%20passphrase%20allows%20you%20to%20modify%20the%20final%20seed.)), it will derive a different 'master private key'.
And based from the algorithm above, a different master private key will produce a different master fingerprint.


Title: Re: Master fingerprint
Post by: satscraper on September 25, 2023, 07:03:44 AM
Will there be a new master fingerprint after adding a passphrase?

EDIT/ANSWER: I tested and see there is a new fingerprint when you add a passphrase.

Yeah, it will be completely different  fingerprint  when you add a passphrase to SEED.  Passport HW is also capable to show master fingeprint ,  and this feature is very useful at checking  if  password you have entered is correct. After you have entered password device, before creating wallet, shows master fingeprint to you and asks whether it is correct.  If you see on display that some  characters differ from those that relevant to your SEED+password it means you have entered the wrong password, forcing you to enter the correct one and, thus, protecting your nerves at checking balance on wrong wallet.