Integrating Flashblocks
Learn how to integrate Flashblocks for lightning-fast transaction confirmations on Unichain, with preconfirmations in just 200 milliseconds.
Coming Soon: Flashblocks on Unichain
Experience lightning-fast transaction confirmations on Unichain with Flashblocks. Get preconfirmations in just 200 milliseconds—designed for maximally efficient DeFi and seamless user experiences.
What are Flashblocks?
Flashblocks enable ultra-fast transaction confirmations on Unichain by providing preconfirmations - instant signals that arrive before the next block is finalized. Instead of waiting up to 1 second for block confirmation, users receive transaction feedback in just 200 milliseconds.
Key Benefits
- 5x Faster Confirmations: Reduce perceived latency from 1 seconds to 200ms
- Seamless Integration: Works with many existing Ethereum JSON-RPC methods using the
pending
tag - No Protocol Changes: Built as an "out-of-protocol" extension that doesn't modify Unichain's core consensus
- Incremental Updates: Receive partial block updates as transactions are processed
- Backward Compatible: Existing applications continue to work without modifications
How It Works
Flashblocks work by streaming partial block updates called "Flashblocks" every 200 milliseconds. Each Flashblock contains:
- Transaction Batches: Groups of transactions processed together
- State Updates: Account balances, nonces, and storage changes
- Execution Results: Transaction receipts and status information
These updates are propagated to RPC providers who maintain a preconfirmation cache, allowing applications to query the latest state immediately.
Perfect For
- DeFi Applications: Instant swap confirmations and liquidity updates
- Marketplaces: Immediate purchase confirmations
- Payment Systems: Instant payment verification
- Apps: User experiences become without the normal crypto wait times
Integrating Flashblocks (Apps)
Flashblocks integration is designed to be seamless for application developers. Most existing applications can benefit from Flashblocks with minimal code changes.
RPC Endpoints
Use these Flashblocks-aware RPC endpoints for development and testing:
Network | URL |
---|---|
Unichain Mainnet | https://mainnet.unichain.org |
Unichain Sepolia | https://sepolia.unichain.org |
Production Note: These public endpoints are rate-limited. For production applications, see our node providers that support Flashblocks below.
Supported RPC Methods
The following standard Ethereum JSON-RPC methods support Flashblocks data when using the pending
tag:
eth_getBlockByNumber
Get the latest Flashblock with all preconfirmed transactions:
Response:
eth_call
Use the preconfirmation cache state to return the call result:
eth_getTransactionReceipt
Get receipts for preconfirmed transactions immediately. Notice, no pending tag is needed:
eth_getBalance
Get the latest balance including preconfirmed transactions:
eth_getTransactionCount
Get the latest nonce for sending transactions:
Library Integration
Ethers.js
Viem
Integrating Flashblocks (Wallet Providers)
Wallet providers can integrate Flashblocks to provide instant transaction feedback to users.
User Experience Benefits
- Instant Confirmations: Show users their transaction succeeded immediately
- Real-time Balance Updates: Update balances as soon as transactions are preconfirmed
- Reduced Anxiety: Users don't wait wondering if their transaction went through
- Better UX: Feels like Web2 application responsiveness
Implementation Guidelines
Transaction Status Updates
Balance Updates
Using Flashblocks with a Node Provider
For production use cases, consider using a Node provider that is supporting Flashblocks on Unichain!
- Alchemy: https://www.alchemy.com/docs/reference/flashblocks-api-quickstart
- Quicknode: https://www.quicknode.com/docs/Unichain/flashblocks/overview
Getting Help
Join our Discord and look for the Unichain channel.
Last updated on