Unichain - DeFi-Optimized L2 by Uniswap
Complete guide to Unichain RPC and API integration with Dwellir. Build on the fast, decentralized L2 designed for DeFi and cross-chain liquidity.
Unichain RPC
With Dwellir, you get access to our global Unichain network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.
Get your API keyWhy Build on Unichain?
Unichain is a fast, decentralized Superchain L2 built to be the home for DeFi and liquidity across chains. Developed by Uniswap on the OP Stack, Unichain addresses key challenges in the Ethereum ecosystem with innovative solutions for cost, speed, and MEV protection.
Ultra-Fast Execution
- 1-Second Block Times - Fast transaction confirmations
- 250ms Sub-blocks - Coming soon for instant user experiences
- 200-250ms Finality - Significantly faster than Ethereum's 12 seconds
Cost-Efficient DeFi
- 95% Lower Costs - Compared to Ethereum L1
- MEV Protection - Verifiable block building with TEE
- No Failed Transaction Fees - Trustless revert protection
Cross-Chain Native
- Superchain Interoperability - Single-block cross-chain messaging
- ERC-7683 Support - Cross-Chain Intents standard
- Unified Liquidity - Seamless multi-chain DeFi
Quick Start with Unichain
curl -sS -X POST https://api-unichain-mainnet.dwellir.com/<API_Keys_Are_Not_Made_for_Bots> \ -H 'Content-Type: application/json' \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'import { JsonRpcProvider } from 'ethers';const provider = new JsonRpcProvider( 'https://api-unichain-mainnet.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>');const latest = await provider.getBlockNumber();console.log('block', latest);import requestsurl = 'https://api-unichain-mainnet.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>'payload = { 'jsonrpc': '2.0', 'id': 1, 'method': 'eth_blockNumber', 'params': []}resp = requests.post(url, json=payload)print(resp.json())package mainimport ( "bytes" "fmt" "io" "net/http")func main() { url := "https://api-unichain-mainnet.dwellir.com/<API_Keys_Are_Not_Made_for_Bots>" payload := []byte(`{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}`) resp, err := http.Post(url, "application/json", bytes.NewBuffer(payload)) if err != nil { panic(err) } defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body))}Network Specifications
| Parameter | Value | Details |
|---|---|---|
| Chain ID | 130 | Mainnet |
| Currency | ETH | Native Token |
| Block Time | 1s | 250ms soon |
| Finality | 200-250ms | Ultra-fast |
Unique Features
MEV Protection
Unichain employs a Trusted Execution Environment (TEE) for verifiable block building, ensuring:
- Transparent transaction ordering
- Protection against MEV extraction
- Fair and predictable execution
UNI Token Utility
The UNI token powers Unichain's validation network:
- Stake UNI to become a validator
- Earn 65% of net chain revenue
- Secure the network through decentralized validation
Stage 1 Rollup
Unichain launches as a Stage 1 rollup with:
- Permissionless fault proof system
- Independent transaction verification
- Enhanced security from day one
Native Uniswap Integration
- Uniswap v4 Hooks - Native integration for advanced DeFi
- Optimized for DEX - Purpose-built for decentralized trading
- Liquidity Hub - Central point for cross-chain liquidity
Available Methods
Developer Resources
Smart Contract Development
// Deploy your DeFi protocols on Unichain
pragma solidity ^0.8.0;
contract MyDeFiProtocol {
// Leverage Unichain's fast execution and MEV protection
// Native support for Uniswap v4 hooks
}Web3 Integration
// Connect to Unichain with Web3.js
const Web3 = require('web3');
const web3 = new Web3('https://api-unichain-mainnet.dwellir.com');
// Unichain Mainnet Chain ID: 130
const chainId = 130;
async function getBlockNumber() {
const blockNumber = await web3.eth.getBlockNumber();
console.log('Latest Unichain block:', blockNumber);
}Ethers.js Example
// Using Ethers.js with Unichain
import { ethers } from 'ethers';
const provider = new ethers.JsonRpcProvider(
'https://api-unichain-mainnet.dwellir.com'
);
// Check network
const network = await provider.getNetwork();
console.log('Connected to Unichain:', network.chainId === 130);Ecosystem & DApps
DeFi Protocols
Leading DeFi applications already deployed on Unichain:
- Uniswap - Native DEX with v4 hooks
- Morpho - Lending protocol
- Euler - Permissionless lending
- Lido - Liquid staking
- Renzo - Liquid restaking
Bridge Solutions
- Native Superchain Bridge - Direct bridging within Optimism ecosystem
- Cross-Chain Intents - ERC-7683 standard support
- Unified Liquidity - Seamless asset movement
Developer Tools
- Open Source - MIT licensed codebase
- OP Stack Compatible - Familiar development environment
- TEE Integration - Advanced security features
Network Information
Mainnet (Chain ID: 130)
| Parameter | Value | Details |
|---|---|---|
| RPC Endpoint | https://api-unichain-mainnet.dwellir.com | |
| WebSocket | wss://api-unichain-mainnet.dwellir.com | |
| Explorer | Unichain Explorer | |
| Status | Live |
Testnet (Chain ID: 1301)
| Parameter | Value | Details |
|---|---|---|
| Network | Unichain Sepolia | |
| RPC Endpoint | https://api-unichain-sepolia.n.dwellir.com/YOUR_API_KEY | |
| WebSocket | wss://api-unichain-sepolia.n.dwellir.com/YOUR_API_KEY | |
| Explorer | Unichain Sepolia Explorer | |
| Faucet | Available for testing |
API Methods
Core Ethereum Methods
All standard Ethereum JSON-RPC methods are supported:
- Transaction Methods (
eth_sendTransaction,eth_getTransactionReceipt) - Block Methods (
eth_getBlockByNumber,eth_blockNumber) - Account Methods (
eth_getBalance,eth_getCode) - Event Methods (
eth_getLogs,eth_newFilter)
Unichain L2 Specific
Enhanced methods for L2 operations:
eth_estimateL1Fee- Estimate L1 fee componentrollup_gasPrices- Get current L2 gas pricesrollup_getInfo- Get rollup configuration
Debug & Trace Methods
Advanced debugging capabilities:
debug_traceTransaction- Detailed transaction tracesdebug_traceBlockByNumber- Block-level debuggingdebug_traceCall- Simulate and trace calls
Best Practices
1. Leverage Sub-blocks
Take advantage of Unichain's upcoming 250ms sub-blocks for instant UX:
// Monitor sub-blocks for real-time updates
provider.on('block', (blockNumber) => {
// React to new blocks in near real-time
});2. MEV Protection
Build with confidence knowing transactions are protected:
// Transactions are protected from sandwich attacks
// and other MEV extraction techniques
const tx = await contract.swap(tokenA, tokenB, amount);3. Cross-Chain Design
Design for interoperability from the start:
// Leverage native cross-chain messaging
const crossChainTx = await bridge.sendMessage(
targetChain,
message
);Migration Guide
From Ethereum Mainnet
- Update chain ID to 130
- Point RPC to Unichain endpoint
- Enjoy 95% cost reduction
From Other L2s
- Minimal code changes required
- Standard Ethereum tooling works
- Enhanced features available
Resources & Support
Developer Resources
- Official Docs: Unichain documentation
- GitHub: Open source codebase (MIT license)
- Explorer: Unichain Explorer
Need Help?
- Email: support@dwellir.com
- Documentation: You're here!
- Dashboard: dashboard.dwellir.com
Related Reading
Start building on Unichain with Dwellir's enterprise-grade RPC infrastructure. Get your API key

