Skip to main content

Try it Live

Run Transaction examples in the interactive playground

Transaction Hashing

Keccak256 hashing for transaction identification and signing.

hash

Compute transaction hash (keccak256 of serialized transaction).

    getSigningHash

    Get hash that should be signed (excludes signature fields).

      Hash vs Signing Hash

      The difference between hash and getSigningHash:

      Transaction Hash

      hash(tx) computes hash of complete transaction including signature:
      Used as transaction identifier in:
      • Block transactions
      • Transaction receipts
      • eth_getTransactionByHash RPC

      Signing Hash

      getSigningHash(tx) computes hash without signature fields:
      Used for:
      • Creating signatures
      • Verifying signatures
      • Recovering sender address

      Type-Specific Hashing

      Transaction.Legacy.hash

      Transaction.Legacy.getSigningHash

      Transaction.EIP1559.hash

      Transaction.EIP1559.getSigningHash

      Similar methods exist for EIP2930, EIP4844, and EIP7702.

      Hash Usage Patterns

      Transaction Identification

      Block Transaction List

      Transaction Pool

      Signing Workflow

      Signature Verification

      Legacy Transaction Signing Hash

      Legacy transactions have special signing hash logic for EIP-155:
      Example:

      EIP-4844 Signing Hash

      EIP-4844 blob transactions exclude blob versioned hashes from signing hash:
      Blob hashes ARE included in signing hash, but the actual blob data is not.

      Performance Considerations

      Hashing is cryptographically expensive (keccak256):
      For batch processing:

      Implementation Status

      Many methods currently throw “Not implemented” - check test files for implementation status.

      See Also

      EIP References