Ethereum transaction types
Last updated
Was this helpful?
Last updated
Was this helpful?
You can interact with the Ethereum JSON-RPC API using different transaction types (specified by the type
parameter).
The following methods use a unique format depending on the transaction type:
Transactions with type 0x0
are legacy transactions that use the transaction format existing before typed transactions were introduced in . They contain the parameters nonce
, gasPrice
, gasLimit
, to
, value
, data
, v
, r
, and s
. Legacy transactions don’t use or incorporate .
Transactions with type 0x1
are transactions introduced in . They contain, along with the , an accessList
parameter, which specifies an array of addresses and storage keys that the transaction plans to access (an access list). Access list transactions must specify an access list, and they don’t incorporate .
Also, access list transactions contain the yParity
parameter. The returned values for this parameter can either be 0x0
or 0x1
. This is the parity (0 for even, 1 for odd) of the y-value of a signature.
Use the API to simulate a transaction which returns the addresses and storage keys that may be used to send the real transaction, and the approximate gas cost.
EIP-1559 transactions don’t specify gasPrice
, and instead use an in-protocol, dynamically changing base fee per gas. At each block, the base fee per gas is adjusted to address network congestion as measured by a gas target.
They also contain a maxPriorityFeePerGas
parameter, which specifies the maximum fee the sender is willing to pay per gas above the base fee (the maximum priority fee per gas), and a maxFeePerGas
parameter, which specifies the maximum total fee (base fee + priority fee) the sender is willing to pay per gas.
An EIP-1559 transaction always pays the base fee of the block it’s included in, and it pays a priority fee as priced by maxPriorityFeePerGas
or, if the base fee per gas + maxPriorityFeePerGas
exceeds maxFeePerGas
, it pays a priority fee as priced by maxFeePerGas
minus the base fee per gas. The base fee is burned, and the priority fee is paid to the miner that included the transaction. A transaction’s priority fee per gas incentivizes miners to include the transaction over other transactions with lower priority fees per gas.
Transactions with type 0x2
are transactions introduced in , included in Ethereum's . EIP-1559 addresses the network congestion and overpricing of transaction fees caused by the historical fee market, in which users send transactions specifying a gas price bid using the gasPrice
parameter, and miners choose transactions with the highest bids.
EIP-1559 transactions contain the and (except for gasPrice
).