<p>See the file <code>chainparams.cpp</code> in the constructor for <code>class CMainParams</code>:</p>

<pre><code>pchMessageStart[0] = 0xf9;
pchMessageStart[1] = 0xbe;
pchMessageStart[2] = 0xb4;
pchMessageStart[3] = 0xd9;
</code></pre>

CC BY-SA 3.0
2015-02-05T16:00:16.707Z
2015-02-05T16:00:16.707Z
Nate Eldredge
<p>Bitcoin uses F9 BE B4 D9 as its main network magic bytes. I've searched the source but cannot find where these values are stored. Presumably they're computed, but I'm not sure where. Can someone tell me where they exist or are computed in the source code? I'm wanting to find this value for other altcoins.</p>

<network><message>
Where are the Main network magic bytes stored in bitcoin's source code?
greatwitenorth
# Where are the Main network magic bytes stored in bitcoin's source code?

(Asked by: username_0 on 2015-02-05)

Bitcoin uses F9 BE B4 D9 as its main network magic bytes. I've searched the source but cannot find where these values are stored. Presumably they're computed, but I'm not sure where. Can someone tell me where they exist or are computed in the source code? I'm wanting to find this value for other altcoins.

**Tags:** network, message


---

## 1 answers

### Answer by username_1 on 2015-02-05. Score: 4 | Accepted answer

See the file chainparams.cpp in the constructor for class CMainParams:
pchMessageStart[0] = 0xf9;
pchMessageStart[1] = 0xbe;
pchMessageStart[2] = 0xb4;
pchMessageStart[3] = 0xd9;


---

