How long Ethereum hash length? (block, transaction, address)

Viewed 299

I checked hash length from node data, like below(include '0x').

  • block hash: 66
  • transaction hash: 66
  • receipt root: 66
  • address: 40

Is it always a fixed length? Or is it variable length?

1 Answers

Yes, it's always fixed length.

  • Block hash is calculated using the keccak256 algorithm that always results in 32 bytes (64 hex characters prepended by 0x) no matter the input length.

  • Same goes for transaction hash and receipt root hash.

  • An address is always the last 20 bytes (40 hex charaters prepended by 0x) of the public key hash.

Related