For background on how Flashblocks work and the base component, see the Flashblocks Architecture.
WebSocket Endpoints
| Network | URL |
|---|---|
| Mainnet | wss://mainnet.flashblocks.base.org/ws |
| Sepolia | wss://sepolia.flashblocks.base.org/ws |
Message Format
Messages are delivered as Brotli-compressed binary data. Decompress before parsing as JSON. To minimize bandwidth, each Flashblock only includes diff data from the previous Flashblock:- Index 0 (initial): Contains the
baseobject with full block properties, plus the firstdiff - Index 1-10 (subsequent): Contains only
diffdata (new transactions, updated state root, gas used)
Schema
Flashblock Object
The root structure of each WebSocket message.Unique identifier for the block being built. Remains consistent across all 10 Flashblocks within a single full block.
Flashblock index within the current block (0-10). Index 0 contains system transactions only; indexes 1-10 contain user transactions.
Block header properties. Only present when
index is 0. See Base Object.Block differences/updates for this Flashblock. See Diff Object.
Additional data including balance updates and transaction receipts. This object is not stable and may change without notice. See Metadata Object.
flashblock.json
Base Object
Contains full block header properties. Only present in Index 0 (the first Flashblock of each full block).Hash of the parent block.
Address receiving transaction fees (coinbase).
Block number in hex format.
Maximum gas allowed in this block (hex).
Unix timestamp of block creation (hex).
Base fee per gas unit (hex, EIP-1559).
Previous RANDAO value for randomness.
Arbitrary data included by the block builder.
base.json
Diff Object
Contains the block state changes for this specific Flashblock. Present in every message.Merkle root of the state trie after applying this Flashblock’s transactions.
Hash of the block at this Flashblock index. Changes with each Flashblock as more transactions are added.
Cumulative gas used up to and including this Flashblock (hex).
Cumulative blob gas used (hex, EIP-4844).
Array of RLP-encoded transaction data included in this Flashblock.
Validator withdrawals included in this Flashblock (typically empty on L2).
Merkle root of transaction receipts.
Bloom filter for quick log searching.
Merkle root of withdrawals.
diff.json
Metadata Object
Contains additional block metadata, including balance updates and transaction receipts.Block number as a decimal integer.
Map of addresses to their updated ETH balances (hex). Only includes accounts whose balances changed in this Flashblock.
metadata.json
Receipt Object
Transaction execution result. Receipts come in two formats: EIP-1559 (modern) or Legacy. Check which field is present to determine the type.Receipt data for EIP-1559 transactions. See ReceiptData.
Receipt data for legacy transactions. See ReceiptData.
Receipt data for L1→L2 deposit transactions. See ReceiptData.
receipt.json
ReceiptData Object
The actual receipt information, regardless of transaction type.Transaction status:
0x1 for success, 0x0 for failure.Total gas used in the block up to and including this transaction (hex).
Array of event logs emitted by the transaction. See Log Object.
Nonce for deposit transactions (L1→L2 only).
receiptdata.json
Log Object
Event log emitted by a smart contract. Crucial for detecting swaps, transfers, and other contract events.
Example:
log.json
Complete Example
Index 0 Response (Initial)
The first Flashblock of each full block includes thebase object:
Example:
Index 1-10 Response (Diff Only)
Subsequent Flashblocks only include thediff (no base object):
Example:
Further Resources
- How To Build a Base Flashblocks Listener — Step-by-step Go tutorial
- Flashblocks Overview — Key concepts and transaction lifecycle
- App Integration — RPC examples and library integrations
- Reth node README — Hardware requirements and configuration
- Flashblocks Deep Dive — Engineering blog with implementation details