<p>The fingerprint could be used as a unique identifier for a key (it is based on the longer hash160 of the key which is frequently used as a unique identifier). However because it is only 4 bytes long, it is not hard to find two different xpubs which have the same fingerprint. We would say that the fingerprint for these two xpubs collide with each other. </p>

<p>Note that these two xpubs would have different hash160s, just that the first 4 bytes of that hash (which is the fingerprint), are the same.</p>

<p>So any software that is handling multiple xpubs needs to be aware that there could be collisions in the fingerprint and implement ways to handle them.</p>

CC BY-SA 4.0
2020-04-03T17:11:40.623Z
So we need to worry about collision if and only if we use the fingerprint as a unique identifier. And what approach would be used to handle it?
Allan Romanato
CC BY-SA 4.0
2020-04-03T20:23:56.167Z
Pretty much. You can deal with collisions by using multimaps where a single key maps to multiple values.
Ava Chow
CC BY-SA 4.0
2020-04-03T16:46:50.980Z
2020-04-03T16:46:50.980Z
Ava Chow
<p>As I could read on BIP 32, we can generate HD Wallets using all the rules defined by Pieter Wuille, but I came across a sentence that was written in the document and I could not fully understand. </p>

<blockquote>
  <p>Note that the fingerprint of the parent only serves as a fast way to detect parent and child nodes in software, and software must be willing to <strong>deal with collisions</strong>. Internally, the full 160-bit identifier could be used.</p>
</blockquote>

<p>What does it mean <strong>deal with collisions</strong>?</p>

<wallet><bip32-hd-wallets><deterministic-wallets>
What does "deal with collisions" mean in the context of BIP32 fingerprints?
Allan Romanato
# What does "deal with collisions" mean in the context of BIP32 fingerprints?

(Asked by: username_0 on 2020-04-03)

As I could read on BIP 32, we can generate HD Wallets using all the rules defined by Pieter Wuille, but I came across a sentence that was written in the document and I could not fully understand.

> Note that the fingerprint of the parent only serves as a fast way to detect parent and child nodes in software, and software must be willing to **deal with collisions**. Internally, the full 160-bit identifier could be used.

What does it mean **deal with collisions**?

**Tags:** wallet, bip32-hd-wallets, deterministic-wallets


---

## 1 answers

### Answer by username_1 on 2020-04-03. Score: 2 | Accepted answer

The fingerprint could be used as a unique identifier for a key (it is based on the longer hash160 of the key which is frequently used as a unique identifier). However because it is only 4 bytes long, it is not hard to find two different xpubs which have the same fingerprint. We would say that the fingerprint for these two xpubs collide with each other.

Note that these two xpubs would have different hash160s, just that the first 4 bytes of that hash (which is the fingerprint), are the same.

So any software that is handling multiple xpubs needs to be aware that there could be collisions in the fingerprint and implement ways to handle them.

> **Comments:**
> **username_0**: So we need to worry about collision if and only if we use the fingerprint as a unique identifier. And what approach would be used to handle it?  
> **username_1**: Pretty much. You can deal with collisions by using multimaps where a single key maps to multiple values.  

---

