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?

fluency03
  • 2,637
  • 7
  • 32
  • 62
  • 1
    `0088C2D2FA846282C870A76CADECBE45C4ACD72BB655DA1216` is the hex representation of the bytes to encode. You have to decode it from hex first. – Ry- May 06 '18 at 02:38
  • thanks! another question: it shows the sha256 of `04b4d653fcbb4b96000c99343f23b08a44fa306031e0587f9e657ab4a2541129368d7d9bb05cd8afbdf7705a6540d98028236965553f91bf1c5b4f70073f55b55d ` is `173BDED8F2A2069C193E63EA30DC8FD20E815EC3642B9C24AD7002C03D1BFB9B`, but what I get is `e9970bbca3ff65777500ee969480e3857ff935c49252e537dad85387cb26dbbd ` – fluency03 May 06 '18 at 03:02
  • Could be exactly the same problem, but I don’t know how you got e9970b[…]. 173bde[…] is correct. – Ry- May 06 '18 at 03:55
  • @Ry︁ you are correct. I was doing encoding on the string itself. But when I try to convert the hex string to bytes, everything is correct. – fluency03 May 06 '18 at 12:11

0 Answers0