Let's say I need to derive the address from a public key string.
0xbb8250cc01a0afa7dcaee987b2adda8d1b0a0bb2f7cc427bd942a98c7837364d62e6ea4728a99db39fd55a6f7474a159ca88a96b40279044a1349a2280c8cd43
According to this reply here I need to:
- hash it:
I used this online hash generator because the built in
Web3.sha3()
function doesn't seem to return the same value for some reason and I don't know how to specify the input for thesoliditySha3()
function.
So the hash is now:
>>> hash = a591d48139d1f97e701cc15cb42a35c0ba7abf1aa44cfc82cdba0033779719eb
- Cut the first 20 characters and add
0x
prefix:
hash = "0x" + hash[24:]
=> 0xb42a35c0ba7abf1aa44cfc82cdba0033779719eb
Unfortunately this is not the correct address. The address should be 0xD4aD2c314d60089654bf292874AC0488F3ee77bA
So what's the correct way for dummies to derive the address from a public key string?