clawrtc

July 13, 2026 · View on GitHub

BCOS Certified

clawrtc

Rust client for RustChain RTC mining — hardware attestation, Ed25519 wallets, and Proof-of-Antiquity (PoA) consensus.

Features

  • Ed25519 Wallets — generate, sign, and verify with RTC addresses
  • Node Client — health checks, balance queries, miner listings
  • Hardware Attestation — submit PoA proofs to earn RTC
  • Epoch Enrollment — register for reward distribution
  • Architecture Detection — CPU multiplier mapping (G4=2.5x, G5=2.0x, etc.)

Quick Start

use clawrtc::{NodeClient, Wallet, CpuArch};

fn main() {
    // Generate a new wallet
    let wallet = Wallet::generate();
    println!("Address: {}", wallet.address());
    println!("Public Key: {}", wallet.public_key_hex());

    // Sign a message
    let sig = wallet.sign(b"hello rustchain");
    let valid = Wallet::verify(&wallet.public_key_hex(), b"hello rustchain", &sig).unwrap();
    println!("Signature valid: {}", valid);

    // Connect to the network
    let node = NodeClient::new("https://rustchain.org");

    // Check health
    let health = node.health().unwrap();
    println!("Node v{} (uptime {}s)", health.version, health.uptime_s);

    // List miners. Current and legacy /api/miners response shapes are supported.
    for miner in node.miners().unwrap() {
        println!("{} last seen {}", miner.miner, miner.last_seen);
    }

    // Check balance
    let balance = node.balance(&wallet.address()).unwrap();
    println!("Balance: {} RTC", balance);

    // Check antiquity multipliers
    println!("G4 bonus: {}x", CpuArch::G4.multiplier());
    println!("G5 bonus: {}x", CpuArch::G5.multiplier());
}

CLI

The global --node option defaults to https://rustchain.org. Add --json to the status, balance, or miner commands for machine-readable output.

clawrtc status
clawrtc status --wallet RTC_ADDRESS --json
clawrtc wallet balance RTC_ADDRESS
clawrtc miner stats --json

miner stats reads /api/miners. The client accepts both the legacy bare list and the current { "miners": [...], "pagination": {...} } envelope. The public MinerInfo.last_seen field remains a string: legacy last_seen text is kept as is, while the current numeric last_attest Unix timestamp is converted to its decimal string form.

NodeClient::balance and wallet balance use the current /wallet/balance?miner_id=... endpoint. The node's amount_rtc response field is returned by the Rust API as f64.

Antiquity Multipliers

ArchitectureMultiplierExamples
PowerPC G42.5xPowerBook G4, Power Mac G4
PowerPC G52.0xPower Mac G5, Xserve G5
PowerPC G31.8xiBook G3, Blue & White G3
Pentium 41.5xDell Dimension, HP Pavilion
Retro x861.4x486, 386, early Pentium
Core 2 Duo1.3xMacBook 2006-2008
Apple Silicon1.2xM1, M2, M3
Modern1.0xCurrent x86_64, aarch64

Development

cargo fmt --all -- --check
cargo test --all-targets
cargo clippy --all-targets -- -D warnings

License

MIT — Elyan Labs