🌉 Bridge Protocol

Ultra-low-cost cross-chain USDC transfers using P2P relay architecture with H3DAC encrypted audit trails

📚 Opacus Documentation

🎯 Core Concepts

Opacus is a decentralized bridge protocol that enables ultra-low-cost cross-chain token transfers using a simple P2P relay architecture combined with encrypted audit trails.

✅ Production Ready: Successfully bridged 4+ transactions with 100% success rate on testnet

Key Innovations

  • Simple P2P Relay: Direct wallet-to-wallet transfers - no complex escrow contracts
  • H3DAC Encryption: Ed25519 + secp256k1 hybrid encryption for transparent audit logs
  • Ultra-Low Gas: 21,000 gas per transfer vs 400,000+ for traditional bridges (94% savings)
  • Instant Finality: ~15 second detection and completion time
  • No TVL Lock: Zero total value locked - eliminating smart contract risk

🌉 Bridge Technology

How It Works

  1. User Action: Send USDC to relay address on Sepolia (0x1c7D4B19...)
  2. Detection: PM2 relay monitors ERC20 Transfer events every 15 seconds
  3. Encryption: Bridge event encrypted with H3DAC SDK (Ed25519 + secp256k1)
  4. Relay: Direct transfer of equal USDC amount on 0G Newton from relay wallet
  5. Completion: User receives USDC on 0G Newton (0xBE97bB01...)

Supported Routes

Source Chain Token Target Chain Token Status
Sepolia Testnet Native USDC (Circle) 0G Newton Testnet Mock USDC ✅ Live
Ethereum Mainnet Native USDC 0G Mainnet USDC.e 🔄 Planned
Base Mainnet Native USDC 0G Mainnet USDC.e 🔄 Planned

Smart Contracts

// Sepolia Native USDC (Circle Official) 0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238 // 0G Newton Mock USDC (Deployed) 0xBE97bB0151a5cFC68f0d54CD42e512b0872E3a2c // Relay Wallet 0x0fA18Bb0Dbb03Ed137a8071461549eBAc94a015e
💡 Tip: For mainnet, we recommend using Base → 0G route for lowest gas fees (~$0.01 vs ~$5+ on Ethereum)

🏗️ Architecture

System Components

1. Frontend (Web3)

  • Ethers.js v5 for MetaMask integration
  • ERC20 approve + transfer flow
  • Real-time balance updates
  • Transaction status tracking

2. Relay Service (Backend)

  • PM2 process manager (7/24 uptime)
  • TypeScript + Hardhat scripting
  • 15-second polling interval
  • Auto-restart & log rotation

3. H3DAC SDK (Security)

  • Ed25519 signature authentication
  • secp256k1 session key encryption
  • Encrypted audit trail logging
  • Gateway-optional operation

4. Smart Contracts

  • Circle Native USDC (Sepolia)
  • Mock ERC20 USDC (0G Newton)
  • No custom bridge contracts
  • Standard ERC20 interfaces only

Comparison: Traditional vs Opacus

Feature Traditional Bridge Opacus Bridge
Gas Cost 400,000 - 600,000 gas 21,000 gas (94% savings)
Smart Contracts Complex escrow + validators None (P2P transfers)
TVL Lock Yes (security risk) No (zero lock)
Completion Time 5-30 minutes ~15 seconds
Audit Trail On-chain events only Encrypted H3DAC logs
Fees 0.1% - 0.5% 0% (testnet) / 0.1% (mainnet)

📊 Bridge Statistics

5
Total Transactions
100%
Success Rate
0.00498
Total Volume (USDC/ETH)
21k
Avg Gas Used
~15s
Avg Completion Time
0
Failed Transfers

Transaction History

# Recent Bridge Transactions 1. 0xb6e35e22b245bf40... → 0.000995 A0GI (Block 8754656) 2. 0xc0c5df7902fe2902... → 0.000995 A0GI (Block 8754672) 3. 0xd17aeb616bac9368... → 0.000995 A0GI (Block 8754689) 4. 0x02b50d00d25b4524... → 0.000995 A0GI (Block 8754706) 5. 0xcaa6f2c16aa73e4c... → 0.0001 ETH Test (Block 8757652) Total Delivered: 0.00498 tokens Average Gas: 21,000 Success Rate: 100% (5/5)
✅ Live Monitoring: Check PM2 logs with pm2 logs usdc-bridge

🔧 Technology Stack

1. Blockchain & Web3

  • Ethereum Sepolia: Testnet for USDC source
  • 0G Newton: Testnet for USDC destination
  • Ethers.js v5: Web3 provider and contract interaction
  • MetaMask: Wallet connection and transaction signing

2. Backend Infrastructure

  • Node.js + TypeScript: Relay service implementation
  • Hardhat: Smart contract deployment and scripting
  • PM2: Process management, auto-restart, monitoring
  • Noble Libraries: Cryptographic primitives (secp256k1, ed25519)

3. Security & Encryption

  • H3DAC SDK: Hybrid encryption (Ed25519 + secp256k1)
  • Message Authentication: Ed25519 signatures
  • Session Keys: secp256k1 ephemeral key pairs
  • Payload Encryption: XOR cipher with session key

4. Frontend

  • HTML5 + CSS3: Responsive UI design
  • Vanilla JavaScript: No framework dependencies
  • Cloudflare CDN: Ethers.js library hosting
// Key Dependencies (package.json) { "dependencies": { "@noble/secp256k1": "^2.0.0", "@noble/ed25519": "^2.0.0", "@noble/hashes": "^1.3.3", "ethers": "^6.15.0", "hardhat": "^2.20.1", "dotenv": "^16.3.1" } }

🚀 Deployment Guide

Prerequisites

# Required Tools - Node.js v18+ - PM2 (npm install -g pm2) - MetaMask wallet - Testnet ETH (Sepolia faucet)

Setup Steps

  1. Clone repository and install dependencies
  2. Configure .env with PRIVATE_KEY
  3. Deploy Mock USDC to 0G Newton
  4. Fund relay wallet with 0G tokens
  5. Start PM2 relay service
  6. Open frontend and test bridge
# Quick Start Commands cd contracts npm install npx hardhat run scripts/deploy-mock-usdc.ts --network ogNewton # Start relay pm2 start "npx hardhat run scripts/usdc-bridge-relay.ts --network sepolia" --name usdc-bridge pm2 save pm2 logs usdc-bridge # Open frontend cd ../website python3 -m http.server 3000 # Visit: http://localhost:3000/usdc-bridge.html

Production Deployment (Mainnet)

⚠️ Important: Mainnet deployment requires additional security measures:
  • Hardware wallet for relay private key
  • Multi-sig emergency controls
  • Daily withdrawal limits
  • Real-time monitoring & alerts
  • Smart contract audits (if using contracts)

🌉 Try Live Bridge