<p>It's <code>ripemd160(sha256(parentpriv))</code> also known as <code>hash160(parentpriv)</code> <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers" rel="nofollow noreferrer">source</a>. There is also a python implementation <a href="https://github.com/mcdallas/cryptotools/blob/master/btctools/HD/bip32.py" rel="nofollow noreferrer">here</a></p>

CC BY-SA 4.0
2022-08-27T16:49:38.330Z
Wrong. It's `ripemd160(sha256(compressed parent pub))[0:4]`. Your link also says it clearly: *Hash160 (RIPEMD160 after SHA256) of the serialized ECDSA **public key***
rustyx
CC BY-SA 4.0
2018-07-02T15:16:21.817Z
2018-07-02T15:16:21.817Z
Mike D
<p>Can't use comments because of reputation, but both the question and the answer is saying that the fingerprint is based on private key. It should be the hash160 of the PUBLIC key. for even if you are deriving a private key you should use the parents PUBLIC key for generating the fingerprint. This is important to make both a derived public and a derived private key having  the same fingerprint so you can relate them to each other.</p>

CC BY-SA 4.0
2019-06-19T17:51:30.000Z
2019-06-19T18:11:01.493Z
2019-06-19T18:11:01.493Z
Jim Hansson
<p>A number of HD wallet fingerprint test vectors for curves secp256k1, nist256p1, and ed25519 are provided at the bottom of <a href="https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-ed25519" rel="nofollow noreferrer">https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-ed25519</a>. Notice all top tier fingerprints are 00000000. </p>

<p>For <a href="https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-secp256k1" rel="nofollow noreferrer">https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-secp256k1</a> <strong>Chain m/0H</strong>, the fingerprint is computed from its parent's public key as follows:</p>

<p><strong>% echo 0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2 | bx sha256 | bx ripemd160 | cut -c 1-8</strong></p>

<p><code>3442193e</code></p>

<p><strong>% echo 0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2 | bx bitcoin160 | cut -c 1-8</strong></p>

<p><code>3442193e</code></p>

CC BY-SA 4.0
2020-02-02T02:49:50.873Z
2020-02-02T02:49:50.873Z
skaht
<p>I'm trying to implement a barebones HD wallet generator in C#.  I'm starting with a mnemonic and derivation path <code>m/0'</code> and want to generate BIP141 p2wpkh-in-p2sh addresses.  Obviously for the Master Node the fingerprint is <code>0x00000000</code>, but when I get to depth 1 (<code>0'</code>), I need to calculate the fingerprint of the parent key.  My question is, is the formula <code>RipeMD160(parentPrivKey)</code> or <code>RipeMD160(SHA256(parentPrivKey))</code>?  I've been looking at Ian Coleman's implementation in javascript (<a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a>) and he seems to do the latter one.  However, on <a href="https://blog.aeternity.com/implementing-extended-keys-in-%C3%A6ternitys-elixir-wallet-e70303dec433" rel="nofollow noreferrer">this site</a> under "Parent Fingerprint", it says it's the former.</p>

<bip32-hd-wallets><c#><deterministic-wallets>
Trying to understand parent fingerprint in HD wallets
MrPuzzler
# Trying to understand parent fingerprint in HD wallets

(Asked by: username_0 on 2018-07-02)

I'm trying to implement a barebones HD wallet generator in C#. I'm starting with a mnemonic and derivation path `m/0'` and want to generate BIP141 p2wpkh-in-p2sh addresses. Obviously for the Master Node the fingerprint is `0x00000000`, but when I get to depth 1 (`0'`), I need to calculate the fingerprint of the parent key. My question is, is the formula `RipeMD160(parentPrivKey)` or `RipeMD160(SHA256(parentPrivKey))`? I've been looking at Ian Coleman's implementation in javascript (<https://iancoleman.io/bip39/>) and he seems to do the latter one. However, on [this site](https://blog.aeternity.com/implementing-extended-keys-in-%C3%A6ternitys-elixir-wallet-e70303dec433) under "Parent Fingerprint", it says it's the former.

**Tags:** bip32-hd-wallets, c#, deterministic-wallets


---

## 3 answers

### Answer by username_1 on 2018-07-02. Score: 1 | Accepted answer

It's `ripemd160(sha256(parentpriv))` also known as `hash160(parentpriv)` [source](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#key-identifiers). There is also a python implementation [here](https://github.com/mcdallas/cryptotools/blob/master/btctools/HD/bip32.py)

> **Comments:**
> **username_2**: Wrong. It's `ripemd160(sha256(compressed parent pub))[0:4]`. Your link also says it clearly: *Hash160 (RIPEMD160 after SHA256) of the serialized ECDSA **public key***  

---

### Answer by username_3 on 2019-06-19. Score: 1

Can't use comments because of reputation, but both the question and the answer is saying that the fingerprint is based on private key. It should be the hash160 of the PUBLIC key. for even if you are deriving a private key you should use the parents PUBLIC key for generating the fingerprint. This is important to make both a derived public and a derived private key having the same fingerprint so you can relate them to each other.


---

### Answer by username_4 on 2020-02-02. Score: 0

A number of HD wallet fingerprint test vectors for curves secp256k1, nist256p1, and ed25519 are provided at the bottom of <https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-ed25519>. Notice all top tier fingerprints are 00000000.

For <https://github.com/satoshilabs/slips/blob/master/slip-0010.md#test-vector-1-for-secp256k1> **Chain m/0H**, the fingerprint is computed from its parent's public key as follows:

**% echo 0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2 | bx sha256 | bx ripemd160 | cut -c 1-8**

`3442193e`

**% echo 0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2 | bx bitcoin160 | cut -c 1-8**

`3442193e`


---

