Core blockchain node implementation for the PYRAX TriStream DAG Layer 1 blockchain.
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)
- 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
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
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 |
The chain automatically detects contract type based on bytecode:
- WASM: Bytecode starting with
\0asmmagic bytes - EVM: All other bytecode
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
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 |
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)
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 |
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 |
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
- Rust 1.85.0-nightly or later
- RocksDB
- OpenSSL
cargo build --release
# 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
MIT License - see LICENSE for details.