Skip to content

A proof-of-concept implementing universal blockchain interoperability with WebAssembly-powered intelligent node balancing across Bitcoin, Lightning Network, and Ethereum.

Notifications You must be signed in to change notification settings

rollingventures/cambium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                                    __        __                         
                                   /  |      /  |                        
   _______   ______   _____  ____  $$ |____  $$/  __    __  _____  ____  
  /       | /      \ /     \/    \ $$      \ /  |/  |  /  |/     \/    \ 
 /$$$$$$$/  $$$$$$  |$$$$$$ $$$$  |$$$$$$$  |$$ |$$ |  $$ |$$$$$$ $$$$  |
 $$ |       /    $$ |$$ | $$ | $$ |$$ |  $$ |$$ |$$ |  $$ |$$ | $$ | $$ |
 $$ \_____ /$$$$$$$ |$$ | $$ | $$ |$$ |__$$ |$$ |$$ \__$$ |$$ | $$ | $$ |
 $$       |$$    $$ |$$ | $$ | $$ |$$    $$/ $$ |$$    $$/ $$ | $$ | $$ |
  $$$$$$$/  $$$$$$$/ $$/  $$/  $$/ $$$$$$$/  $$/  $$$$$$/  $$/  $$/  $$/ 

CAMBIUM: Multi-Chain Node Interlink with WASM Balancing

Version: 0.1.0-alpha Status: Alpha Release - Development/Testing Only Author: cdx - cd@rolling.ventures

A proof-of-concept implementing universal blockchain interoperability with WebAssembly-powered intelligent node balancing across Bitcoin, Lightning Network, and Ethereum.


Overview

CAMBIUM Alpha demonstrates the foundational capability of connecting multiple blockchain networks through a unified coordination layer with high-performance node balancing powered by WebAssembly. This alpha release implements fully functional bridges for three major networks with intelligent routing and real-time monitoring.

Key Innovations

🔥 WASM-Powered Node Balancing - Sub-millisecond routing decisions using Rust-compiled WebAssembly

🌐 Universal Bridges - Full implementations for Bitcoin, Lightning (LND), and Ethereum

Real-Time Coordination - Live cross-chain transaction orchestration

📊 Production Monitoring - Prometheus metrics + Grafana dashboards

🔌 Complete API - REST + WebSocket for full programmatic access


Quick Start

Prerequisites

  • Node.js 18+
  • Docker & Docker Compose
  • Rust & wasm-pack (optional, for WASM rebuild)
  • 16GB+ RAM, 50GB+ disk

Installation

# Clone repository
git clone git@github.com:rollingventures/cambium.git
cd cambium

# Install dependencies
npm install

# Start blockchain nodes (Bitcoin, Lightning, Ethereum)
npm run docker:up

# Initialize test environment
npm run setup:dev

# Build WASM module (optional if pre-built)
npm run build:wasm

# Start CAMBIUM
npm run dev

Verify Installation

# Check system status
curl http://localhost:3001/api/v1/status

# View metrics
curl http://localhost:9091/metrics

# Open Grafana dashboard
open http://localhost:3000  # admin/cambium123

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    CAMBIUM ALPHA v0.1.0                     │
│                                                             │
│  ┌──────────────────────────────────────────────────────┐   │
│  │   REST API + WebSocket Server (port 3001/3002)       │   │
│  └────────────────┬─────────────────────────────────────┘   │
│                   │                                         │
│  ┌────────────────▼─────────────────────────────────────┐   │
│  │         Universal Node Manager                       │   │
│  │  - Health monitoring & failover                      │   │
│  │  - Event aggregation                                 │   │
│  │  - WASM routing integration                          │   │
│  └────┬──────────────┬──────────────┬───────────────────┘   │
│       │              │              │                       │
│  ┌────▼───────┐ ┌───▼──────┐  ┌───▼──────────┐              │
│  │  Bitcoin   │ │ Lightning│  │  Ethereum    │              │
│  │  Bridge    │ │ Bridge   │  │  Bridge      │              │
│  │            │ │ (LND x2) │  │              │              │
│  └────┬───────┘ └────┬─────┘  └────┬─────────┘              │
│       │              │              │                       │
└───────┼──────────────┼──────────────┼───────────────────────┘
        │              │              │
   ┌────▼───────┐ ┌───▼──────┐  ┌───▼──────────┐
   │ Bitcoin    │ │ LND      │  │ Ethereum     │
   │ Core       │ │ Nodes    │  │ (Hardhat)    │
   │ (regtest)  │ │          │  │              │
   └────────────┘ └──────────┘  └──────────────┘

   ┌──────────────────────────────────────────────────────┐
   │  WASM Module (Rust)                                  │
   │  - Multi-factor node scoring                         │
   │  - Load balancing algorithm                          │
   │  - Optimal route calculation                         │
   └──────────────────────────────────────────────────────┘

