<p>The <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Serialization_format" rel="nofollow noreferrer">encoding</a> of an xpub contains multiple pieces of data:</p>
<ul>
<li>A 4-byte fixed prefix that results in the &quot;xpub&quot; prefix after encoding</li>
<li>Depth in the tree (0 for all master xpubs, 1 for children thereof, ...)</li>
<li>A 4-byte checksum of the parent key (0x00000000 for all master xpubs as they have no parent)</li>
<li>The 4-byte index this node has in the derivation from its parent (0x00000000 for all master xpubs).</li>
<li>The 32-byte chaincode</li>
<li>The 33-byte public key</li>
</ul>
<p>So, the first 13 bytes before encoding are identical for all master xpubs. This translates to roughly 17-18 characters after encoding.</p>

CC BY-SA 4.0
2021-06-02T19:06:34.967Z
2021-06-02T19:06:34.967Z
Pieter Wuille
<p>I generated a seed into my coldcard, wrote down its pubkey:</p>
<pre><code>xpubABCDEFGHIKL---------------------------------------------------
</code></pre>
<p>then I erased everything and generated a new seed, and wrote down its pubkey</p>
<pre><code>xpubABCDEFGHIKL---------------------------------------------------
</code></pre>
<p>as you see, they both start with the first 15 letters the same. Then they differ.</p>
<p>How is that possible?</p>

<public-key><coldcard>
Why these 2 pubkeys start equal?
Guerlando OCs
# Why these 2 pubkeys start equal?

(Asked by: username_0 on 2021-06-02)

I generated a seed into my coldcard, wrote down its pubkey:

```
xpubABCDEFGHIKL---------------------------------------------------

```

then I erased everything and generated a new seed, and wrote down its pubkey

```
xpubABCDEFGHIKL---------------------------------------------------

```

as you see, they both start with the first 15 letters the same. Then they differ.

How is that possible?

**Tags:** public-key, coldcard


---

## 1 answers

### Answer by username_1 on 2021-06-02. Score: 3 | Accepted answer

The [encoding](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Serialization_format) of an xpub contains multiple pieces of data:

* A 4-byte fixed prefix that results in the "xpub" prefix after encoding
* Depth in the tree (0 for all master xpubs, 1 for children thereof, ...)
* A 4-byte checksum of the parent key (0x00000000 for all master xpubs as they have no parent)
* The 4-byte index this node has in the derivation from its parent (0x00000000 for all master xpubs).
* The 32-byte chaincode
* The 33-byte public key

So, the first 13 bytes before encoding are identical for all master xpubs. This translates to roughly 17-18 characters after encoding.


---

