<p>The network byte is the first byte of input to base58 encoder.</p>

<p>For uncompressed keys the input is always 1 network byte (0x80) followed by 32-byte secret exponent, followed by a 4-byte checksum. For compressed keys there is an extra byte of 0x01 between the exponent and the checksum.</p>

<p>The prefixes '5', 'K' or 'L' are the result of the aforementioned constraints on the input data. If you plug in all 0x00 or all 0xff in the 32-byte exponent and convert it to base58, you will see that the private key must start with '5H...5K' for uncompressed and 'Kw...L5' for compressed.</p>

CC BY-SA 3.0
2014-04-22T00:45:38.120Z
Oh. Thank you very much sir! That helped explain a lot of stuff. :)
user282190
CC BY-SA 3.0
2014-04-21T23:52:46.870Z
2014-04-21T23:52:46.870Z
uminatsu
<p>I am extemely sorry if this not the right place... but thought I could maybe get some pointers?</p>

<p>Well, basically, if you look at this:
<a href="https://github.com/kyledrake/coinpunk/blob/master/lib/bitcoinjs/eckey.js#L12" rel="nofollow">https://github.com/kyledrake/coinpunk/blob/master/lib/bitcoinjs/eckey.js#L12</a>
what is that networkTypes for?</p>

<p>And also, <a href="https://github.com/kyledrake/coinpunk/blob/master/lib/bitcoinjs/eckey.js#L47" rel="nofollow">https://github.com/kyledrake/coinpunk/blob/master/lib/bitcoinjs/eckey.js#L47</a> On there, what is it basically is it what the private key usually or basically starts with in the coin? Like does bitcoin just start off their private keys with "L" or "K"? Or is this part of the code not even RELATED to this?</p>

<address><private-key><base58>
CoinPunk questions with private base58 encoded private keys?
user282190
# CoinPunk questions with private base58 encoded private keys?

(Asked by: username_0 on 2014-04-21)

I am extemely sorry if this not the right place... but thought I could maybe get some pointers?

Well, basically, if you look at this:
<https://github.com/kyledrake/coinpunk/blob/master/lib/bitcoinjs/eckey.js#L12>
what is that networkTypes for?

And also, <https://github.com/kyledrake/coinpunk/blob/master/lib/bitcoinjs/eckey.js#L47> On there, what is it basically is it what the private key usually or basically starts with in the coin? Like does bitcoin just start off their private keys with "L" or "K"? Or is this part of the code not even RELATED to this?

**Tags:** address, private-key, base58


---

## 1 answers

### Answer by username_1 on 2014-04-21. Score: 1 | Accepted answer

The network byte is the first byte of input to base58 encoder.

For uncompressed keys the input is always 1 network byte (0x80) followed by 32-byte secret exponent, followed by a 4-byte checksum. For compressed keys there is an extra byte of 0x01 between the exponent and the checksum.

The prefixes '5', 'K' or 'L' are the result of the aforementioned constraints on the input data. If you plug in all 0x00 or all 0xff in the 32-byte exponent and convert it to base58, you will see that the private key must start with '5H...5K' for uncompressed and 'Kw...L5' for compressed.

> **Comments:**
> **username_0**: Oh. Thank you very much sir! That helped explain a lot of stuff. :)  

---