Features

Multi-Chain Bridges

Bitcoin Bridge

  • ✅ Full RPC client with connection pooling
  • ✅ ZMQ real-time block/transaction notifications
  • ✅ UTXO tracking and management
  • ✅ Transaction broadcasting & validation
  • ✅ Fee estimation

Lightning Bridge

  • ✅ LND REST API integration
  • ✅ Multi-node support (Alice & Bob)
  • ✅ Channel state monitoring
  • ✅ Invoice creation/payment
  • ✅ Route discovery

Ethereum Bridge

  • ✅ ethers.js v6 integration
  • ✅ WebSocket real-time events
  • ✅ Transaction handling
  • ✅ Gas estimation
  • ✅ Contract interaction ready

Routing Engine

  • ✅ WASM-powered optimal path selection
  • ✅ Multi-factor node scoring (latency, reliability, capacity, load)
  • ✅ Cross-chain transaction coordination
  • ✅ Automatic failover
  • ✅ Cost optimization

API & Monitoring

  • ✅ RESTful API with full CRUD operations
  • ✅ WebSocket server for real-time updates
  • ✅ Prometheus metrics (40+ metrics)
  • ✅ Grafana dashboards
  • ✅ Structured logging (Winston)
  • ✅ Health check endpoints

API Examples

Check System Status

curl http://localhost:3001/api/v1/status

Response:

{
  "status": "operational",
  "version": "0.1.0-alpha",
  "totalNodes": 3,
  "healthyNodes": 3,
  "networks": {
    "bitcoin": true,
    "lightning": 2,
    "ethereum": true
  }
}

Create Cross-Chain Transaction

curl -X POST http://localhost:3001/api/v1/transactions \
  -H "Content-Type: application/json" \
  -d '{
    "sourceNetwork": "bitcoin",
    "targetNetwork": "ethereum",
    "amount": "0.1",
    "asset": "BTC",
    "priority": 200
  }'

Get Node Health

curl http://localhost:3001/api/v1/nodes/health

Get Statistics

curl http://localhost:3001/api/v1/stats

WebSocket Connection

const ws = new WebSocket('ws://localhost:3002');

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data);
  console.log(msg.type, msg.data);
};

Development

Project Structure

cambium/
├── wasm/                    # Rust WASM module
│   └── src/lib.rs          # Node balancing algorithm
├── src/
│   ├── bridges/            # Bitcoin, Lightning, Ethereum
│   ├── core/               # NodeManager, RoutingEngine
│   ├── api/                # REST + WebSocket server
│   ├── utils/              # Config, logging, metrics
│   └── types/              # TypeScript definitions
├── docker-compose.yml      # Dev environment
├── scripts/                # Build & setup scripts
└── tests/                  # Test suites

Available Scripts

npm run dev              # Start development server
npm run build            # Build TypeScript + WASM
npm run build:wasm       # Build WASM module only
npm test                 # Run tests
npm run lint             # Check code style
npm run docker:up        # Start all nodes
npm run docker:down      # Stop all nodes
npm run setup:dev        # Initialize test environment

