# ZetaChain - Omnichain Smart Contract Platform

## ZetaChain RPC plans and rate limits

- **Free plan:** 20 responses per second, up to 100,000 responses a day.
- **Plans:** $49/mo, $299/mo, $999/mo with 25M, 150M, and 500M included responses. Overages billed at $5/$3/$2 per million responses respectively.
- **Paid rate limits:** 100 to 5,000 responses per second (bursts from 500 to 10,000), no daily limit.
- **Billing:** 1 response = 1 API credit on every shared plan, over HTTPS or WebSocket (WSS) where ZetaChain supports it.

Details: [Pricing](https://www.dwellir.com/docs/getting-started/pricing) · [Rate limits](https://www.dwellir.com/docs/getting-started/rate-limits) · [Authentication](https://www.dwellir.com/docs/getting-started/authentication) · [Archive nodes](https://www.dwellir.com/docs/getting-started/archive-nodes)

## 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:

## Network Information

| Parameter    | Value          | Details |
| ------------ | -------------- | ------- |
| Chain ID     | 7000 (0x1b58)  |         |
| Native Token | ZETA           |         |
| Block Time   | 6 seconds      |         |
| Consensus    | Tendermint BFT |         |

## Installation & Setup

Ethers.js v6
Web3.js
Viem
Python

```javascript
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());
```

```javascript
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');
```

```typescript
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);
```

```python
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")
```

## API Reference

## Omnichain Smart Contracts

ZetaChain's unique omnichain smart contracts can interact with multiple blockchains:

```solidity
// 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:

```javascript
// 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](https://www.dwellir.com/docs/zetachain/eth_blockNumber)** - Get the latest block number
- **[eth\_call](https://www.dwellir.com/docs/zetachain/eth_call)** - Execute a smart contract call
- **[eth\_chainId](https://www.dwellir.com/docs/zetachain/eth_chainId)** - Get the chain ID (7000)
- **[eth\_getBalance](https://www.dwellir.com/docs/zetachain/eth_getBalance)** - Query account balance

### Transaction Methods

- **[eth\_sendRawTransaction](https://www.dwellir.com/docs/zetachain/eth_sendRawTransaction)** - Send signed transactions
- **[eth\_getTransactionByHash](https://www.dwellir.com/docs/zetachain/eth_getTransactionByHash)** - Get transaction details
- **[eth\_getTransactionReceipt](https://www.dwellir.com/docs/zetachain/eth_getTransactionReceipt)** - Get transaction receipt
- **[eth\_estimateGas](https://www.dwellir.com/docs/zetachain/eth_estimateGas)** - Estimate gas for transactions

### Block Methods

- **[eth\_getBlockByNumber](https://www.dwellir.com/docs/zetachain/eth_getBlockByNumber)** - Get block by number
- **[eth\_getBlockByHash](https://www.dwellir.com/docs/zetachain/eth_getBlockByHash)** - Get block by hash

### Smart Contract Methods

- **[eth\_getCode](https://www.dwellir.com/docs/zetachain/eth_getCode)** - Get contract bytecode
- **[eth\_getStorageAt](https://www.dwellir.com/docs/zetachain/eth_getStorageAt)** - Read contract storage

### Event Methods

- **[eth\_getLogs](https://www.dwellir.com/docs/zetachain/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              | Email          |
| **Professional** | 500             | 100M             | Priority       |
| **Enterprise**   | Custom          | Unlimited        | 24/7 Dedicated |

## Developer Resources

### Official Documentation

- **[ZetaChain Docs](https://docs.zetachain.com)** - Official documentation
- **[GitHub](https://github.com/zeta-chain)** - Source code and examples
- **[Explorer](https://explorer.zetachain.com)** - Block explorer

### SDK & Tools

- **[@zetachain/toolkit](https://www.npmjs.com/package/@zetachain/toolkit)** - JavaScript SDK
- **[@zetachain/protocol-contracts](https://www.npmjs.com/package/@zetachain/protocol-contracts)** - Smart contract interfaces
- **[Hardhat Template](https://github.com/zeta-chain/template)** - Starter template

### Community & Support

- **[Discord](https://discord.gg/zetachain)** - Developer community
- **[Twitter](https://twitter.com/zetablockchain)** - Latest updates
- **[Telegram](https://t.me/zetachainofficial)** - Community chat

## Best Practices

### 1. **Connection Management**

```javascript
// 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**

```javascript
// 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](https://www.dwellir.com/docs/...params);
  const gasLimit = estimatedGas.mul(120).div(100); // 20% buffer

  return {
    gasLimit,
    gasPrice: gasPrice.mul(110).div(100) // 10% above current
  };
}
```

### 3. **Event Monitoring**

```javascript
// 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

```solidity
// 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](https://discord.gg/dwellir)
**More Docs**: [dwellir.com/docs](https://www.dwellir.com/docs)

Start building omnichain dApps with ZetaChain today!
