[Ethereum] Why are the last 20 bytes of the public key used as the address

addressescryptographypublic-key

According to this post regarding how to derive the Ethereum address from a public key:

Take the last 40 characters / 20 bytes of this public key
(Keccak-256). Or, in other words, drop the first 24 characters / 12
bytes. These 40 characters / 20 bytes are the address. When prefixed
with 0x it becomes 42 characters long.

My question is why the last 20 bytes (as opposed to something other than 20), is it an arbitrary decision or is there an underlying mathematical purpose to it?

Best Answer

Full public keys aren't really that useful in Ethereum*, as they don't serve any practical use. Taking the last 20 bytes is a:

  1. Heuristic aimed to simplify the management of the key; that is, copy and pasting, checksums or confirmations over the phone in large transfers.

  2. Pre-empting security mechanism. Hashing functions are broken every other decade or so, hence cutting the full public key is a great extra layer of defense. Satoshi did the same in Bitcoin, as the address is hashed twice: SHA-256 and RIPEMD-160 (if one gets broken, you still have the other one as a shield).

*You could use Ethereum for sending messages, but why would you? It's expensive and you could use PGP.