Environment Configuration

Copy .env.example to .env and customize:

# Bitcoin
BITCOIN_RPC_HOST=localhost
BITCOIN_RPC_PORT=18443
BITCOIN_RPC_USER=cambium
BITCOIN_RPC_PASSWORD=cambium123

# Lightning
LND_ALICE_HOST=localhost
LND_ALICE_PORT=10009

# Ethereum
ETHEREUM_RPC_URL=http://localhost:8545

# API
API_PORT=3001
WS_PORT=3002

Service Endpoints

Service URL Description
REST API http://localhost:3001 Main API endpoint
WebSocket ws://localhost:3002 Real-time updates
Metrics http://localhost:9091/metrics Prometheus metrics
Grafana http://localhost:3000 Dashboards (admin/cambium123)
Prometheus http://localhost:9090 Metrics UI
Bitcoin RPC localhost:18443 Bitcoin Core
LND Alice localhost:10009 Lightning node 1
LND Bob localhost:10010 Lightning node 2
Ethereum RPC http://localhost:8545 Ethereum node

Performance

Alpha Benchmarks (Development Environment)

  • Node connection: ~500ms (Bitcoin), ~800ms (Lightning), ~300ms (Ethereum)
  • WASM routing decision: <5ms
  • API response time: 10-100ms
  • Cross-chain transaction: ~5s (simulated)
  • Memory usage: ~300MB (all bridges)

Documentation


Roadmap

Current: Alpha v0.1.0 ✅

  • Multi-chain bridges (Bitcoin, Lightning, Ethereum)
  • WASM node balancing engine
  • Universal Node Manager
  • Routing Engine
  • REST API + WebSocket
  • Prometheus metrics

Next: Beta v0.2.0 🚧

  • Real atomic swaps
  • Database persistence
  • Additional networks (Solana, Cardano)
  • Quantum-resistant signatures
  • Privacy layer (zk-proofs)
  • Authentication & rate limiting
  • Production deployment guides

Future: v1.0.0 🔮

  • Mainnet support
  • Full quantum resistance
  • Universal wallet UI
  • Smart contract deployment
  • Enterprise features

Known Limitations

⚠️ Alpha Release - Development Only

  • Transactions are simulated, not executing real on-chain operations
  • No database persistence for transaction history
  • No authentication on API endpoints
  • Single instance only (no horizontal scaling)
  • Development networks only (regtest/testnet)

DO NOT USE WITH REAL FUNDS OR ON MAINNET


Security

This is alpha software for development and testing only:

  • ❌ No security audits performed
  • ❌ Not production-ready
  • ❌ No cryptographic hardening
  • ❌ Test networks only

For security considerations in production deployment, see POC_ARCHITECTURE.md.


Contributing

This is currently a private alpha release. Contribution guidelines will be published with the public beta.

Reporting Issues

  1. Check existing issues
  2. Provide detailed reproduction steps
  3. Include logs and environment info
  4. Follow issue templates

License

Copyright 2024 cdx. All rights reserved.

CAMBIUM is a trademark of cdx. This software is proprietary and confidential.


Acknowledgments

Built with:

  • TypeScript/Node.js - Core runtime
  • Rust/WebAssembly - High-performance routing
  • Bitcoin Core - Bitcoin network
  • LND - Lightning Network
  • ethers.js - Ethereum integration
  • Docker - Development environment
  • Prometheus/Grafana - Monitoring
  • Express - API framework
  • Winston - Logging

Inspired by: The vision outlined in the CAMBIUM Black Paper 2024 for a quantum-resistant universal blockchain protocol.


Contact

  • GitHub: github.com/rollingventures/cambium
  • Issues: GitHub Issues (when public)
  • Docs: See documentation files

🚀 Building the future of universal blockchain interoperability

DocumentationArchitectureBlack Paper

About

A proof-of-concept implementing universal blockchain interoperability with WebAssembly-powered intelligent node balancing across Bitcoin, Lightning Network, and Ethereum.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published