3

I see address everywhere in ethereum but not public key, and I understood that address is Keccak-256 of pubkey, and I do not think it is possible to derive pubkey from address. So, my question is during signature verification does the crypto engine somehow recover the pubkey from somewhere or it is able to verify using address directly?

0

2 Answers 2

2

The public key is recovered from the signature. The address can then be derived from the recovered public key.

See this post for why that is possible.

2
  • 1
    Why ethereum (also bitcoin I think) uses hashed public key as an address instead of directly use public key. This can easily verify signature.
    – Kronos
    May 23, 2018 at 11:45
  • Most likely for brevity. The address isn't even the hash, it is a hexadecimal string representation of the last 20 bytes of the hash, which is why I assume this is done for brevity. (A system I am working on uses the entire hash, actually, and they are somewhat large, but nothing compared to the DER representation of the entire key.)
    – zxq9
    Apr 28, 2021 at 11:32
0

the public key is encrypted in the digital signature, and you can extract(recover) the public key from the signature; you can then use the public key to verify the signature using the msgHash, signature, and the public key.

Note:

  1. for Ethereum, the address is the last 20 bytes of the public key's hash.
  2. You can't generate the public key from the address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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