<p>Addresses and private keys are encoded using Base58Check Encoding. The prefix bytes are chosen such that once whatever you are encoding is actual encoded with Base58Check Encoding, you will end up with a string that has the intended prefix character.</p>
<p>The process of creating a Base58Check encoded string is described on the <a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow noreferrer">bitcoin wiki</a>:</p>
<blockquote>
<p>A Base58Check string is created from a version/application byte and payload as follows.</p>
<ol>
<li>Take the version byte and payload bytes, and concatenate them together (bytewise).</li>
<li>Take the first four bytes of SHA256(SHA256(results of step 1))
3.Concatenate the results of step 1 and the results of step 2 together (bytewise).</li>
<li>Treating the results of step 3 - a series of bytes - as a single big-endian bignumber, convert to base-58 using normal mathematical steps (bignumber division) and the base-58 alphabet described below. The result should be normalized to not have any leading base-58 zeroes (character '1').</li>
<li>The leading character '1', which has a value of zero in base58, is reserved for representing an entire leading zero byte, as when it is in a leading position, has no value as a base-58 symbol. There can be one or more leading '1's when necessary to represent one or more leading zero bytes. Count the number of leading zero bytes that were the result of step 3 (for old Bitcoin addresses, there will always be at least one for the version/application byte; for new addresses, there will never be any). Each leading zero byte shall be represented by its own character '1' in the final result.</li>
<li>Concatenate the 1's from step 5 with the results of step 4. This is the Base58Check result.</li>
</ol>
</blockquote>
<p>The resulting prefix character is also dependent on the size of the data being encoded.</p>
<p>The only way to get a prefix byte that you want to use that has a specific character is to guess and check. The data you are encoding must be of a fixed length, and even when it is, you may still end up with multiple possible prefix characters for a given prefix byte.</p>
<p>A list of prefix values and the characters they produce for 20 byte values are also <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes" rel="nofollow noreferrer">available on the bitcoin wiki</a></p>

CC BY-SA 3.0
2017-07-26T19:55:56.113Z
2017-07-26T20:04:51.883Z
2020-06-16T11:10:03.350Z
Ava Chow
<p>hmm, not sure what you are asking. Normally you have a private key in hex chars. When you do a base58 encoding, you use hex 0x80 as prefix, which results in "K" or "L" at the beginning of the so called WIF compressed key (wallet interchange format). It would be "5" for a normal WIF key. If this is what you are looking for, you may read up (online available) the chapter <a href="http://chimera.labs.oreilly.com/books/1234000001802/ch04.html#private_public_keys" rel="nofollow noreferrer">http://chimera.labs.oreilly.com/books/1234000001802/ch04.html#private_public_keys</a> from Andreas' book "Mastering Bitcoin".</p>

CC BY-SA 3.0
2017-07-26T18:14:34.897Z
litecoin have 176 but how they get this, a ask where find the list of prefix for this key , or how convert L to hex end to decimal for find what value need :/
all altcoin have different privat key prefixes... But how create it no explaining    , not list of baseprefix how for address.
tseries
CC BY-SA 3.0
2017-07-26T17:39:26.743Z
2017-07-26T17:39:26.743Z
pebwindkraft
<pre><code>base58Prefixes[SECRET_KEY] =     std::vector&lt;unsigned char&gt;(1,176);
</code></pre>

<p>I need prefix L , but i cannot find how do this, please do not post link to prefix list bitcoin , it's only for address prefix.</p>

<p>i search all google end find noting.</p>

CC BY-SA 3.0
2017-09-24T23:32:00.437Z
Are you creating your own currency, or are you trying to find the value for an existing one? In the former case, set it to whatever you like.
Pieter Wuille
CC BY-SA 3.0
2018-04-05T21:33:43.717Z
did you ever figure this out?
tofutim
<address><altcoin-development><vanity-address><security-key>
how to generate SECRET_KEY prefix?
tseries
# how to generate SECRET_KEY prefix?

(Asked by: username_0 on 2017-07-26)

```
base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,176);

```

I need prefix L , but i cannot find how do this, please do not post link to prefix list bitcoin , it's only for address prefix.

i search all google end find noting.

**Tags:** address, altcoin-development, vanity-address, security-key

> **Comments:**
> **username_1**: Are you creating your own currency, or are you trying to find the value for an existing one? In the former case, set it to whatever you like.  
> **username_2**: did you ever figure this out?  

---

## 2 answers

### Answer by username_3 on 2017-07-26. Score: 2

Addresses and private keys are encoded using Base58Check Encoding. The prefix bytes are chosen such that once whatever you are encoding is actual encoded with Base58Check Encoding, you will end up with a string that has the intended prefix character.

The process of creating a Base58Check encoded string is described on the [bitcoin wiki](https://en.bitcoin.it/wiki/Base58Check_encoding):

> A Base58Check string is created from a version/application byte and payload as follows.
>
> 1. Take the version byte and payload bytes, and concatenate them together (bytewise).
> 2. Take the first four bytes of SHA256(SHA256(results of step 1))
>    3.Concatenate the results of step 1 and the results of step 2 together (bytewise).
> 3. Treating the results of step 3 - a series of bytes - as a single big-endian bignumber, convert to base-58 using normal mathematical steps (bignumber division) and the base-58 alphabet described below. The result should be normalized to not have any leading base-58 zeroes (character '1').
> 4. The leading character '1', which has a value of zero in base58, is reserved for representing an entire leading zero byte, as when it is in a leading position, has no value as a base-58 symbol. There can be one or more leading '1's when necessary to represent one or more leading zero bytes. Count the number of leading zero bytes that were the result of step 3 (for old Bitcoin addresses, there will always be at least one for the version/application byte; for new addresses, there will never be any). Each leading zero byte shall be represented by its own character '1' in the final result.
> 5. Concatenate the 1's from step 5 with the results of step 4. This is the Base58Check result.

The resulting prefix character is also dependent on the size of the data being encoded.

The only way to get a prefix byte that you want to use that has a specific character is to guess and check. The data you are encoding must be of a fixed length, and even when it is, you may still end up with multiple possible prefix characters for a given prefix byte.

A list of prefix values and the characters they produce for 20 byte values are also [available on the bitcoin wiki](https://en.bitcoin.it/wiki/List_of_address_prefixes)


---

### Answer by username_4 on 2017-07-26. Score: 1

hmm, not sure what you are asking. Normally you have a private key in hex chars. When you do a base58 encoding, you use hex 0x80 as prefix, which results in "K" or "L" at the beginning of the so called WIF compressed key (wallet interchange format). It would be "5" for a normal WIF key. If this is what you are looking for, you may read up (online available) the chapter <http://chimera.labs.oreilly.com/books/1234000001802/ch04.html#private_public_keys> from Andreas' book "Mastering Bitcoin".

> **Comments:**
> **username_0**: litecoin have 176 but how they get this, a ask where find the list of prefix for this key , or how convert L to hex end to decimal for find what value need :/ all altcoin have different privat key prefixes... But how create it no explaining    , not list of baseprefix how for address.  

---

