Skip to content

Q-arz/OXG-Blockchain

Repository files navigation

Oxy•gen — Post-Quantum Blockchain

License: MIT Go Version PQC

Oxy•gen is a quantum-resistant Layer 1 blockchain designed for offline-first, mesh network environments. It combines Post-Quantum Cryptography (Dilithium3) with partition-tolerant consensus to enable secure, decentralized applications in disconnected or intermittent connectivity scenarios.

🔐 Post-Quantum Security

Oxy•gen is the first blockchain to natively integrate CRYSTALS-Dilithium3 (NIST PQC standard) at the protocol level:

  • Quantum-Resistant Signatures: All transactions use Dilithium3 instead of ECDSA
  • Native EVM Precompile: Smart contracts can verify PQC signatures via staticcall at address 0x0D
  • Account Abstraction Ready: Enables quantum-safe smart wallets and advanced account models
  • Custom go-ethereum Fork: github.com/Q-arz/go-ethereum with built-in PQC support

Why Post-Quantum? Quantum computers threaten traditional cryptography (ECDSA, RSA). Oxy•gen future-proofs blockchain security against quantum attacks.

🌐 Designed for Mesh Networks

Unlike traditional blockchains requiring constant internet connectivity, Oxy•gen operates in:

  • Offline-first environments: Nodes communicate over WiFi/LoRa mesh networks
  • Partition-tolerant: Local block production continues during network splits
  • Delayed reconciliation: State merges when connectivity is restored
  • Community infrastructure: No reliance on centralized ISPs or cloud providers

Use Cases: Rural communities, disaster recovery, censorship-resistant networks, IoT mesh deployments.

⚡ Key Features

  • Post-Quantum Cryptography: Dilithium3 (NIST FIPS 204) for transaction signing
  • EVM Compatible: Deploy Solidity smart contracts with quantum-safe verification
  • Mesh Network Support: Operates without internet via Oxygen SDK Bridge (WiFi/LoRa/Sat)
  • Partition Tolerance: Continues operation during network splits
  • Proof of Stake: CometBFT consensus with validator staking
  • Production Ready: 24-hour soak test completed without stalls

🏗️ Architecture

┌─────────────────────────────────────────────────────────┐
│                    Oxy•gen Blockchain                    │
├─────────────────────────────────────────────────────────┤
│  Application Layer (Smart Contracts - Solidity)         │
├─────────────────────────────────────────────────────────┤
│  Execution Layer (Custom go-ethereum fork)              │
│  • EVM with Dilithium3 precompile (0x0D)                │
│  • PQC transaction verification                         │
├─────────────────────────────────────────────────────────┤
│  Consensus Layer (CometBFT)                             │
│  • Byzantine Fault Tolerant                             │
│  • Proof of Stake                                       │
├─────────────────────────────────────────────────────────┤
│  Network Interface (Bridge)                             │
│  • WebSocket connection to Oxygen SDK bridge            │
│  • Abstraction over physical transport                  │
└────────────────────────┬────────────────────────────────┘
                         │
┌────────────────────────▼────────────────────────────────┐
│  Physical Network Layer (Oxygen SDK - Node.js)          │
│  • WiFi Direct / Bluetooth / LoRa / Satellite           │
│  • Edge AI Routing Optimization                         │
└─────────────────────────────────────────────────────────┘

Technology Stack

  • Consensus: CometBFT (formerly Tendermint)
  • Execution: Custom fork of go-ethereum (Q-arz/go-ethereum)
  • Cryptography: CRYSTALS-Dilithium3 (NIST FIPS 204)
  • Language: Go 1.24+
  • Smart Contracts: Solidity (EVM compatible)

📁 Repository Structure

