Primitives Reference
All primitives insrc/primitives/. Each is a branded type with colocated TypeScript and Zig implementations.
Core Types
Address
20-byte Ethereum address with EIP-55 checksumming.fromHex, fromBytes, fromPublicKey, toHex, toChecksummed, toBytes, equals, isZero, isValid, calculateCreateAddress, calculateCreate2Address
Hash
32-byte hash type used for block hashes, transaction hashes, storage roots.Hex
Hexadecimal string encoding/decoding utilities.Bytes / Bytes32
Fixed-size byte arrays.Bytes32 is 32 bytes, commonly used for storage keys.
Bytes1 through Bytes8, Bytes16, Bytes20, Bytes32
Numeric Types
Uint256 (Uint)
256-bit unsigned integer as brandedbigint.
from, fromHex, toHex, toBigInt, plus, minus, times, dividedBy, modulo, power, shiftLeft, shiftRight, and, or, xor, not, equals, lt, gt, lte, gte, min, max, clamp, abs, bitLength, popCount, isPowerOf2, gcd, lcm, isEven, isOdd, isZero
Other Integer Types
| Type | Size | Signed |
|---|---|---|
Uint8 | 8-bit | No |
Uint16 | 16-bit | No |
Uint32 | 32-bit | No |
Uint64 | 64-bit | No |
Uint128 | 128-bit | No |
Uint256 | 256-bit | No |
Int8 | 8-bit | Yes |
Int16 | 16-bit | Yes |
Int32 | 32-bit | Yes |
Int64 | 64-bit | Yes |
Int128 | 128-bit | Yes |
Int256 | 256-bit | Yes |
Encoding
Rlp
Recursive Length Prefix encoding for Ethereum serialization.Abi
Application Binary Interface encoding/decoding for contract calls.Base64
Base64 encoding/decoding.Ssz
Simple Serialize - beacon chain serialization format. Located insrc/primitives/Ssz/ with:
basicTypes.ts- Primitive SSZ typescontainer.ts- Container typesmerkle.ts- Merkle tree operationsvariableTypes.ts- Variable-length types
Transaction Types
Transaction
All Ethereum transaction types with full serialization support.Legacy- Pre-EIP-2718 transactionsEIP2930- Access list transactionsEIP1559- Fee market transactionsEIP4844- Blob transactionsEIP7702- Account abstraction transactions
AccessList
EIP-2930 access list for gas optimization.Authorization
EIP-7702 authorization for account abstraction.Blob
EIP-4844 blob data (128KB).Block Types
Block
Complete block structure.BlockHeader
Block header fields.BlockBody
Block body (transactions and uncles).BlockHash / BlockNumber
Block identifiers.Receipt & Logs
Receipt
Transaction receipt with status, logs, gas used.EventLog
Contract event log entry.LogFilter / TopicFilter / BlockFilter
Event filtering.EVM Types
Bytecode
EVM bytecode with analysis capabilities.Opcode
EVM opcode enum and metadata.Gas Types
| Type | Purpose |
|---|---|
Gas | Generic gas value |
GasLimit | Transaction/block gas limit |
GasUsed | Actual gas consumed |
GasEstimate | Estimated gas |
GasRefund | Refunded gas |
GasPrice | Legacy gas price |
BaseFeePerGas | EIP-1559 base fee |
MaxFeePerGas | EIP-1559 max fee |
MaxPriorityFeePerGas | EIP-1559 priority fee |
EffectiveGasPrice | Actual price paid |
GasConstants
EVM gas cost constants.Storage / StorageKey / StorageValue
Contract storage types.Protocol Types
Chain
Chain metadata and configuration.ChainId / NetworkId
Network identifiers.Hardfork
Ethereum hardfork enum and feature detection.ForkId
EIP-2124 fork identifier.FeeMarket
EIP-1559 fee market calculations.Denomination
Wei/Gwei/Ether conversions.Signature Types
Signature
ECDSA signature with r, s, v components.PrivateKey / PublicKey
Key types.Standards
Siwe
Sign-In with Ethereum (EIP-4361).Ens
ENS name normalization (ENSIP-15).Domain / DomainSeparator
EIP-712 typed data domain.Permit
EIP-2612 permit support.StealthAddress
ERC-5564 stealth address support.Account Abstraction (ERC-4337)
UserOperation
User operation for ERC-4337.PackedUserOperation
Packed format for ERC-4337 v0.7+.EntryPoint / Paymaster / Bundler
Account abstraction infrastructure types.Beacon Chain Types
Slot / Epoch
Beacon chain timing.ValidatorIndex / WithdrawalIndex
Validator identifiers.Withdrawal
Staking withdrawals.BeaconBlockRoot
Beacon block reference (EIP-4788).Tracing Types
TraceConfig
Debug trace configuration.StructLog / OpStep
EVM execution trace.CallTrace
Call hierarchy trace.TraceResult
Complete trace result.MemoryDump / StorageDiff / StateDiff
State inspection types.Selectors
Selector
4-byte function selector.FunctionSignature / EventSignature / ErrorSignature
Full signatures for ABI items.Proxy Types
Proxy
ERC-1167 minimal proxy utilities.Data Structures
BloomFilter
2048-bit bloom filter for log filtering.BinaryTree
Binary tree utilities for Merkle proofs.Complete Primitive Count
| Category | Count |
|---|---|
| Core types | 6 |
| Numeric | 12 |
| Encoding | 4 |
| Transaction | 5 |
| Block | 6 |
| Receipt/Logs | 8 |
| EVM | 15 |
| Protocol | 8 |
| Signature | 4 |
| Standards | 6 |
| Account Abstraction | 6 |
| Beacon Chain | 5 |
| Tracing | 10 |
| Selectors | 4 |
| Data Structures | 3 |
| Total | ~100+ |

