Skip to content

πŸ”— PYRAX Core Node - TriStream DAG Layer 1 blockchain with BLAKE3/KAWPOW/ZK-STARK consensus

License

Notifications You must be signed in to change notification settings

PYRAX-LLC/pyrax-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

72 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”— PYRAX Node

Core blockchain node implementation for the PYRAX TriStream DAG Layer 1 blockchain.

Overview

PYRAX Node is the core blockchain software that powers the PYRAX network. It implements the TriStream DAG consensus mechanism with support for:

  • Stream A: BLAKE3 PoW (ASIC mining, 10s blocks)
  • Stream B: KAWPOW PoW (GPU mining, 60s blocks)
  • Stream C: ZK-STARK + PoS (Finality checkpoints)

Features

  • TriStream DAG consensus with GHOSTDAG ordering
  • UTXO-based transaction model
  • RocksDB storage backend
  • libp2p P2P networking
  • JSON-RPC server
  • Stratum mining protocol support
  • EVM Sidechain with full Ethereum compatibility
  • WASM Smart Contracts via Wasmer runtime
  • ZK-Rollup support
  • L1-L2 Bridge with Merkle proof verification

EVM Sidechain

The PYRAX EVM sidechain provides full Ethereum Virtual Machine compatibility:

  • Chain ID: 7924
  • Block Gas Limit: 30,000,000
  • EIP-1559: Dynamic base fee support
  • Cancun Spec: Latest EVM opcodes via revm

Dual Execution Environment

PYRAX uniquely supports both EVM and WASM smart contracts on the same chain:

Feature EVM WASM
Languages Solidity, Vyper Rust, AssemblyScript, C/C++
Runtime revm Wasmer
Gas Metering Native EVM Custom metering
Precompiles 0x01-0x09 Host functions

Contract Type Detection

The chain automatically detects contract type based on bytecode:

  • WASM: Bytecode starting with \0asm magic bytes
  • EVM: All other bytecode

WASM Host Functions

WASM contracts have access to blockchain state through host functions:

// Environment
pyrax_address()       // Current contract address
pyrax_caller()        // Message sender
pyrax_value()         // Call value in wei
pyrax_block_number()  // Current block number

// Storage
pyrax_storage_read(key)        // Read storage slot
pyrax_storage_write(key, val)  // Write storage slot

// Crypto
pyrax_keccak256(data)  // Keccak256 hash
pyrax_sha256(data)     // SHA256 hash

// Logging
pyrax_log(topics, data)  // Emit event log

RPC Endpoints

Standard Ethereum JSON-RPC plus PYRAX-specific methods:

Method Description
eth_* Full Ethereum RPC compatibility
pyrax_isWasmContract Check if address is WASM contract
pyrax_isCairoContract Check if address is Cairo contract
pyrax_wasmContractCount Total WASM contracts deployed
pyrax_cairoContractCount Total Cairo contracts deployed
pyrax_getContractType Get contract type (evm/wasm/cairo/none)
pyrax_supportedVms List supported VMs
pyrax_isQuantumResistant Check quantum resistance status

Cairo VM (STARK-Native)

Deploy Cairo contracts with native STARK proof generation:

  • Sierra/CASM: Cairo 2.x contract format
  • STARK Proofs: Automatic execution trace generation
  • Quantum-Resistant: No elliptic curve assumptions
  • Validity Proofs: On-chain verification in O(log n)

ZK-Rollup Layer

Scalable L2 with STARK validity proofs:

  • STARK Proofs: Quantum-resistant, no trusted setup
  • High Throughput: Up to 1000 TXs per batch
  • Fast Finality: Instant L2, L1 after proof verification
  • L1-L2 Bridge: Secure deposits and withdrawals
Component Description
Sequencer Transaction ordering and batch production
Prover STARK proof generation from execution traces
Verifier Proof verification with 128-bit security
Bridge L1 deposits/withdrawals with 7-day challenge

Quantum Resistance

The entire chain is designed for post-quantum security:

Component Algorithm Security
Signatures Dilithium3/5, SPHINCS+ NIST Level 3-5
Hashing BLAKE3 256-bit
State Proofs STARK 128-bit
Key Derivation BLAKE3 256-bit

L1-L2 Bridge

Secure asset transfer between PYRAX L1 and EVM sidechain:

  • Deposits: Lock on L1 β†’ Mint on L2
  • Withdrawals: Burn on L2 β†’ Unlock on L1
  • Verification: STARK proof validation (quantum-resistant)
  • Daily Limits: Configurable transfer limits

Requirements

  • Rust 1.85.0-nightly or later
  • RocksDB
  • OpenSSL

Building

cargo build --release

Running

# Devnet
./target/release/pyrax-node --network devnet --rpc --p2p

# Testnet
./target/release/pyrax-node --network testnet --rpc --p2p

# Mainnet
./target/release/pyrax-node --network mainnet --rpc --p2p

License

MIT License - see LICENSE for details.

Links

About

πŸ”— PYRAX Core Node - TriStream DAG Layer 1 blockchain with BLAKE3/KAWPOW/ZK-STARK consensus

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages