0

I am trying to convert public key hex to Bitcoin address.

From this website http://gobittest.appspot.com/Address, I can do some test.

For example, I have this public key:

04b4d653fcbb4b96000c99343f23b08a44fa306031e0587f9e657ab4a2541129368d7d9bb05cd8afbdf7705a6540d98028236965553f91bf1c5b4f70073f55b55d

According to the website, the address should be:

1DU8Hi1sbHTpEP9vViBEkEw6noeUrgKkJH

which is the base58 encode of 0088C2D2FA846282C870A76CADECBE45C4ACD72BB655DA1216.

However, if I do Base58 encoding directly on 0088C2D2FA846282C870A76CADECBE45C4ACD72BB655DA1216 on this website https://www.browserling.com/tools/base58-encode, I will get:

bSLwwticQjhNvEtqTMZXbn3dLmFrPvNrDGE4hmHsfADpHWb3b2ruh3XqtNzv8ESS8V6V

which is totally different from the 34-char Bitcoin address.

Anyone knows why?

4

When you use that site, you are encoding the hex as a hex string, not of the actual bytes that they should be. The base58 encoding for addresses operates on the bytes themselves which are represented in the hex string. However that website is just encoding the hex string (which, as bytes, is double the length and is entirely other data).

1

Andrew Chow told you why. Now I'll tell you how.

First, convert hex to ASCII (I suggest this website)

(I can't copy the ASCII result below, since that would cause problems.)

Then copy the weird-looking ASCII text it created, and paste it to the Base58 Encoder.

enter image description here

Done!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.