REP-0007 Title: Implement EIP-2718 (Typed Transaction Envelope) Author: Ronin Core Team Type: Standard Track Status: Executed Created: 2023-11-02
TransactionType || TransactionPayload
is a valid transaction and TransactionType || ReceiptPayload
is a valid transaction receipt where TransactionType
identifies the format of the transaction and *Payload
is the transaction/receipt contents, which are defined in future REPs.
This REP essentially enables Ethereum's EIP-2718.
By introducing an envelope transaction type, we can add new transaction types without worrying about backward compatibility with existing transactions. We just need to make sure that there is no numbering conflict between TransactionType
s.
The specification is the same as in EIP-2718.
The transaction root in the block header MUST be the root hash of patriciaTrie(rlp(Index) => Transaction)
where:
Index
is the index in the block of this transactionTransaction
is eitherTransactionType || TransactionPayload
orLegacyTransaction
TransactionType
is a positive unsigned 8-bit number between0
and0x7f
that represents the type of the transactionTransactionPayload
is an opaque byte array whose interpretation is dependent on theTransactionType
and defined in future REPsLegacyTransaction
isrlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])
All signatures for future transaction types SHOULD include the TransactionType
as the first byte of the signed data. This makes it so we do not have to worry about signatures for one transaction type being used as signatures for a different transaction type.
The receipt root in the block header MUST be the root hash of patriciaTrie(rlp(Index) => Receipt)
where:
Index
is the index in the block of the transaction this receipt is forReceipt
is eitherTransactionType || ReceiptPayload
orLegacyReceipt
TransactionType
is a positive unsigned 8-bit number between0
and0x7f
that represents the type of the transactionReceiptPayload
is an opaque byte array whose interpretation is dependent on theTransactionType
and defined in future REPsLegacyReceipt
isrlp([status, cumulativeGasUsed, logsBloom, logs])
The TransactionType of the receipt MUST match the TransactionType of the transaction with a matching Index.
It is STRONGLY recommended to include the transaction type as the first byte of the signed payload. If you fail to do this, it is possible that your transaction may be signature compatible with transactions of another type which can introduce security vulnerabilities for users.
- EIP-2718: https://eips.ethereum.org/EIPS/eip-2718
The content is licensed under CC0.