Purpose and Scope
This document describes the data structures, type hierarchy, and encoding formats of transactions used in StableNet.It covers the six supported transaction types, the role of each type, encoding formats (RLP, binary, JSON), as well as signing and hash calculation rules. Related documents:
- Transaction lifecycle: Transaction Processing
- State transition execution: State Transitions
- Transaction submission via APIs: Transaction Submission and Signing
Transaction Type Hierarchy
StableNet supports six transaction types through a polymorphic type hierarchy.All transaction types implement the
TxData interface and are wrapped by the top-level Transaction structure.
Supported Types
| Type | Constant | Value | Description |
|---|---|---|---|
| Legacy | LegacyTxType | 0x00 | Pre–EIP-2718 legacy format |
| Access List | AccessListTxType | 0x01 | EIP-2930 access list transaction |
| Dynamic Fee | DynamicFeeTxType | 0x02 | EIP-1559 dynamic fee transaction |
| Blob | BlobTxType | 0x03 | EIP-4844 data availability transaction |
| Set Code | SetCodeTxType | 0x04 | EIP-7702 code delegation |
| Fee Delegated | FeeDelegateDynamicFeeTxType | 0x16 (22) | StableNet fee-delegated transaction |
TxData Interface
All transaction types implement theTxData interface (core/types/transaction.go), which defines the following responsibilities:
- Type identification:
txType() byte - Field accessors:
chainID(),nonce(),gas(),gasPrice(),gasTipCap(),gasFeeCap(),value(),to(),data(),accessList() - Signature handling:
rawSignatureValues(),setSignatureValues() - Fee delegation extension:
feePayer(),rawFeePayerSignatureValues() - Gas calculation:
effectiveGasPrice(baseFee, gasTip) - Encoding/decoding:
encode(*bytes.Buffer),decode([]byte)
Transaction Wrapper
TheTransaction structure acts as a common wrapper for all transaction types and provides:
- Type-agnostic interface: Holds an internal
TxDataimplementation - First-seen timestamp: Records when the transaction was first observed locally
- Cached computations: Hash, size, sender, and fee payer addresses cached via
atomic.Value - Immutability: Transactions are immutable after creation; modifications require creating a new instance
Individual Transaction Types
Legacy Transaction (Type 0x00)
The basic transaction format used prior to EIP-2718, with the simplest structure.| Field | Type | Description |
|---|---|---|
Nonce | uint64 | Account nonce |
GasPrice | *big.Int | Gas price in Wei |
Gas | uint64 | Gas limit |
To | *common.Address | Recipient address (nil for contract creation) |
Value | *big.Int | Transferred value |
Data | []byte | Call data |
V, R, S | *big.Int | ECDSA signature values |
Access List Transaction (Type 0x01)
Introduced by EIP-2930, this transaction pre-declares addresses and storage keys accessed during execution. Additional characteristics:- Includes
ChainID: Prevents replay attacks - Includes
AccessList: Address and storage slot list - Simplified signature format: Uses
yParity(0 or 1)
Dynamic Fee Transaction (Type 0x02)
An EIP-1559-based transaction that separates base fee and priority fee.| Field | Description |
|---|---|
GasTipCap | Maximum priority fee |
GasFeeCap | Maximum total gas cost |
min(GasTipCap + BaseFee, GasFeeCap)
In StableNet, governance policy may restrict GasTipCap to a block-header-defined value.
Blob Transaction (Type 0x03)
A data availability transaction introduced by EIP-4844. Additional fields:BlobFeeCap: Maximum fee per blob gasBlobHashes: Versioned blob commitment hashesSidecar: Actual blob data
- Contract creation is not allowed
- Sidecar data is excluded from hash calculation
- Blob-related values use
uint256.Int
Set Code Transaction (Type 0x04)
An EIP-7702-based transaction that allows an EOA to delegate execution code. Additional field:AuthList: Authorization list for code delegation
- Contract creation is not allowed
AuthListmust not be empty- Delegations already processed are not rolled back even if execution fails
Fee-Delegated Transaction (Type 0x16)
A StableNet-specific extension where a third party pays the gas fee. Additional fields:FeePayer: Fee-paying addressFV,FR,FS: Fee payer signature values
- Sender signature: Approves the transaction contents
- Fee payer signature: Approves payment of gas fees
Encoding Formats
RLP Encoding
RLP is the primary format used for network transmission and storage. Legacy transactions:Binary Encoding
MarshalBinary() / UnmarshalBinary() provide the canonical EIP-2718 binary encoding.This encoding is used for hash and signature calculation.
JSON Encoding
A human-readable format used by RPC interfaces.- All numeric values are hex-encoded strings
- Typed transactions include
yParity vandyParitymust be consistent
Transaction Signing
Signer Selection Logic
The signer is selected based on chain configuration and block state.AnzeonSigner handles StableNet extensions, including Set Code transactions.
Signing and Recovery
- Signatures are generated over the hash excluding signature fields
- The sender address is recovered via
Sender() - For fee-delegated transactions, the fee payer address is recovered separately via
FeePayer()
Transaction Hashing
Hash Calculation Rules
Legacy transactions:Blob Transaction Special Case
Blob transaction hashes do not include sidecar data.The hash remains identical regardless of whether the sidecar is present.
Integration with State Transitions
Before execution, a transaction is converted into aMessage structure via TransactionToMessage().
- Extract sender and fee payer addresses
- Compute gas pricing
- Apply fee delegation information
- Include flags to skip signature checks for RPC calls

