<p>Version byte <code>0</code> is for addresses, for an uncompressed private key you want <code>128</code>.</p>

<p><a href="https://en.bitcoin.it/wiki/Base58Check_encoding#Version_bytes" rel="nofollow">https://en.bitcoin.it/wiki/Base58Check_encoding#Version_bytes</a></p>

CC BY-SA 3.0
2015-08-30T17:13:43.493Z
I thought I did add that. that is what the 80 is in the front of the hexadecimal
patchariadog
CC BY-SA 3.0
2015-08-30T17:19:31.910Z
0x00 or 0x80, not both. Your example has 0x0080.
Claris
CC BY-SA 3.0
2015-08-30T21:37:38.370Z
I used http://convertxy.com/index.php/numberbases/ to try and convert it but it still does not give anything near that 5Hue. I also used the vb.net code and it does not work either?
patchariadog
CC BY-SA 3.0
2015-09-03T03:04:22.240Z
See [this](http://gobittest.appspot.com/Address) great webapp
Wizard Of Ozzie
CC BY-SA 3.0
2015-08-30T16:21:32.390Z
2015-08-30T16:21:32.390Z
Claris
<p>I am trying to learn more about how bitcoin addresses are created. I am following along with the tutorial at <a href="https://en.bitcoin.it/wiki/Wallet_import_format" rel="nofollow">https://en.bitcoin.it/wiki/Wallet_import_format</a></p>

<p>I undertsand how they do the first six steps however I do not understand how to go from step 6 to step 7</p>

<p>they have <code>800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D</code>
and they get the private key of <code>5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ</code></p>

<p>I have read from <a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow">here</a> that I need to do put the version byte in front which is 00 so I have</p>

<pre><code>00800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D
</code></pre>

<p>then I need to do sha256(sha256(result)) = 74944C34 (first 4 bytes)
then I have </p>

<pre><code>00800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D74944C34
</code></pre>

<p>then I am running it through this test vb.net code (I will put it in a loop once I get it working)</p>

<pre><code>Dim number As BigInteger = System.Numerics.BigInteger.Parse("00800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D74944C34", NumberStyles.HexNumber)


Dim count As BigInteger = number / 58
    Dim remainder As Integer = number Mod 58
    MessageBox.Show(count.ToString())
    MessageBox.Show(remainder.ToString())
    count = count / 58
    remainder = count Mod 58
    MessageBox.Show(count.ToString())
    MessageBox.Show(remainder.ToString())
    count = count / 58
    remainder = count Mod 58
    MessageBox.Show(count.ToString())
    MessageBox.Show(remainder.ToString())
</code></pre>

<p>for some reason the numbers are 48,37,3 but this does not line up with the chart on the second link and the answer which is <code>5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ</code></p>

<p>can someone please show me what I am doing wrong and help me understand the base58encode?</p>

<p>thanks</p>

<private-key><base58><wallet-import-format>
private key to wif - need help converting to base58encode (step 6 to step 7)
patchariadog
# private key to wif - need help converting to base58encode (step 6 to step 7)

(Asked by: username_0 on 2015-08-30)

I am trying to learn more about how bitcoin addresses are created. I am following along with the tutorial at https://en.bitcoin.it/wiki/Wallet_import_format
I undertsand how they do the first six steps however I do not understand how to go from step 6 to step 7
they have 800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D
and they get the private key of 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ
I have read from here that I need to do put the version byte in front which is 00 so I have
00800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D

then I need to do sha256(sha256(result)) = 74944C34 (first 4 bytes)
then I have 
00800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D74944C34

then I am running it through this test vb.net code (I will put it in a loop once I get it working)
Dim number As BigInteger = System.Numerics.BigInteger.Parse("00800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D74944C34", NumberStyles.HexNumber)


Dim count As BigInteger = number / 58
    Dim remainder As Integer = number Mod 58
    MessageBox.Show(count.ToString())
    MessageBox.Show(remainder.ToString())
    count = count / 58
    remainder = count Mod 58
    MessageBox.Show(count.ToString())
    MessageBox.Show(remainder.ToString())
    count = count / 58
    remainder = count Mod 58
    MessageBox.Show(count.ToString())
    MessageBox.Show(remainder.ToString())

for some reason the numbers are 48,37,3 but this does not line up with the chart on the second link and the answer which is 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ
can someone please show me what I am doing wrong and help me understand the base58encode?
thanks

**Tags:** private-key, base58, wallet-import-format


---

## 1 answers

### Answer by username_1 on 2015-08-30. Score: 1

Version byte `0` is for addresses, for an uncompressed private key you want `128`.

<https://en.bitcoin.it/wiki/Base58Check_encoding#Version_bytes>

> **Comments:**
> **username_0**: I thought I did add that. that is what the 80 is in the front of the hexadecimal  
> **username_1**: 0x00 or 0x80, not both. Your example has 0x0080.  
> **username_0**: I used http://convertxy.com/index.php/numberbases/ to try and convert it but it still does not give anything near that 5Hue. I also used the vb.net code and it does not work either?  
> **username_2**: See [this](http://gobittest.appspot.com/Address) great webapp  

---

