Bitcoin

P2PKH Address Generation – Bitcoin Stack Exchange

Now that I’ve learned about how P2PKH addresses are generated, I thought I’d try to figure it out manually. We start with the following public key hash:

e049ccc9e524a9302c2187bf02c4d78741d9b039

Here’s what I know:

1MSvmgVJvYkdtCsopFqsT2g3FNNhpcoeBG

I am 00 Prefix of my hash:

00e049ccc9e524a9302c2187bf02c4d78741d9b039

This is then converted to binary to calculate the checksum.

1110000001001001110011001100100111100101001001001010100100110000001011000010000110000111101111110000001011000100110101111000011101000001110110011011000000111001

Then running this twice through SHA256 gives you the following results:

a66d4caa10c1b665d6bca3f06788db9fbea6e9912a9fcf8101eb5992f9e8ab78

Get the first 4 bytes. a66d4caa Put it at the end of my prefix + hash.

00e049ccc9e524a9302c2187bf02c4d78741d9b039a66d4caa

And I conclude as follows:

1MSvmgVJvYkdtCsopFqsT2g3FNNhsp8jXo

Can someone help me where I’m going wrong?

Edit: I forgot to convert to binary first. But it still doesn’t work.

Related Articles

Back to top button