P2SH to LTC address with M

0

Are there anyone know how to convert P2SH address (like 34A5PyCvPJKYtHmj9jmKhGzBBwpGuAkZog) to MANDhrctLRAygo3dFckfWvEaWeQizSwWNK?

I tried to decode with Base58Check, then removed 05 and added 032, then encode it (Base58Check), however I got wrong result MANDhrctLRAygo3dFckfWvEaWeQiti143C

newbie

Posted 2019-04-02T10:52:00.130

Reputation: 45

Answers

1

The reason you are getting a different address is because you are appending the same checksum that you got from using the 03 prefix to the new prefix + payload. You need to double hash the new prefix + payload and then append the first four bytes and then encode it in base58.

If I decode your result MANDhrctLRAygo3dFckfWvEaWeQiti143C to hexadecimal, I get 321b0e61ac671bde7fb52e2f3d6e2dc213609d9de5020cb31b. In this hexadecimal string, your prefix is 32, payload is 1b0e61ac671bde7fb52e2f3d6e2dc213609d9de5, and checksum is 020cb31b.

The checksum that you would get after double hashing the new prefix + payload is e29f4248. So, you should base58 encode 321b0e61ac671bde7fb52e2f3d6e2dc213609d9de5e29f4248

Ugam Kamat

Posted 2019-04-02T10:52:00.130

Reputation: 5 180