ZetaChain - Universal Blockchain Interoperability
ZetaChain RPC
With Dwellir, you get access to our global ZetaChain network which always routes your API requests to the nearest available location, ensuring low latency and the fastest speeds.
What is ZetaChain?
ZetaChain is the foundational layer for universal blockchain interoperability, enabling omnichain smart contracts and messaging between any blockchain. As a Proof-of-Stake blockchain built on Cosmos SDK and Tendermint consensus, ZetaChain connects all blockchains, including Bitcoin, Ethereum, and other chains without smart contracts.
Key Features
- 🌐 Universal Connectivity - Connect to any blockchain, including Bitcoin and non-smart contract chains
- 🔄 Omnichain Smart Contracts - Deploy contracts that can read and write to multiple chains
- 💱 Native Cross-Chain Swaps - Swap assets across chains without wrapped tokens
- 🔐 Decentralized Security - Secured by a decentralized network of validators
- ⚡ High Performance - Fast finality with 6-second block times
- 🛠️ EVM Compatible - Full Ethereum compatibility for easy dApp migration
Why Choose ZetaChain?
For Cross-Chain Developers
ZetaChain revolutionizes cross-chain development with its unique omnichain smart contract capability:
- Single Contract, Multiple Chains - Write once, interact with all chains
- Native Asset Support - Handle native tokens without wrapping
- Simplified Architecture - No bridges or wrapped tokens needed
- Universal Messaging - Send messages and data between any chains
For DeFi Builders
Build truly interoperable DeFi applications:
- Cross-Chain Liquidity - Access liquidity from multiple chains
- Omnichain DEXs - Trade assets across chains seamlessly
- Multi-Chain Yield - Optimize yields across different blockchains
- Universal Wallets - One address for all chains
For NFT Projects
Create omnichain NFT experiences:
- Cross-Chain NFTs - NFTs that exist across multiple chains
- Multi-Chain Marketplaces - Buy and sell NFTs from any chain
- Interoperable Gaming - Game assets usable across different chains
Quick Start with ZetaChain
Connect to ZetaChain in seconds with Dwellir's optimized endpoints:
🔗 RPC Endpoints
https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY
Quick Connect:
curl -X POST https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
- Chain ID: 7000 (0x1b58)
- Native Token: ZETA
- Block Time: 6 seconds
- Consensus: Tendermint BFT
Installation & Setup
- Ethers.js v6
- Web3.js
- Viem
- Python
import { JsonRpcProvider } from 'ethers';
// Connect to ZetaChain mainnet
const provider = new JsonRpcProvider(
'https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY'
);
// Verify connection to ZetaChain (Chain ID: 7000)
const network = await provider.getNetwork();
console.log('Connected to ZetaChain:', network.chainId === 7000n);
// Get the latest block
const block = await provider.getBlock('latest');
console.log('Latest block:', block.number);
// Query ZETA balance
const balance = await provider.getBalance('0x...');
console.log('ZETA Balance:', balance.toString());
const Web3 = require('web3');
// Connect to ZetaChain mainnet
const web3 = new Web3(
'https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY'
);
// Get chain ID to verify connection (should be 7000)
const chainId = await web3.eth.getChainId();
console.log('Connected to ZetaChain:', chainId === 7000);
// Get current gas price in ZETA
const gasPrice = await web3.eth.getGasPrice();
console.log('Current gas price:', gasPrice);
// Check ZETA balance
const balance = await web3.eth.getBalance('0x...');
console.log('Balance:', web3.utils.fromWei(balance, 'ether'), 'ZETA');
import { createPublicClient, http } from 'viem';
import { zetachain } from 'viem/chains';
// Create a public client for ZetaChain
const client = createPublicClient({
chain: {
...zetachain,
rpcUrls: {
default: {
http: ['https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY']
}
}
},
transport: http()
});
// Get the latest block number
const blockNumber = await client.getBlockNumber();
console.log('Latest block:', blockNumber);
// Read ZETA balance
const balance = await client.getBalance({
address: '0x...'
});
console.log('Balance:', balance);
from web3 import Web3
# Connect to ZetaChain mainnet
w3 = Web3(Web3.HTTPProvider(
'https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY'
))
# Verify connection and chain ID (7000)
if w3.is_connected():
chain_id = w3.eth.chain_id
print(f"Connected to ZetaChain (Chain ID: {chain_id})")
# Get latest block
block_number = w3.eth.block_number
print(f"Latest block: {block_number}")
# Check ZETA balance
address = '0x...'
balance = w3.eth.get_balance(address)
print(f"Balance: {w3.from_wei(balance, 'ether')} ZETA")
Network Statistics
Available JSON-RPC Methods
Available JSON-RPC Methods
📊 Reading Blockchain Data
Query blocks, transactions, and account states
📤 Sending Transactions
Submit and manage transactions
📝 Smart Contract Interaction
Call and interact with smart contracts
🔧 Node & Network Info
Query node status and network information
Ready to build omnichain dApps on ZetaChain?
Get your API key →Omnichain Smart Contracts
ZetaChain's unique omnichain smart contracts can interact with multiple blockchains:
// Example: Omnichain DEX Contract
pragma solidity 0.8.7;
import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol";
import "@zetachain/protocol-contracts/contracts/zevm/interfaces/IZRC20.sol";
contract OmnichainDEX {
SystemContract public systemContract;
constructor(address systemContractAddress) {
systemContract = SystemContract(systemContractAddress);
}
// Swap tokens across any chain
function crossChainSwap(
address zrc20From,
address zrc20To,
uint256 amount,
bytes calldata recipient
) external {
// Transfer from user
IZRC20(zrc20From).transferFrom(msg.sender, address(this), amount);
// Perform swap logic
uint256 amountOut = calculateSwapAmount(zrc20From, zrc20To, amount);
// Send to recipient on destination chain
IZRC20(zrc20To).withdraw(recipient, amountOut);
}
}
Cross-Chain Messaging
Send messages between any blockchains:
// Send cross-chain message from Ethereum to Bitcoin
const connector = new ethers.Contract(connectorAddress, connectorABI, signer);
const tx = await connector.send({
destinationChainId: "18332", // Bitcoin testnet
destinationAddress: bitcoinAddress,
destinationGasLimit: 100000,
message: ethers.utils.defaultAbiCoder.encode(
["string"],
["Hello from Ethereum!"]
),
zetaValueAndGas: ethers.utils.parseEther("0.1"),
zetaParams: "0x"
});
console.log('Cross-chain message sent:', tx.hash);
Available Methods
ZetaChain supports all standard Ethereum JSON-RPC methods:
Core Methods
- eth_blockNumber - Get the latest block number
- eth_call - Execute a smart contract call
- eth_chainId - Get the chain ID (7000)
- eth_getBalance - Query account balance
Transaction Methods
- eth_sendRawTransaction - Send signed transactions
- eth_getTransactionByHash - Get transaction details
- eth_getTransactionReceipt - Get transaction receipt
- eth_estimateGas - Estimate gas for transactions
Block Methods
- eth_getBlockByNumber - Get block by number
- eth_getBlockByHash - Get block by hash
Smart Contract Methods
- eth_getCode - Get contract bytecode
- eth_getStorageAt - Read contract storage
Event Methods
- eth_getLogs - Query event logs
eth_newFilter
- Create event filter (documentation coming soon)
Rate Limits & Performance
Endpoint Performance
- Throughput: 10,000+ requests/second
- Latency: < 50ms average response time
- Uptime: 99.95% SLA guarantee
- Geographic Distribution: Global edge locations
Rate Limiting Tiers
Tier | Requests/Second | Monthly Requests | Support |
---|---|---|---|
Free | 25 | 1M | Community |
Developer | 100 | 10M | |
Professional | 500 | 100M | Priority |
Enterprise | Custom | Unlimited | 24/7 Dedicated |
Developer Resources
Official Documentation
- ZetaChain Docs - Official documentation
- GitHub - Source code and examples
- Explorer - Block explorer
SDK & Tools
- @zetachain/toolkit - JavaScript SDK
- @zetachain/protocol-contracts - Smart contract interfaces
- Hardhat Template - Starter template
Community & Support
Best Practices
1. Connection Management
// Implement retry logic for resilience
async function createProvider() {
const provider = new ethers.JsonRpcProvider(
'https://api-zetachain-mainnet.n.dwellir.com/YOUR_API_KEY'
);
// Set custom timeout
provider._getConnection().timeout = 10000;
// Verify connection
try {
await provider.getNetwork();
return provider;
} catch (error) {
console.error('Connection failed, retrying...');
await new Promise(r => setTimeout(r, 1000));
return createProvider();
}
}
2. Gas Optimization
// Optimize gas for cross-chain transactions
async function estimateCrossChainGas(contract, method, params) {
// Get current gas price
const gasPrice = await provider.getGasPrice();
// Estimate gas with buffer for cross-chain
const estimatedGas = await contract.estimateGas[method](...params);
const gasLimit = estimatedGas.mul(120).div(100); // 20% buffer
return {
gasLimit,
gasPrice: gasPrice.mul(110).div(100) // 10% above current
};
}
3. Event Monitoring
// Monitor cross-chain events efficiently
function watchCrossChainEvents(contract) {
const filter = contract.filters.CrossChainCall();
contract.on(filter, (from, to, amount, destinationChain, event) => {
console.log(`Cross-chain transfer: ${from} → ${to}`);
console.log(`Amount: ${amount}, Chain: ${destinationChain}`);
console.log(`Transaction: ${event.transactionHash}`);
});
}
Security Considerations
Cross-Chain Security
- Always validate destination addresses
- Implement proper access controls
- Use time locks for large transfers
- Monitor cross-chain message status
Smart Contract Best Practices
// Secure cross-chain transfer
modifier validateCrossChain(uint256 chainId) {
require(
systemContract.isValidChainId(chainId),
"Invalid destination chain"
);
_;
}
function secureCrossChainTransfer(
uint256 destinationChainId,
bytes calldata recipient,
uint256 amount
) external validateCrossChain(destinationChainId) {
// Implementation
}
Need Help?
📧 Email: support@dwellir.com
💬 Discord: Join our community
📖 More Docs: docs.dwellir.com
Start building omnichain dApps with ZetaChain today! 🚀