Flashblocks API Quickstart
Introduction
Flashblocks on Optimism are a transaction preconfirmation feature that provides near-instant transaction feedback by streaming partial block updates every 200 milliseconds. This significantly reduces the effective block time from Optimism’s standard 2 seconds to just 200 milliseconds, a 10x increase.
Flashblocks is great for developers who demand instant UX such as decentralized exchanges, onchain gaming, and other high-frequency applications.
Getting started instructions
Flashblocks is currently supported on both Optimism Sepolia testnet and mainnet and can be accessed using your existing Alchemy Optimism RPC.
Flashblocks-enabled API Endpoints
eth_getBlockByNumber
Use the pending tag to retrieve the latest Flashblock:
Example Response
eth_getTransactionReceipt
Use the existing receipt RPC to get preconfirmed receipts:
Example Response
eth_getBalance
Use the pending tag to get the address balance in the latest Flashblock:
Example Response
eth_getTransactionCount
Use the pending tag to get the address nonce in the latest Flashblock:
Example Response
eth_getTransactionByHash
Use the existing get transaction by hash RPC to get preconfirmed transactions:
Example Response
eth_call
Use the pending tag to execute a smart contract call against the latest Flashblock:
Example Response
eth_simulateV1
Use the pending tag to simulate transactions against the latest Flashblock:
Example Response
eth_estimateGas
Use the pending tag to estimate gas against the latest Flashblock:
Example Response
eth_getLogs
Use the pending tag for toBlock to retrieve logs from the latest Flashblock: