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 (???)
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.
No specific usecase of public key,
As usually one can ask for public key(address) that means informally we sometimes say public key despite of address.
An Ethereum address represents an account. For external owned accounts, the address is derived as the last 20 bytes of the public key controlling the account, e.g., cd2a3d9f938e13cd947ec0i8um67fe734df8d8861. This is a hexadecimal format (base 16 notation), which is often indicated explicitly by prepending 0x to the address. Since each byte of the address is represented by 2 hex characters, a prefixed address is 42 characters long.