oxg-blockchain/              # This repository (blockchain node)
├── go/                      # Core blockchain implementation
│   ├── cmd/                 # CLI tools and node binary
│   ├── internal/
│   │   ├── consensus/       # CometBFT integration
│   │   ├── execution/       # EVM execution engine
│   │   ├── crypto/          # Dilithium3 PQC wrapper
│   │   ├── storage/         # State persistence (LevelDB)
│   │   ├── network/         # P2P mesh networking
│   │   └── api/             # REST API server
│   └── test/                # E2E and integration tests
├── contracts/               # Example smart contracts
└── docs/                    # Documentation

Separate Repositories:

🚀 Quick Start

Prerequisites

  • Go: 1.24 or higher
  • Node.js: 18+ (for E2E tests)
  • Git: For cloning repositories

Build from Source

# Clone the repository
git clone https://github.com/Q-arz/oxg-blockchain.git
cd oxg-blockchain/go

# Build the node
go build -o oxy-blockchain ./cmd/oxy-blockchain

# Initialize node
./oxy-blockchain init --home ~/.oxygen

# Start the Connectivity Bridge (Required for P2P)
# (In a separate terminal, from oxygen-sdk repo)
npx tsx src/bridge-server.ts

# Start the node (Connects to bridge at ws://localhost:3001)
./oxy-blockchain start

Run with Docker

# Development mode
docker compose up --build

# Production mode
docker compose -f docker-compose.prod.yml up -d --build

Run E2E Tests

cd go/test
npm install
node e2e-stress-test.mjs

🔬 Post-Quantum Cryptography Details

Dilithium3 Integration

Oxy•gen uses CRYSTALS-Dilithium (mode 3) as specified in NIST FIPS 204:

Component Size Description
Public Key 1,952 bytes Used for address derivation (SHA256)
Private Key 4,000 bytes Stored securely in wallet
Signature 3,293 bytes Attached to each transaction

EVM Precompile

Smart contracts can verify Dilithium3 signatures using the precompile at 0x0D:

// Solidity example
function verifyPQCSignature(
    bytes memory publicKey,  // 1952 bytes
    bytes memory signature,  // 3293 bytes
    bytes memory message
) public view returns (bool) {
    bytes memory input = abi.encodePacked(publicKey, signature, message);
    
    (bool success, bytes memory result) = address(0x0D).staticcall(input);
    require(success, "Precompile call failed");
    
    return abi.decode(result, (uint256)) == 1;
}

Gas Cost: 25,000 base + 100 per 32 bytes of message

See PQC Migration Report for full technical details.

📚 Documentation

Comprehensive documentation is available in the docs/ directory:

🤝 Related Projects

🧪 Testing & Validation

  • Unit Tests: Full coverage of crypto primitives
  • Integration Tests: CometBFT + EVM integration
  • E2E Tests: 50 concurrent PQC transactions (100% success rate)
  • Soak Test: 24-hour continuous operation without failures
  • Load Test: 7.95 TPS average on test hardware

🛣️ Roadmap

  • Dilithium3 transaction signing
  • EVM precompile for PQC verification
  • Mesh network P2P layer
  • CometBFT consensus integration
  • Cross-partition state reconciliation
  • Mobile light client
  • Hardware wallet support (PQC)
  • Zero-knowledge proof integration

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

What this means:

  • ✅ Free to use commercially
  • ✅ Free to modify and distribute
  • ✅ Free to use in private projects
  • ✅ No warranty provided

Attribution

If you use Oxy•gen in your project, we appreciate (but don't require) attribution:

Powered by Oxy•gen - Post-Quantum Blockchain
https://github.com/Q-arz/oxg-blockchain

🙏 Acknowledgments

  • NIST: For standardizing post-quantum cryptography
  • Cloudflare: For the circl library (Dilithium implementation)
  • CometBFT Team: For the robust consensus engine
  • Ethereum Foundation: For the EVM specification

Built for a quantum-safe, decentralized future.

For questions, issues, or contributions, please open an issue on GitHub.

About

Oxy•gen is a native blockchain designed to run on physical nodes and mesh networks disconnected from the public Internet. provide reliable execution and settlement infrastructure in environments with intermittent or no connectivity, enabling community-driven, resilient, and low-infrastructure.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors