[Ethereum] Ethereum Address vs Public Key

addressespublic-key

I'm creating an ethereum wallet and I'm a bit confused with the concept of public key vs address. I understand that the Address is a hashed version of the public key, but when I'm generating a new wallet, I have 3 data fields: private key (used to sign a transaction), Address (used to receive a transaction), Public Key (???)

What is the practical use of the public key?

Best Answer

When you are creating a new wallet, what you are doing is creating an account. Every account has a private key and a public key, and are indexed by an address that is where you send the transaction.

The address is the last 20 bytes of the hash of the public key.

According to the documentation:

Every account is defined by a pair of keys, a private key and public key. Accounts are indexed by their address which is derived from the public key by taking the last 20 bytes. Every private key/address pair is encoded in a keyfile.

http://ethdocs.org/en/latest/account-management.html?highlight=address#keyfiles

You can find this post useful:

https://kobl.one/blog/create-full-ethereum-keypair-and-address/

Hope this helps.