Skip to main content

Try it Live

Run Transaction examples in the interactive playground

Transaction Types

Complete type definitions for all Ethereum transaction types.

Transaction Type Enum

Source: types.ts:7-13

Type Definitions

Legacy Transaction (Type 0)

Original Ethereum transaction format with fixed gas price.
Key characteristics:
  • Uses v signature component (bigint) instead of yParity
  • Chain ID encoded in v for EIP-155 (v = chainId * 2 + 35 + yParity)
  • Pre-EIP-155 transactions use v = 27 or v = 28
  • No access list support
Source: types.ts:59-72

EIP-2930 Transaction (Type 1)

Access list transactions introduced in Berlin hard fork.
Key characteristics:
  • Explicit chainId field
  • Uses yParity (0 or 1) instead of v
  • Includes accessList for pre-declaring account/storage access
  • Still uses fixed gasPrice
Source: types.ts:74-90

EIP-1559 Transaction (Type 2)

Dynamic fee market transactions introduced in London hard fork.
Key characteristics:
  • Uses maxFeePerGas and maxPriorityFeePerGas instead of fixed gasPrice
  • Effective gas price = min(baseFee + maxPriorityFeePerGas, maxFeePerGas)
  • Includes access list support
  • Most common transaction type on modern Ethereum
Source: types.ts:92-109

EIP-4844 Transaction (Type 3)

Blob transactions for L2 data availability introduced in Dencun hard fork.
Key characteristics:
  • to cannot be null (no contract creation with blobs)
  • Includes maxFeePerBlobGas for blob gas pricing
  • blobVersionedHashes contains KZG commitments to blob data
  • Each blob is 128 KB (131072 bytes)
  • Maximum 6 blobs per transaction
  • Blob data stored separately from transaction
Source: types.ts:111-130

EIP-7702 Transaction (Type 4)

EOA delegation transactions allowing externally-owned accounts to temporarily act as smart contracts.
Key characteristics:
  • Includes authorizationList for EOA-to-contract delegations
  • Each authorization must be signed by the delegating EOA
  • Allows EOAs to execute contract logic temporarily
  • Delegation is valid only for the transaction duration
Source: types.ts:132-150

Supporting Types

AccessList

Pre-declared account and storage slot access for gas optimization.
Example:
Source: types.ts:18-26

Authorization

Delegation authorization for EIP-7702 transactions.
Example:
Source: types.ts:29-43

VersionedHash

KZG commitment hash for EIP-4844 blob transactions.
First byte indicates version (currently 0x01 for SHA-256). Source: types.ts:48

Any Transaction

Union type for all transaction types.
Used in functions that accept any transaction type. Source: types.ts:155

Type Guards

Type guards for runtime type checking.
Type guard implementations:
Source: typeGuards.ts

Type Comparison

Usage Examples

Creating Transactions

Type Narrowing