βοΈ Blockchain Integration Guides
Production-ready implementation guides for integrating major blockchain networks with the Quub Exchange Chain API. Each guide provides comprehensive coverage of chain registration, RPC adapter setup, wallet management, transaction tracking, security best practices, and production deployment checklists.
π― Quick Navigation
Layer 1 Blockchains
Ethereum, BNB Chain, Avalanche, Solana
Layer 2 Networks
Polygon, Arbitrum, Optimism, Base
Network Comparison
Performance metrics and feature matrix
Integration Architecture
Common patterns and best practices
π Layer 1 Blockchains
Ethereum β The EVM Foundation
Ethereum Integration Guide
Most mature smart contract platform with robust tooling and ecosystem
- β 12-second block times with ~15 minute finality
- β EIP-1559 dynamic gas pricing with priority fees
- β MEV protection strategies (private mempools, Flashbots)
- β Comprehensive ERC standards (20, 721, 1155, 4337)
- β Account abstraction and smart contract wallets
Best For: DeFi protocols, NFT platforms, high-value transactions, complex smart contracts
BNB Chain β High Throughput, Low Cost
BNB Chain Integration Guide
EVM-compatible chain optimized for fast, low-cost transactions
- β 3-second block times with ~15 second finality
- β Ultra-low gas fees (typically <$0.10 per transaction)
- β BEP-20 token standard (ERC-20 compatible)
- β High throughput for retail and gaming applications
- β Proof of Staked Authority (PoSA) consensus
Best For: Gaming, retail payments, high-frequency trading, token launches
Avalanche β Sub-Second Finality
Avalanche Integration Guide
High-performance platform with near-instant finality and subnet architecture
- β Sub-second block times with <2 second finality
- β C-Chain (EVM-compatible) for smart contracts
- β Dynamic fee adjustment based on network load
- β Subnet support for custom blockchain instances
- β Native cross-chain messaging
Best For: Real-time applications, institutional DeFi, custom subnets, low-latency trading
Solana β Non-EVM High Performance
Solana Integration Guide
Ultra-fast non-EVM blockchain with unique architecture and SPL token standard
- β 400ms slot times with 12.8s finality (67 slots)
- β Base58 signatures and account-based architecture
- β SPL token standard (distinct from ERC-20)
- β Commitment levels (processed, confirmed, finalized)
- β Ultra-low transaction costs ($0.00025 per tx)
Best For: High-frequency trading, on-chain order books, NFT minting, payment processing
π Layer 2 Networks
Polygon β Mature PoS Sidechain
Polygon Integration Guide
Established PoS sidechain with Ethereum bridging and checkpoint finality
- β 2-second block times with ~30 minute checkpoint finality
- β Native Ethereum bridge with security guarantees
- β Tiered confirmation strategy (probabilistic β checkpointed)
- β Very low gas fees (~$0.01 per transaction)
- β zkEVM rollup option for enhanced security
Best For: NFT marketplaces, gaming, enterprise applications, Ethereum scaling
Arbitrum One β Leading Optimistic Rollup
Arbitrum Integration Guide
Most adopted optimistic rollup with full EVM equivalence
- β 250ms block times with 7-day challenge period
- β Full EVM compatibility with fraud proofs
- β Standard bridge operations (deposit/withdraw)
- β Nitro upgrade for improved performance
- β Low L2 gas fees, batched L1 settlement
Best For: DeFi protocols, complex dApps, Ethereum L2 scaling with security priority
Optimism β OP Stack Foundation
Optimism Integration Guide
Modular OP Stack rollup with governance token and public goods funding
- β 2-second block times with 7-day challenge period
- β Standard Bridge and fault proof system
- β OP Stack modularity for custom chains
- β Batch submission for cost efficiency
- β Bedrock upgrade for improved performance
Best For: Superchain ecosystem, custom OP Stack rollups, DeFi and governance applications
Base β Coinbase L2
Base Integration Guide
Coinbase-backed OP Stack L2 with seamless onramp integration
- β 2-second block times with OP Stack architecture
- β Ultra-low gas fees and high throughput
- β Native Coinbase integration for fiat onramps
- β Standard Bridge compatibility with Optimism
- β Growing ecosystem with retail focus
Best For: Consumer applications, social platforms, onchain products with fiat connectivity
π Network Comparison Matrix
Performance Metrics
| Blockchain | Type | Block Time | Finality | Gas Token | Avg Gas Cost | TPS |
|---|---|---|---|---|---|---|
| Ethereum | L1 | 12s | ~15 min | ETH | $5-50 | 15-30 |
| BNB Chain | L1 | 3s | ~15s | BNB | <$0.10 | 160+ |
| Avalanche | L1 | <1s | <2s | AVAX | $0.10-1 | 4,500+ |
| Solana | L1 | 400ms | 12.8s | SOL | <$0.001 | 2,000+ |
| Polygon | L2 | 2s | ~30 min* | MATIC | ~$0.01 | 7,000+ |
| Arbitrum | L2 | 250ms | 7 days* | ETH | $0.10-1 | 4,000+ |
| Optimism | L2 | 2s | 7 days* | ETH | $0.10-1 | 2,000+ |
| Base | L2 | 2s | 7 days* | ETH | $0.10-1 | 2,000+ |
* Finality times represent withdrawal/challenge periods. Practical/probabilistic finality is much faster.
Feature Compatibility
| Feature | Ethereum | BNB | Avalanche | Solana | Polygon | Arbitrum | Optimism | Base |
|---|---|---|---|---|---|---|---|---|
| EVM Compatible | β Native | β Yes | β C-Chain | β No | β Yes | β Yes | β Yes | β Yes |
| Smart Contracts | β Solidity | β Solidity | β Solidity | β Rust | β Solidity | β Solidity | β Solidity | β Solidity |
| Token Standard | ERC-20 | BEP-20 | ERC-20 | SPL | ERC-20 | ERC-20 | ERC-20 | ERC-20 |
| Bridge Required | - | - | - | - | β Yes | β Yes | β Yes | β Yes |
| MEV Protection | β Flashbots | β οΈ Limited | β οΈ Limited | β Jito | β οΈ Limited | β Available | β Available | β Available |
| Account Abstraction | β EIP-4337 | β οΈ Limited | β Yes | β Native | β EIP-4337 | β EIP-4337 | β EIP-4337 | β EIP-4337 |
Use Case Recommendations
| Use Case | Recommended Networks | Rationale |
|---|---|---|
| DeFi Protocols | Ethereum, Arbitrum, Optimism | Deep liquidity, security, composability |
| NFT Marketplaces | Ethereum, Polygon, Base | Established standards, low minting costs |
| Gaming | BNB Chain, Polygon, Avalanche | High throughput, low costs, fast finality |
| Payment Processing | Solana, BNB Chain, Base | Ultra-low fees, fast confirmation |
| High-Frequency Trading | Solana, Avalanche | Sub-second finality, low latency |
| Enterprise Apps | Polygon, Avalanche Subnets | Scalability, custom network options |
| Consumer Social | Base, Polygon | Low barrier to entry, fiat integration |
ποΈ Common Integration Architecture
Standard Integration Pattern
All blockchain integrations follow a consistent pattern with the Quub Exchange Chain API:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Application β
β (Trading Platform, DeFi Protocol, Exchange, etc.) β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
β REST API Calls
β (JWT Bearer Token)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Quub Exchange Chain API β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Chains β β Wallets β β OnChainTxs β β
β β Registry β β Management β β Tracking β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Chain β β Health β β Events β β
β β Adapters β β Monitoring β β Webhooks β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
β RPC Calls / Indexer Queries
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Blockchain Networks β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Ethereum β β BNB β β Solana β β Polygon β β
β β RPC β β RPC β β RPC β β RPC β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Arbitrum β β Optimism β β Base β βAvalanche β β
β β RPC β β RPC β β RPC β β RPC β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Integration Workflow
1. Chain Registration
// Register blockchain network with metadata
POST /chains
{
"chainId": 1,
"name": "Ethereum Mainnet",
"networkType": "MAINNET",
"layer": "L1",
"nativeCurrency": { "symbol": "ETH", "decimals": 18 }
}
2. RPC Adapter Configuration
// Configure chain adapter with RPC endpoints
POST /chain/adapters
{
"chainId": 1,
"name": "Ethereum Primary Adapter",
"rpcEndpoint": "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY",
"signerPolicy": "HOT_WALLET",
"priority": 1
}
3. Wallet Management
// Register organization wallet
POST /orgs/{orgId}/wallets
{
"chainId": 1,
"address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"type": "HOT_WALLET",
"label": "Trading Wallet"
}
4. Transaction Tracking
// Record on-chain transaction
POST /orgs/{orgId}/onchain/txs
{
"chainId": 1,
"hash": "0xabc123...",
"fromAddress": "0x742d...",
"toAddress": "0x123abc...",
"direction": "OUTBOUND",
"status": "PENDING"
}
5. Health Monitoring
// Monitor adapter health
GET / chain / adapters / { adapterId } / health;
// Returns: status, latencyMs, syncLag, lastBlockHeight
Security Best Practices (All Chains)
Performance Optimization Strategies
Gas Optimization
// Dynamic gas pricing based on network conditions
async function estimateOptimalGas(chainId, tx) {
const adapter = await getChainAdapter(chainId);
const health = await adapter.getHealth();
if (health.congestion === "high") {
return tx.gasLimit * 1.2; // 20% buffer
}
return tx.gasLimit;
}
Transaction Batching
// Batch multiple operations for efficiency
async function batchWalletCreation(orgId, wallets) {
const promises = wallets.map((wallet) => createWallet(orgId, wallet));
return Promise.all(promises);
}
Caching Strategy
// Cache chain metadata to reduce API calls
const chainCache = new Map();
const CACHE_TTL = 3600000; // 1 hour
async function getChainMetadata(chainId) {
const cached = chainCache.get(chainId);
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
return cached.data;
}
const data = await fetchChainDetails(chainId);
chainCache.set(chainId, { data, timestamp: Date.now() });
return data;
}
π Getting Started
Choose Your Integration Path
- Start with a Specific Blockchain β Select from the guides above based on your use case
- Review the Chain API Guide β Understand the core Chain API operations
- Set Up Authentication β Configure OAuth2 credentials
- Deploy to Production β Follow blockchain-specific production checklists
Quick Links
- Chain API Documentation
- Chain API Reference
- OpenAPI Specification
- Authentication Guide
- Webhooks & Events
π Additional Resources
Development Tools
- Ethereum: Hardhat, Foundry, Remix
- Solana: Anchor, Solana CLI
- Multi-Chain: ethers.js, web3.js, viem
Network Explorers
- Ethereum: Etherscan
- BNB Chain: BscScan
- Avalanche: SnowTrace
- Solana: Solscan, Solana Explorer
- Polygon: PolygonScan
- Arbitrum: Arbiscan
- Optimism: Optimistic Etherscan
- Base: BaseScan
Official Documentation
- Ethereum Docs
- BNB Chain Docs
- Avalanche Docs
- Solana Docs
- Polygon Docs
- Arbitrum Docs
- Optimism Docs
- Base Docs