Skip to main content

Primitives Reference

All primitives in src/primitives/. Each is a branded type with colocated TypeScript and Zig implementations.

Core Types

Address

20-byte Ethereum address with EIP-55 checksumming.
Methods: 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.
Also: Bytes1 through Bytes8, Bytes16, Bytes20, Bytes32

Numeric Types

Uint256 (Uint)

256-bit unsigned integer as branded bigint.
40+ methods: 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


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 in src/primitives/Ssz/ with:
  • basicTypes.ts - Primitive SSZ types
  • container.ts - Container types
  • merkle.ts - Merkle tree operations
  • variableTypes.ts - Variable-length types

Transaction Types

Transaction

All Ethereum transaction types with full serialization support.
Transaction Types:
  • Legacy - Pre-EIP-2718 transactions
  • EIP2930 - Access list transactions
  • EIP1559 - Fee market transactions
  • EIP4844 - Blob transactions
  • EIP7702 - 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

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