[Ethereum] How to recover public from tx signature(r,s) and verify signature

hashprivate-keypublic-keySecuritysignature

My first question is how to verify signature using only r,s and elliptic curve paramete, and an address (which is hashed of public key, so cannot retrieve public key from the address)?

Next question is that, why ethereum (also bitcoin I think) uses hashed public key as an address instead of directly use public key as an address?

Best Answer

Maybe this answer can help you - https://ethereum.stackexchange.com/a/33346/16729

Ethereum security model relies on elliptic curve cryptography (ECC) to sign and validate transactions. In ECC public and private key are used to sign and verify. It has no concept of addresses. When signing and verifying transactions you do not need addresses. The original bitcoin paper do not mention addresses at all. They appear later in an effort to make them easier to remember (compressed public key are 32 bytes vs address 20 bytes). Now you can completely hide public key from the user interaction and only have private key and addresses. But internaly ethereum keeps using them to validate transactions.

Related Topic