← Home 📜 FAQ

POSITRONIC

Next-Generation AI-Validated Layer-1 Blockchain

TECHNICAL WHITEPAPER v4.0 — MARCH 2026

"The World's First AI-Validated Blockchain using Proof of Neural Consensus"

6,848 Tests 223 Source Modules 32 Phases Complete Chain ID: 420420 SHA-512
Chapter 1

Executive Summary

Positronic (ASF) is the world's first Layer-1 blockchain that embeds artificial intelligence directly into its consensus mechanism. Unlike projects that merely deploy AI as decentralized applications on top of existing chains, ASF integrates four specialized neural network models into the block validation pipeline itself, creating a novel consensus paradigm called Proof of Neural Consensus (PoNC).

The Positronic blockchain combines the security guarantees of Delegated Proof of Stake (DPoS) with real-time AI transaction scoring, enabling the network to detect and quarantine fraudulent transactions, MEV attacks, smart contract exploits, and economic instabilities before they are committed to the chain. This proactive defense model represents a fundamental departure from traditional blockchains that rely solely on cryptographic and economic incentives.

ASF is a Coin, not a Token. Positronic is an independent Layer-1 blockchain with its own consensus mechanism (DPoS + PoNC), virtual machine (PositronicVM), P2P network, and genesis block. ASF is the native coin of this blockchain — like BTC is to Bitcoin or ETH is to Ethereum. Tokens (PRC-20, PRC-721) can be created on top of the Positronic blockchain by developers and users, but ASF itself is the base-layer coin that powers the entire network.
Why “Positronic” & “ASF”? The name Positronic is a tribute to Isaac Asimov (1920–1992), the visionary science-fiction author who first imagined the positronic brain — an artificial mind capable of ethical reasoning, governed by the Three Laws of Robotics. Our ticker symbol ASF stands for Asimov (ASimov → ASF), honouring the man whose work foresaw the very fusion of artificial intelligence and human trust that this blockchain delivers. Just as Asimov envisioned machines that protect humanity by design, Positronic embeds AI directly into its consensus layer — not as an afterthought, but as the core guardian of every transaction.

Key Innovations

InnovationDescription
Proof of Neural Consensus4 AI models (TAD, MSAD, SCRA, ESG) score every transaction in real-time
Bitcoin-Style Tokenomics1B supply, 24 ASF block reward, yearly halving, 20% fee burn, zero pre-mine
TRUST Soulbound TokenNon-transferable reputation system with 5 levels and mining multipliers
Gasless TransactionsPaymaster system allowing sponsors to pay gas on behalf of users
Smart WalletAccount abstraction with session keys, social recovery, spending limits
Game Bridge PlatformExternal games connect to ASF via SDK for Play-to-Mine rewards and on-chain assets
AI AgentsAutonomous on-chain agents with identity, permissions, and trust scoring
Hash Commitment PrivacySHA-512 hash commitments for balance, ownership, and membership verification
Cross-Chain AbstractionCross-chain abstraction layer with hash anchoring interface (external connectivity planned)
DePINPhysical device registration for decentralized infrastructure mining
Post-Quantum SecurityCRYSTALS-Dilithium dual signatures alongside Ed25519
Decentralized IdentityW3C-compatible DID system with verifiable credentials
EIP-1559 Gas OracleAdaptive base fee pricing with priority lanes (SYSTEM, FAST, STANDARD, HEAVY)
HD Wallet (BIP-32/44)Hierarchical deterministic key derivation with mnemonic recovery
Compact Block RelayHeader + TX hashes propagation for 90%+ bandwidth savings
Network Partition DetectionAutomatic detection and graceful recovery from network splits
VM v2 PrecompilesBase64, JSON Parse, and Batch Ed25519 Verify native contracts

Key Metrics

MetricValue
Total Supply1,000,000,000 ASF
Block Reward24 ASF (halving yearly)
Block Time~12 seconds (Ethereum-aligned)
Hash AlgorithmSHA-512 (512-bit)
ValidatorsUnlimited (21 producers/epoch, weighted-random)
Chain ID420420
RPC Methods213
Test Coverage6,848 tests (173 test files)
Source Modules223
Phases Completed31 / 31
Chapter 2

Core Architecture

The Positronic blockchain is built as an account-based state machine (similar to Ethereum) with SHA-512 cryptographic hashing, providing 512-bit security output compared to Bitcoin's SHA-256. The architecture prioritizes modularity, allowing each subsystem (AI validation, consensus, token management, identity) to operate independently while integrating seamlessly through the core blockchain orchestrator.

2.1 SHA-512 Hashing

ASF employs SHA-512 as its primary hashing algorithm, providing 256-bit collision resistance and 512-bit preimage resistance. This choice offers several advantages over the SHA-256 used by Bitcoin and most other blockchains:

PropertySHA-256SHA-512 (ASF)
Output Size256 bits (32 bytes)512 bits (64 bytes)
Collision Resistance128 bits256 bits
Quantum Resistance~128 bits (Grover)~256 bits (Grover)
64-bit CPU PerformanceSlower (32-bit ops)Faster (native 64-bit ops)
Block Size512 bits1024 bits
Why SHA-512? Modern CPUs are 64-bit architectures. SHA-512 uses 64-bit arithmetic internally, making it actually faster than SHA-256 on modern hardware while providing significantly stronger security margins against future quantum computing attacks.

2.2 Block Structure

Each block in the ASF chain contains a header with metadata and a list of validated transactions:

Block Header: parent_hash : bytes[64] # SHA-512 of parent block state_root : bytes[64] # Merkle root of state trie tx_root : bytes[64] # Merkle root of transactions timestamp : int # Unix timestamp height : int # Block number miner : bytes[20] # Validator address ai_score : float # Aggregate AI risk score nonce : int # Block nonce difficulty : int # Network difficulty Block Body: transactions[] : Transaction[] # Ordered list

2.3 Transaction Types

TypeIDDescription
TRANSFER0Native ASF coin transfer
CONTRACT_CREATE1Deploy new smart contract
CONTRACT_CALL2Call smart contract method
STAKE3Delegate stake to validator
UNSTAKE4Undelegate from validator
EVIDENCE5Submit forensic evidence on-chain
REWARD6Block reward (system-generated)
AI_TREASURY7AI treasury allocation (system-generated)
GAME_REWARD8Play-to-Mine game reward (system-generated)
TOKEN_CREATE9Create PRC-20 token
TOKEN_TRANSFER10Transfer custom token
NFT_MINT11Mint PRC-721 NFT
NFT_TRANSFER12Transfer NFT

2.4 Architecture Overview

Users RPC Layer 121 Methods AI Validation Gate (PoNC) TAD|MSAD|SCRA|ESG Mempool DPoS Consensus 21 Producers/Epoch BFT Finality Quarantine Pool New Block ASF Transaction Flow Architecture

2.5 State Model

ASF uses an account-based state model where each account maintains a balance, nonce, optional contract code, storage, and a TRUST reputation score. The global state is organized as a Merkle Patricia Trie, enabling efficient state proofs for light clients and cross-chain verification.

Chapter 3

Proof of Neural Consensus (PoNC)

Proof of Neural Consensus is ASF's signature innovation: a consensus mechanism that augments traditional DPoS with a multi-model AI ensemble that scores every transaction for risk before it enters the block. This creates a proactive defense layer that can detect and quarantine malicious activity in real-time, something no existing blockchain offers at the consensus level.

3.1 The Four AI Models

The PoNC ensemble consists of four specialized neural network models, each targeting a different class of threats:

ModelFull NameArchitectureWeightTarget Threats
TADTransaction Anomaly DetectorAutoencoder + VAE (bootstrap-trained)30%Unusual transaction patterns, outliers
MSADMEV & Sandwich Attack DetectorTemporal Convolutional Network25%Front-running, sandwich attacks, MEV extraction
SCRASmart Contract Risk AnalyzerGraph Neural Network25%Malicious contracts, reentrancy, exploits
ESGEconomic Stability GuardianLSTM Time Series20%Flash loans, market manipulation, instability

3.2 Tiered Scoring System

To optimize performance without sacrificing security, PoNC uses a tiered scoring approach. Not every transaction needs all four models:

TierModels UsedCriteriaLatency
LightTAD onlySmall value + trusted sender (reputation > 0.9, nonce > 50)~5ms
MediumTAD + ESGModerate value or new sender~15ms
FullAll 4 modelsLarge value, contract calls, risky patterns~50ms

3.3 Decision Thresholds

The weighted ensemble produces a composite risk score, immediately quantized to integer basis points (0–10,000). Classification uses integer comparison with a ±50bp dead zone for cross-platform determinism (see §3.6):

Integer Score (bp)Float EquivalentDecisionAction
< 8,450< 0.845ACCEPTEDTransaction proceeds to mempool normally
8,450 — 9,5490.845 — 0.955QUARANTINEDHeld for manual/validator review
≥ 9,550≥ 0.955REJECTEDTransaction refused, sender flagged

3.4 Dynamic Adjustments

After quantization to integer basis points, the score is adjusted using integer-only arithmetic (_apply_adjustments_q) to maintain cross-platform determinism:

3.5 Safety Mechanisms

AI Kill Switch: If the false positive rate exceeds 5% or AI scoring latency exceeds the maximum threshold, the AI gate automatically disables and all transactions are auto-accepted. This ensures that AI failures never halt the network.

3.6 Cold Start Calibration

New networks face a cold start problem: freshly trained AI models lack sufficient data to distinguish unusual-but-legitimate transactions from actual anomalies, causing excessive false positives. The ColdStartManager solves this with a three-phase graduated threshold system based on block height:

PhaseBlock RangeModeBehavior
A0 – 100,000LearningScore every TX but quarantine none; kill switch disabled; collect false positive data
B100,001 – 500,000CalibrationThresholds tighten linearly toward production; kill switch at 0.5% FP rate (10× stricter); quarantine enabled with 2× review timeout
C500,001+ProductionFull thresholds (accept 8,500 bp, quarantine 9,500 bp); kill switch at 5% FP rate; online learning enabled

False positive reports are rate-limited (10 per hour per reporter) to prevent manipulation. Phase B thresholds interpolate linearly so the network gradually transitions from permissive to strict without sudden behavioral changes.

3.7 Deterministic Scoring

A critical requirement for consensus is that all validator nodes must produce identical AI classification decisions for the same transaction, regardless of hardware (Intel, AMD, ARM). Two problems must be solved: random seed consistency and floating-point divergence.

3.7.1 Seed Determinism

All random operations within the neural models are seeded identically via DeterministicContext(seed=AI_CONSENSUS_SEED). This ensures model weight initialization and stochastic operations produce the same values on every node.

3.7.2 Integer Basis-Point Scoring (IEEE 754 Mitigation)

IEEE 754 floating-point arithmetic is not deterministic across CPU architectures. The same multiply-accumulate sequence can produce different results on Intel (x87/SSE) vs AMD vs ARM due to different rounding modes, FMA fusion, and intermediate precision. For example, one node might compute a score of 0.8499 (ACCEPT) while another computes 0.8501 (QUARANTINE) — a consensus fork.

To eliminate this, ASF converts all AI scores to integer basis points (0–10,000) immediately after the ensemble weighted average, and all subsequent comparisons use integer arithmetic only:

ParameterFloat ValueInteger (Basis Points)
Score Scale0.0 – 1.00 – 10,000
Accept Threshold0.858,500
Quarantine Threshold0.959,500
Dead Zone±0.005±50 bp

Quantization formula: score_q = min(int(float_score * 10000 + 0.5), 10000)

3.7.3 Dead Zone Classification

Even after quantization, two nodes might produce scores that differ by 1 basis point due to intermediate float rounding before quantization. The dead zone of ±50 basis points around each threshold ensures these borderline cases are always classified conservatively:

ConditionClassification
score_q < accept_q - 50 (i.e. < 8,450)ACCEPTED
score_q ≥ reject_q + 50 (i.e. ≥ 9,550)REJECTED
Everything in betweenQUARANTINED (safe default)
Why this works: Integer addition, subtraction, and comparison are bitwise identical on all CPU architectures. The only float operation is the initial score * 10000 quantization, where a ±1 basis point error is absorbed by the 50bp dead zone — a 50x safety margin. Reputation adjustments (_apply_adjustments_q) also use integer-only arithmetic: adjusted = score_q * 80 // 100 instead of score *= 0.8.
PoNC Integer Scoring Flow TX In TierSelection AI Ensemble TAD (30%) | MSAD (25%) SCRA (25%) | ESG (20%) quantize_score(float) Integer: 0 - 10,000 bp Dead Zone ACCEPT< 8,450 bp QUARANTINE 8,450 - 9,549 bp REJECT ≥ 9,550 bp
Chapter 4

DPoS Consensus Engine

After transactions pass the AI validation gate, they enter the DPoS consensus layer where a set of elected validators propose and finalize blocks. ASF's DPoS implementation features Byzantine Fault Tolerant (BFT) finality, slot-based block production, and a comprehensive slashing mechanism to discourage misbehavior.

4.1 Consensus Parameters

ParameterValueDescription
MAX_VALIDATORS10,000 (soft cap)All eligible validators active; 21 block producers per epoch (weighted-random)
SLOTS_PER_EPOCH32Number of block slots per epoch
BLOCK_TIME~12 secondsTarget block production interval (Ethereum-aligned)
FINALITY_THRESHOLD2/3 supermajorityRequired attestations for BFT finality

4.2 Core Components

ComponentResponsibility
SlotClockWall-clock timing, epoch/slot derivation
ValidatorRegistryValidator data, status tracking, metrics
ValidatorElectionAll-eligible election, 21 weighted-random proposers per epoch
AttestationTrackerTracks validator votes on blocks, pro-rata reward distribution
StakingManagerSelf-bonding, delegation, unbonding, reward distribution
FinalityTrackerAttestation accumulation, BFT finality determination
SlashingManagerDouble-sign detection, downtime penalties, jailing

4.3 Validator Lifecycle

Validators go through a defined lifecycle: Register (32 ASF minimum stake) → Activated (all eligible validators join the active set) → Propose & Attest (21 producers selected by weighted-random per epoch; all active validators attest on blocks for pro-rata rewards) → Miss/Double-Sign (penalties triggered) → Jailed (temporarily excluded) → Unjail (re-enter election after timeout).

4.4 Epoch Transitions

At each epoch boundary, the system derives a new epoch seed from the previous block hash, runs a validator election that activates ALL eligible validators (no top-N cap), selects 21 block producers via stake-weighted random, processes pending unjail requests, and resets the finality tracker. Epoch-0 uses a deterministic genesis seed.

4.5 Slashing & Penalties

OffensePenaltyAdditional
Double-Sign33% stake slashed36-epoch jail + exponential backoff; permanent ban after 3 events
Extended Downtime33% stake slashed16 consecutive missed blocks triggers slash + jail
Invalid Block ProposalBlock rejectedTrust score reduced

4.6 Fee Distribution (Consensus v2 — Three-Layer)

RecipientShare
Block Producer25%
Attesters (pro-rata by stake)25%
Node Operators / Community Pool20%
AI Treasury (DAO)10%
Burn (Deflationary, remainder)20%
Chapter 5

Bitcoin-Style Tokenomics

ASF adopts a Bitcoin-inspired economic model with a fixed total supply, mining-based distribution, predictable halving schedule, and zero founder pre-mine. This design ensures fair distribution while creating sustainable deflationary pressure through fee burning.

5.1 Supply Distribution

ASF Coin Distribution (1B Total) Mining 50% Play 20% AI 15% Team 5% Security 5% Community 5% 500M Mining 200M Play 150M AI 50M Community 50M Team
AllocationAmountPercentageMechanism
Node Mining500,000,000 ASF50%Block rewards (must be mined)
Play-to-Mine200,000,000 ASF20%Gameplay rewards
AI Treasury150,000,000 ASF15%DAO-governed, 5% max annual unlock
Community50,000,000 ASF5%Faucet & airdrops
Team50,000,000 ASF5%4-year vesting (1/48 per month)
Security Fund50,000,000 ASF5%Bug bounties & emergency
Founder Pre-mine0 ASF0%No pre-mine!
Genesis Lock: At genesis, only 300M ASF are created (locked in treasury, community, team, security). The remaining 700M (mining + play) must be earned through proof of work and gameplay.

5.2 Block Reward & Halving Schedule

The initial block reward is 24 ASF, halving approximately once per year (~2.6 million blocks at 12-second intervals). The 12-second block time (aligned with Ethereum) creates a controlled emission schedule that makes ASF significantly scarcer than fast-block chains, driving long-term value through supply discipline.

YearBlock RewardApprox. Annual EmissionCumulative Mined
Year 124 ASF~63M ASF~63M
Year 212 ASF~31.5M ASF~94.5M
Year 36 ASF~15.75M ASF~110.25M
Year 43 ASF~7.9M ASF~118.15M
Year 51.5 ASF~3.9M ASF~122M
Year 6+< 1 ASFDiminishing→ 500M cap
Mining Hard Cap: When total mined reaches 500,000,000 ASF → block reward = 0

5.3 Fee Burn Mechanism

20% of all transaction fees are permanently burned (calculated as the remainder after other shares to prevent rounding dust loss), reducing the circulating supply over time. This creates sustained deflationary pressure, especially as network usage grows. The remaining fees are distributed to block producers (25%), attesters pro-rata by stake (25%), node operators / community pool (20%), and AI treasury (10%).

Chapter 6

TRUST — Soulbound Reputation Token

TRUST is ASF's non-transferable reputation token, permanently bound to each address. Unlike transferable tokens, TRUST cannot be bought, sold, or moved between accounts. It must be earned through consistent positive behavior on the network and can be lost through malicious activity. This creates a genuine meritocratic system where reputation directly impacts mining rewards.

6.1 Trust Levels

LevelScore RangeMining MultiplierBenefits
🌱 NEWCOMER0 — 991.0xBasic access
👤 MEMBER100 — 4991.1xGasless TX eligible
⭐ TRUSTED500 — 1,9991.3xLight AI tier (faster TX)
👑 VETERAN2,000 — 9,9991.6xPriority mempool
🏆 LEGEND10,000+2.0xDouble mining rewards

6.2 Score Rewards

ActionPoints
Block mined+1
Game completed+1
DAO vote cast+2
Token created+3
NFT created+2
Consistent uptime (per epoch)+1

6.3 Score Penalties

OffensePoints
Suspicious transaction-20
Quarantined transaction-10
False evidence submission-100
Validator slashed-50
Spam detected-5

6.4 Inactivity Decay

To prevent abandoned accounts from retaining high trust scores indefinitely, a decay mechanism reduces the score by 1 point per 30 days of inactivity. The score floor is 0 and cannot go negative. This ensures that only actively participating members maintain their reputation benefits.

Effective Mining Reward = Base Block Reward × Trust Multiplier

For example, a LEGEND-level miner with a 2.0x multiplier earns 48 ASF per block in Year 1 (instead of the standard 24 ASF), creating a strong incentive for long-term positive participation.

Chapter 7

Token Standards: PRC-20 & PRC-721

ASF provides native token standards that allow anyone to create fungible tokens (PRC-20) and non-fungible tokens (PRC-721) directly on the blockchain. These standards are modeled after Ethereum's ERC-20 and ERC-721 but include ASF-specific enhancements such as AI verification for NFTs.

7.1 PRC-20: Fungible Token Standard

PRC-20 is the standard for creating custom fungible tokens on the Positronic blockchain. Each token contract tracks balances, allowances, and supply metrics.

FunctionDescription
transfer(to, amount)Transfer tokens to an address
approve(spender, amount)Authorize a spender to use tokens
transferFrom(from, to, amount)Spend on behalf of approved owner
mint(to, amount)Create new tokens (owner only)
burn(amount)Permanently destroy tokens

State Tracking: balances (per address), allowances (owner-spender pairs), total_supply, decimals (configurable), holder_count, transfer_count, total_burned.

7.2 PRC-721: Non-Fungible Token Standard

PRC-721 extends the traditional NFT standard with two unique features: dynamic metadata (NFTs whose properties can evolve over time) and AI verification (each NFT receives an authenticity score from the AI validation system).

FunctionDescription
mint(to, metadata)Create new NFT with metadata (name, description, image_uri, attributes)
transfer(from, to, token_id)Transfer NFT ownership
approve(to, token_id)Approve address to manage NFT
set_approval_for_all(operator, approved)Approve operator for all NFTs
burn(token_id)Permanently destroy NFT
update_metadata(token_id, new_metadata)Update dynamic NFT properties

AI Verification

Each PRC-721 NFT includes an ai_verified boolean and an ai_score (0.0 to 1.0). The AI system analyzes NFT metadata and associated content to detect plagiarism, verify originality, and assess quality. This provides buyers with an objective authenticity measure directly on-chain.

Dynamic NFTs

When the dynamic flag is set during minting, the NFT's metadata can be updated over time. This enables evolving game characters, real-time data NFTs, and progressive artwork that changes based on on-chain events.

7.3 Token Registry

All created tokens and NFT collections are registered in the global TokenRegistry, providing a unified catalog for discovery, search, and verification. Token creation incurs a fee that is burned, preventing spam.

Chapter 8

Gasless Transactions (Paymaster System)

One of the biggest barriers to blockchain adoption is the requirement for new users to acquire native tokens before they can perform any action. ASF solves this with its Paymaster System, which allows sponsors (such as game developers, dApp operators, or enterprises) to pay transaction fees on behalf of their users.

8.1 How It Works

A Paymaster is an on-chain entity that pre-deposits ASF coins into a sponsorship pool. When a user submits a transaction that qualifies for sponsorship, the gas fee is deducted from the Paymaster's balance instead of the user's account. This enables zero-friction onboarding for new users.

8.2 PaymasterConfig

ParameterDefaultDescription
max_gas_per_tx100,000Maximum gas units per sponsored transaction
daily_limit1,000,000Total daily gas budget
daily_used0Cumulative gas used (resets every 24h)
allowed_recipients[] (all)Whitelist of allowed recipient addresses
activetrueEnable/disable sponsorship

8.3 Anti-Spam Protection

Minimum TRUST Score: Users must have a TRUST score of at least 10 (MIN_TRUST_FOR_GASLESS) to use gasless transactions. This prevents newly created accounts from abusing the sponsorship system.

Additional protections include per-transaction gas limits, daily aggregate limits, and the ability for Paymasters to restrict sponsorship to specific contract addresses.

8.4 24-Hour Reset

The daily_used counter automatically resets to zero after 86,400 seconds (24 hours), ensuring that the daily budget refreshes for the next day.

Chapter 9

Smart Wallet & Account Abstraction

ASF's Smart Wallet system implements account abstraction, providing users with programmable wallets that support temporary session keys, social recovery, daily spending limits, and emergency locking — all without requiring users to manage seed phrases.

9.1 Session Keys

Session keys are temporary cryptographic keys with limited permissions and automatic expiration. They are ideal for gaming sessions where a user wants to authorize game actions without approving each transaction individually.

PropertyDescription
expires_atAutomatic expiration timestamp
permissionsAllowed transaction types (e.g., GAME_REWARD only)
max_value_per_txMaximum value per transaction
total_spentCumulative spending tracker

9.2 Social Recovery

Instead of seed phrases, Smart Wallets use a guardian-based recovery system. Users designate trusted addresses as recovery guardians and set a threshold (default: 2). If access is lost, the required number of guardians can collectively authorize wallet recovery to a new key.

9.3 Spending Limits

Each Smart Wallet can set a daily_spending_limit that restricts the total value that can be sent within a 24-hour period. The can_spend(amount) method validates against this limit before authorizing any transaction. Setting the limit to 0 disables the restriction.

9.4 Emergency Lock

The is_locked flag provides an emergency freeze mechanism. When activated, no outgoing transactions are permitted regardless of session keys or guardian approvals. Only the primary owner key can unlock the wallet.

Chapter 10

Game Bridge Platform

Positronic does not host games directly. Instead, it provides a Game Bridge SDK that allows external games — mobile, PC, console, or web — to connect to the ASF blockchain. Game developers integrate the SDK to enable Play-to-Mine rewards, on-chain assets (NFTs), and gasless transactions for their players.

10.1 Architecture

External Game ⟶ Game Bridge SDK (JS/Python) ⟶ ASF RPC ⟶ Blockchain

The game runs on the developer's own infrastructure. Only reward claims, asset ownership, and session proofs are recorded on-chain, keeping the blockchain lean while giving players real ownership of their in-game achievements.

10.2 SDK Features

FeatureDescription
Session ManagementCryptographic game sessions with start/end proofs recorded on-chain
Reward ClaimsPlayers earn ASF based on verified gameplay; rewards are minted via Play-to-Mine allocation
Custom Game TokensGames create their own PRC-20 tokens (up to 3 per game) for in-game economies
NFT IntegrationGames mint PRC-721 NFTs for in-game items, characters, or achievements (up to 5 collections per game)
Game-to-Token BridgeOrchestration layer connecting game sessions to token minting and reward distribution
Gasless PlayPaymaster sponsorship so players never pay gas fees during gameplay
Anti-Cheat VerificationAI validation scores game sessions; suspicious results are quarantined
SQLite PersistenceGame sessions, emissions, and token mappings persist across node restarts
LeaderboardsOn-chain leaderboards and player stats via RPC API
Game Ecosystem Fees100 ASF one-time registration fee per game; 5% emission tax on daily Play-to-Mine rewards directed to team wallet

10.3 Integration Flow

  1. Register Game: Developer registers their game on-chain (one-time fee: 100 ASF) and receives a Game ID and API key
  2. Create Game Economy: Game creates custom PRC-20 tokens and NFT collections via the Game Token Bridge
  3. Start Session: Player connects wallet; SDK creates a signed game session
  4. Play: Game runs on developer's servers; session key authorizes actions without per-TX approval
  5. Mint Items: Game mints NFTs to players for achievements, loot drops, or crafted items
  6. Submit Results: At session end, the game submits a score proof to the blockchain
  7. Claim Rewards: AI validates the session; if approved, ASF and custom token rewards are distributed to the player

10.4 Reward Calculation

Reward = base_reward × TRUST_multiplier × game_difficulty_factor

Each game defines its own base_reward and difficulty_factor. The player's TRUST score determines the multiplier (1.0x to 2.0x). ASF rewards draw from the 200M ASF Play-to-Mine allocation. A 5% emission tax is applied to daily Play-to-Mine emissions and directed to the team wallet to fund ongoing development. Games can also distribute their own custom PRC-20 tokens as additional rewards. All rewards are subject to AI anti-cheat verification and 4-layer emission control (global → per-game → per-player → per-session).

10.5 Available SDKs

SDKLanguageKey Classes
positronic-game-sdkPythonPositronicGameSDK, GameSession, GameTokenBridge
@positronic/game-bridgeJavaScript/TypeScriptPositronicGameBridge, GameSession, GameTokenBridge
positronic-telegramJavaScript (Telegram)PositronicTelegram, GameSession

10.6 Game Token Bridge

The Game Token Bridge is an orchestration layer that allows registered games to create and manage their own on-chain economies:

CapabilityLimitDescription
Custom PRC-20 Tokens3 per gameGames create fungible tokens for in-game currency, points, or rewards
NFT Collections5 per gameGames create PRC-721 collections for items, characters, achievements
Token Distribution1s cooldownGames distribute custom tokens to players as rewards
NFT Minting1s cooldownGames mint NFT items with dynamic metadata to players
On-chain SettlementEvery 100 blocksPending rewards are flushed to blockchain state periodically
Open Platform: Any game developer can integrate with Positronic. Register your game, create custom tokens and NFT collections, and your players start earning immediately. 24 RPC methods, 3 SDK languages, full SQLite persistence.
Chapter 11

AI Agents On-Chain

ASF provides a native framework for registering and managing autonomous AI agents on the blockchain. Each agent has a unique identity, defined permissions, and a trust score that evolves based on its performance history.

11.1 Agent Types

TypeIDPurpose
VALIDATOR0Transaction validation assistance
TRADING1Automated trading strategies
GAME2Game AI & NPC behavior
ANALYTICS3Data analysis & insights
GOVERNANCE4DAO voting & proposal management

11.2 Agent Identity & Trust

Each agent receives a unique agent_id derived from SHA-256 hashing. The agent's trust score starts at 0 and adjusts based on actions: +1 per successful action, -5 per failure. The success rate is calculated as executed / (executed + failed).

11.3 Permission System

Agents operate within a defined permission set that specifies which actions they are allowed to perform. Owners can pause, resume, or ban their agents at any time. The action history (last 50 actions) is logged with timestamps, data hashes, and success/failure status for full auditability.

11.4 Agent Status Lifecycle

ACTIVE (0) → can execute actions  |  PAUSED (1) → temporarily suspended  |  BANNED (2) → permanently disabled

Chapter 12

Privacy & Commitment System

ASF's privacy system uses hash commitments and Schnorr sigma protocols to allow users to prove statements about their data without revealing the underlying information. This is critical for financial privacy, identity verification, and confidential evidence handling in legal proceedings.

Implementation Note: The current implementation uses SHA-512 hash commitments for balance/ownership/membership proofs, and a Schnorr-like sigma protocol over the Curve25519 field prime (2255 − 19) for enhanced verification. These provide computational hiding but are not full zero-knowledge proofs in the cryptographic sense (no elliptic curve ZK-SNARKs/STARKs). The term “ZK” in internal API names (e.g., getZKStats) is retained for backward compatibility.

12.1 Supported Proof Types

Proof TypeProvesReveals
prove_balance_aboveAccount balance exceeds threshold XNothing (not even exact balance)
prove_ownershipOwnership of a specific assetNothing about the owner's identity
prove_membershipMembership in a specific groupNothing about which member

12.2 Cryptographic Protocol

ASF uses a SHA-512-based commitment scheme (simplified for efficiency):

Commitment = H(data || secret)
Challenge = H(commitment || public_input)
Response = H(difference || secret || challenge)

12.3 ZKProof Structure

FieldTypeDescription
proof_typestring"balance_above", "ownership", "membership"
commitmentbytesBlinded commitment (SHA-512 hash)
challengebytesVerifier challenge
responsebytesProver's response
public_inputdictPublic parameters (threshold, asset_id, group_hash)
verifiedboolVerification result

12.4 Confidential Evidence

The hash commitment system integrates with ASF's forensic evidence system through ConfidentialEvidence, which combines encrypted evidence data with a hash commitment proof of authenticity. Only authorized viewers (e.g., judges, investigators) can decrypt the content, while the proof ensures that the evidence has not been tampered with.

Chapter 13

Cross-Chain Bridge

ASF's cross-chain bridge enables interoperability with major blockchain networks through hash anchoring — posting ASF state hashes onto external chains for additional security guarantees, and verifying proofs from external chains on ASF.

Implementation Note: The bridge currently provides a cross-chain abstraction layer with hash anchoring interfaces. Live connectivity to Ethereum, Bitcoin, Polygon, and BSC networks requires external relayer deployment (not yet operational).

13.1 Supported Chains

ChainIDUse Case
Ethereum0Evidence anchoring, DeFi bridges
Bitcoin1Immutability anchoring
Polygon2Low-cost anchoring
BSC3High-throughput bridge

13.2 Hash Anchoring

Critical ASF data (evidence hashes, state roots, checkpoint hashes) can be anchored on external chains. The AnchoredHash structure tracks the anchor lifecycle:

FieldDescription
anchor_idUnique anchor identifier
source_hashOriginal hash from ASF chain
target_chainDestination network
target_tx_hashTransaction hash on external chain
statusPENDING (0) → CONFIRMED (1) or FAILED (2)
block_heightASF block height reference

13.3 External Proof Verification

Proofs submitted from external chains are verified on ASF through the submit_external_proof and verify_external_proof functions, enabling trustless cross-chain state verification.

Chapter 14

DePIN — Decentralized Physical Infrastructure

DePIN (Decentralized Physical Infrastructure Networks) allows real-world hardware devices to register on the Positronic blockchain, submit data, and earn rewards for their contributions. This bridges the gap between the physical world and the blockchain.

14.1 Device Types

TypeIDUse Case
CAMERA0Security cameras providing evidence footage
SENSOR1IoT sensors for environmental data
GPU2GPU compute for AI training
STORAGE3Decentralized storage nodes
NETWORK4Network relay and connectivity devices

14.2 Device Lifecycle

REGISTERED (0) → ACTIVE (1) → OFFLINE (2) or BANNED (3)

Devices must send a heartbeat() at least every 10 minutes to remain active. The heartbeat also transitions newly registered devices to ACTIVE status.

14.3 Data Submission & Rewards

Active devices call submit_data(data_hash) to submit evidence of their work. Each valid submission earns 1 reward unit. The DePIN registry tracks cumulative stats per device: uptime_hours, data_submitted, and rewards_earned.

14.4 Location Tracking

Each device registers with geographic coordinates (latitude/longitude), enabling location-based queries and regional infrastructure mapping.

Chapter 15

Post-Quantum Cryptography

Quantum computers pose an existential threat to the elliptic curve cryptography (Ed25519, ECDSA) that secures nearly all blockchains today. ASF proactively addresses this through a dual-signature system that pairs traditional Ed25519 signatures with quantum-resistant CRYSTALS-Dilithium2 signatures.

15.1 The Quantum Threat

Shor's algorithm, when run on a sufficiently large quantum computer, can break the discrete logarithm problem underlying Ed25519 and ECDSA in polynomial time. While large-scale quantum computers do not yet exist, the blockchain's immutable record means that transactions signed today could be forged by quantum computers in the future ("harvest now, decrypt later" attacks).

15.2 CRYSTALS-Dilithium2

ASF implements real CRYSTALS-Dilithium2 (ML-DSA-44, FIPS 204) via the pqcrypto library, which wraps the NIST-standardized reference C implementation. The lattice-based signature scheme provides NIST Level 2 (~128-bit) post-quantum security using Module-LWE / Module-SIS hardness assumptions.

PropertyEd25519 (Current)ML-DSA-44 (Post-Quantum)
Public Key Size32 bytes1,312 bytes
Secret Key Size64 bytes2,560 bytes
Signature Size64 bytes2,420 bytes
Security Level~128-bit classical~128-bit quantum (NIST Level 2)
Quantum Resistant❌ No✅ Yes (FIPS 204)
Librarycryptography (PyCA)pqcrypto (reference C impl)

15.3 Dual Signature System

The DualSignature structure carries both an Ed25519 signature and a post-quantum signature. The is_quantum_safe property returns true when the PQ signature is present.

Migration Path: Post-quantum signatures are optional today. Users can register a PQ public key through the PostQuantumManager and begin dual-signing transactions. When quantum computers become a real threat, the network can mandate PQ signatures through a governance vote, enabling a smooth migration without a hard fork.

15.4 Key Management

The PostQuantumManager maintains a registry of PQ public keys mapped to addresses. Functions include: register_pq_key, has_pq_key, get_pq_key, and verify_dual_signature.

Chapter 16

Decentralized Identity (DID)

ASF implements a W3C-compatible Decentralized Identifier (DID) system that gives users self-sovereign identity on the blockchain. Users can create identities, issue verifiable credentials, and manage their digital presence without relying on centralized identity providers.

16.1 DID Format

did:asf:0x{address_hex}

Each DID is derived from the user's blockchain address and follows the W3C DID specification.

16.2 Verifiable Credentials

FieldTypeDescription
credential_idstringUnique credential identifier
issuerDIDDID of the credential issuer
subjectDIDDID of the credential holder
claim_typestring"education", "employment", "certification", etc.
claim_datadictFlexible JSON claim payload
issued_attimestampIssuance time
expires_attimestampExpiration (0 = never expires)
revokedboolRevocation status

16.3 DID Operations

OperationDescription
create_identityCreate new DID with public key
issue_credentialIssue verifiable credential to subject
verify_credentialVerify credential validity (not revoked, not expired)
revoke_credentialRevoke a previously issued credential
deactivate_identityPermanently deactivate a DID
add_serviceAdd service endpoint (e.g., messaging, storage)

16.4 Use Cases

Chapter 17

Neural Immune System

Beyond the AI Validation Gate, ASF operates a Neural Immune System that provides continuous, real-time threat monitoring and automated response. This system acts as the blockchain's immune defense, identifying and neutralizing threats before they can cause damage.

17.1 Threat Detection

The Neural Immune System monitors for multiple categories of threats: Sybil attacks (fake identity proliferation), DDoS patterns (transaction flooding), spam transactions, double-spend attempts, and economic manipulation.

17.2 AI Rank System

Neural Validator Nodes (NVN) earn military-style ranks based on their performance through the AIRankManager. Higher ranks receive greater fee shares and voting power in AI model governance decisions.

17.3 Quarantine Pool & Appeal

Transactions flagged by the AI gate (integer score 8,500–9,499 bp; see §3.6) are placed in the quarantine pool. Two release paths exist:

  1. Automatic re-evaluation — every QUARANTINE_REVIEW_INTERVAL (100 blocks) the AI gate rescores each quarantined TX. If the score drops below 8,500 bp, the TX is released into the mempool.
  2. Governance appeal — any staker can vote on a quarantined TX via vote_appeal(tx_hash, vote_for, voter_id). A supermajority (>2:1 for/against) releases the TX immediately.

Transactions not released within MAX_QUARANTINE_TIME (1,000 blocks) expire and are discarded. Users may file an appeal with a deposit of IMMUNE_APPEAL_DEPOSIT (10 ASF), refunded on successful appeal.

ParameterValue
Review interval100 blocks
Max quarantine1,000 blocks
Appeal deposit10 ASF
Appeal threshold>2:1 supermajority

17.4 Automated Response

When persistent threats are detected, the system can automatically ban offending addresses, increase AI scrutiny levels for related transactions, alert the validator set, and trigger emergency governance proposals if the threat is systemic.

17.5 Token Governance (DAO)

Before any new token can be deployed on the Positronic network, it must pass through a dual-gate governance process: first an AI risk assessment, then a council vote. This prevents scam tokens, rug-pulls, and low-quality projects from launching on the network.

Governance Flow:

Submit Proposal → AI Review (risk < 0.7?) → Council Vote (60%+?) → Deploy
ParameterValue
AI Risk Threshold< 0.7 to pass (higher = riskier)
Council Approval60% supermajority required
Minimum Votes3 council members
Proposal TypesTOKEN_CREATION, TOKEN_MODIFICATION, AI_MODEL_UPDATE, PARAMETER_CHANGE, EMERGENCY_ACTION
Proposal StatusesSUBMITTED → AI_REVIEWING → AI_APPROVED → COUNCIL_VOTING → APPROVED → DEPLOYED

17.6 AI Model Governance

Changes to the AI validation models (weights, thresholds, versions) are governed through an on-chain supermajority vote. This includes a kill switch for emergency situations and treasury spending control.

ParameterStandard ProposalsTreasury Spending
Approval Threshold66% supermajority75% supermajority
Quorum Requirement10% of stakers20% of stakers
Voting Period1,000 blocks (~50 min)1,000 blocks (~50 min)
Max Single SpendN/A10,000,000 ASF (5% of treasury)

Model Governance Proposal Types:

TypeDescriptionExample
MODEL_UPDATEDeploy a new AI model versionUpgrade TAD from v1.0 to v2.0
WEIGHT_CHANGEAdjust model component weightsIncrease MSAD weight from 25% to 30%
KILL_SWITCHEnable/disable AI validationDisable AI gate during emergency
THRESHOLD_CHANGEChange accept/quarantine thresholdsLower quarantine threshold to 0.80
TREASURY_SPENDSpend from AI treasuryFund external security audit
Security Note: Treasury spending proposals have stricter requirements (75% approval, 20% quorum) than standard proposals (66% approval, 10% quorum), and each single spend is capped at 10M ASF to prevent treasury drain attacks.
Chapter 18

Compliance & Forensic Evidence System

Positronic includes a built-in compliance and forensic evidence system purpose-built for legal admissibility. Every on-chain event can be collected, verified, cryptographically signed, anchored to immutable storage, and exported as a court-ready document — making Positronic the first blockchain designed from the ground up to produce evidence packages that meet the evidentiary standards of modern legal proceedings.

18.1 Wallet Registry & Traceability

The WalletRegistry provides AI-verified address tracking for compliance. Unlike traditional KYC systems, wallet verification is performed by the network’s AI engine, which analyzes on-chain behavior, source type, and historical patterns to assign a trust score. Users retain pseudonymous usage by default; identity association is opt-in and requires user consent.

Wallet Status Lifecycle

UNREGISTERED → PENDINGREGISTEREDFLAGGEDSUSPENDEDBLACKLISTED
StatusDescriptionPermissions
UNREGISTEREDUnknown wallet, no verification submittedRestricted — basic transfers only
PENDINGRegistration submitted, awaiting AI verificationRestricted — same as unregistered
REGISTEREDAI-verified, full access grantedFull — all transaction types
FLAGGEDSuspicious activity detected by AIReduced — large transfers require additional review
SUSPENDEDTemporarily frozen pending investigationNone — all transactions blocked
BLACKLISTEDPermanently banned from the networkNone — permanently blocked

Wallet Trust Tiers

Each registered wallet is assigned a trust tier based on AI analysis of on-chain history, transaction volume, and behavior patterns. Tiers determine transaction limits and access levels:

TierRequirementsTransaction Limits
BASICNewly registered, limited historyStandard limits
VERIFIEDEstablished transaction history, no flagsElevated limits
TRUSTEDLong-term good behavior, high AI trust scoreHigh limits
INSTITUTIONALExchange or institutional wallet, verified sourceInstitutional-grade limits

The AI trust score is a continuous value from 0.0 to 1.0, computed from wallet age, transaction patterns, flagged count, and source type (wallet app, exchange, contract, etc.). Tier promotion and demotion are automatic based on this score.

18.2 Forensic Reporter

The ForensicReporter generates detailed, structured forensic reports for legal and regulatory use. Each report collects on-chain evidence items, computes findings, and produces a tamper-proof document sealed with Ed25519 digital signatures and SHA-512 cryptographic hashing.

Report Types

TypeDescriptionUse Case
TRANSACTION_TRACEFull trace of a single transaction through the networkFraud investigation, dispute resolution
WALLET_HISTORYComplete activity history of a wallet addressAccount auditing, tax compliance
FUND_FLOWTrack flow of funds between multiple addressesMoney laundering detection, asset tracing
SUSPICIOUS_ACTIVITYSAR (Suspicious Activity Report) with AI risk assessmentAML/CFT compliance, regulatory reporting
COMPLIANCE_AUDITFull compliance audit of an address or entityRegulatory examination, due diligence
INCIDENT_REPORTSecurity incident documentation with timelineBreach response, post-mortem analysis

Evidence Collection

Each piece of forensic evidence (ForensicEvidence) contains the following verified fields:

FieldDescription
evidence_typeCategory of evidence (transaction, state change, event, etc.)
timestampExact UNIX timestamp of the on-chain event
block_heightBlock number where the event was recorded
tx_hashTransaction hash for verification against the blockchain
descriptionHuman-readable description of the evidence
dataStructured payload containing event-specific details

Digital Signatures & Tamper Detection

Every forensic report is cryptographically sealed using a three-step integrity process:

Report Content → SHA-512 HashEd25519 SignatureBlockchain Anchor

The SHA-512 hash covers all report fields (report ID, type, creation timestamp, subject address, evidence list, findings, and risk score). The Ed25519 signature binds the hash to the signer’s public key. Anyone can verify the report signature using the signer’s public key without needing access to the original data — providing non-repudiation and tamper detection suitable for court proceedings.

18.3 Court Evidence Pipeline

The CourtReportGenerator transforms forensic reports into complete, court-ready evidence packages. The pipeline follows a five-stage process designed for legal admissibility:

1. Collect2. Verify3. Anchor4. Cross-Anchor5. Report
StageOperationOutput
1. CollectGather relevant on-chain data (transactions, state changes, events)ForensicEvidence items
2. VerifyAI validation of evidence integrity; Ed25519 signature verificationSigned ForensicReport
3. AnchorSHA-512 hash of report anchored on the Positronic chainOn-chain hash record
4. Cross-AnchorHash anchored on Ethereum and/or Bitcoin for additional immutabilityCross-chain proof
5. ReportGenerate court-ready document with exhibits and chain of custodyCourtReport package

Evidence Exhibits

Each EvidenceExhibit in a court report includes the forensic evidence, a Merkle proof linking the evidence to the block’s state root, and block finality data proving the block has been finalized by the consensus mechanism. This provides cryptographic proof that the evidence existed on-chain at a specific point in time and has not been altered since.

Chain of Custody

Every court report includes a digital Chain of Custody record — an immutable, timestamped log that tracks every action taken on the evidence from creation to delivery:

FieldDescription
created_atTimestamp when the custody record was initiated
created_byIdentity of the entity that created the record
blockchain_heightBlock height at the time of creation
report_hashSHA-512 hash of the associated report
entries[]Timestamped log entries (action, actor, details) for every custody event
Legal Note: The chain of custody satisfies the authentication requirements of Federal Rules of Evidence (FRE) Rule 901(b)(9) for digital evidence. Each entry is timestamped, actor-identified, and hash-linked to the prior state, providing an unbroken custody chain from evidence collection through court presentation.

18.4 Confidential Evidence

When combined with the Hash Commitment Privacy system, evidence can be encrypted and stored with hash commitments of authenticity. The ConfidentialEvidence mechanism stores:

ComponentDescription
encrypted_dataAES-256 encrypted evidence payload
commitment_proofHash commitment verifying that the encrypted data matches the original evidence hash
authorized_viewersList of public keys authorized to decrypt and view the evidence

Only authorized viewers (judges, investigators, regulators) can access the decrypted content using their private keys. The hash commitment ensures that anyone — including unauthorized parties — can verify that the evidence has not been altered, without seeing the evidence itself. This enables privacy-preserving legal compliance: sensitive data remains encrypted while its integrity is publicly verifiable.

18.5 Legal Admissibility & Compliance

Positronic’s evidence system is designed to meet the evidentiary requirements of multiple legal frameworks. The following integrity chain ensures that every piece of evidence can withstand legal scrutiny:

Evidence → SHA-512 HashEd25519 SignatureOn-Chain AnchorCross-Chain AnchorCourt Report
Legal RequirementHow Positronic Satisfies It
Authentication (FRE 901)Ed25519 digital signature by known signer + SHA-512 hash verification
Integrity / Tamper-proofingSHA-512 hash anchored on-chain; any modification breaks the hash chain
Chain of CustodyImmutable, timestamped custody log with actor identification at every step
TimestampingBlock height + UNIX timestamp; cross-anchored on Ethereum/Bitcoin for independent verification
Non-repudiationEd25519 signature binds the report to the signer’s identity; cannot be denied
ConfidentialityZK-encrypted evidence with authorized-viewer access control

GDPR & Privacy Compliance

Blockchain immutability and GDPR’s right to erasure present a fundamental tension. Positronic resolves this through the Confidential Evidence mechanism: personal data is never stored in plaintext on-chain. Instead, encrypted evidence can have its decryption keys revoked, making the on-chain data effectively inaccessible while preserving the integrity proof. This satisfies the “right to be forgotten” without compromising the evidence chain.

Law Enforcement & Regulatory Access

Authorized entities (law enforcement, regulators, court-appointed investigators) can request evidence through the RPC API endpoints described in Section 18.6. All access is logged in the chain of custody, and confidential evidence requires the requester’s public key to be in the authorized viewers list — ensuring that access control is cryptographically enforced rather than policy-based.

18.6 RPC API for Legal Access

Positronic exposes five dedicated JSON-RPC endpoints for forensic and legal operations. These endpoints enable authorized tools and interfaces to interact with the compliance system programmatically:

EndpointDescriptionParameters
positronic_getForensicStatsRetrieve forensic system statistics (total reports, active investigations)None
positronic_getForensicReportRetrieve a forensic report by its unique ID[report_id]
positronic_generateCourtReportGenerate a court-ready evidence report from a forensic report[report_id, case_reference?]
positronic_getEvidencePackageGet the complete evidence package (exhibits, custody chain, signatures)[court_report_id]
positronic_verifyEvidenceVerify evidence integrity against blockchain anchors[court_report_id]
Access Control: All forensic and court RPC endpoints require authentication. Evidence generation and retrieval are logged in the chain of custody. Confidential evidence endpoints additionally require the caller’s public key to be in the authorized viewers list for the requested evidence.
Chapter 19

GOD CHAIN — Phase 17

Phase 17 represents the culmination of the ASF protocol design: a mega-phase that combines four enhancement pillars into a single cohesive upgrade. Named GOD CHAIN, this phase embodies the project's core philosophy: no transaction is ever rejected because of infrastructure failures, no user is ever unhappy. Every new feature follows a fail-open design — if any component fails, the old behavior continues silently.

19.1 Pillar 1: Transaction Pipeline Optimization

EIP-1559 Adaptive Gas Oracle

ASF now implements an Ethereum-style EIP-1559 gas pricing mechanism with bounded adaptive base fees. The base fee adjusts up or down by a maximum of 12.5% per block based on utilization. The fee is clamped to a range of [1, 1000] to prevent extreme pricing.

ParameterValueDescription
Base Fee Floor1Minimum base fee (always affordable)
Base Fee Ceiling1,000Maximum base fee (bounded)
Change Denominator8Max ±12.5% change per block
Fee History Size256Blocks of fee history stored
Fail-Open: If the gas oracle encounters any error, it returns a default base fee of 1. Transactions are never rejected due to gas pricing failures.

Transaction Priority Lanes

Transactions are automatically classified into four priority lanes for optimal ordering within blocks:

LanePriorityTypesDescription
SYSTEMHighestREWARD, AI_TREASURYAlways processed first
FASTHighTRANSFER (≤42k gas)Simple transfers, quick settlement
STANDARDNormalAll other TXsContract calls, default lane
HEAVYLowCREATE (≥500k gas)Resource-intensive operations

Parallel Transaction Validation

Transaction validation (signature verification, nonce checking, balance checking) is now parallelized using a thread pool of 4 workers. Execution remains sequential to preserve state consistency. If the thread pool fails, validation falls back to the original sequential approach.

19.2 Pillar 2: Network Resilience

Compact Block Relay

Block propagation is optimized by transmitting only the block header and ordered transaction hashes. Receiving peers reconstruct the full block from their local mempool. System transactions (rewards, AI treasury) are prefilled since peers won't have them. If reconstruction fails, the peer requests a full block.

Bandwidth Savings ≈ 1 − (prefilled_ratio) − 0.05 ≈ 90%+ for typical blocks

Multi-Dimensional Peer Scoring

Each peer is evaluated across five weighted dimensions to optimize connection quality:

DimensionWeightDescription
Latency20%Response time consistency
Reliability25%Uptime and message delivery rate
Bandwidth15%Data transfer capacity
Chain Sync25%How close the peer is to chain tip
Behavior15%Protocol compliance and honesty

Scores gradually decay toward neutral (50) over time with a decay rate of 0.99, preventing permanently biased scoring from temporary network issues.

Network Partition Detection

The partition detector monitors three signals: block arrival timeout (3× BLOCK_TIME without new blocks), peer count drops (below 3 peers), and chain height divergence (peers report heights 10+ blocks ahead). The detector transitions through four states:

StateMeaningRecovery Action
HEALTHYNormal operationNone needed
DEGRADEDWarning signals detectedMonitoring intensified
PARTITIONEDConfirmed network splitAggressive peer discovery
RECOVERINGRecovery in progressStatus requests to all peers
Safety Guarantee: The partition detector never drops blocks, modifies chain state, disconnects peers, or rejects connections. All recovery actions are non-destructive. If detection logic fails, the node assumes HEALTHY.

Prometheus Monitoring

Every node exposes a GET /metrics endpoint on the RPC port (default 8545) in Prometheus text exposition format. A background MetricsCollector polls blockchain height, peer count, mempool size, AI scoring stats, and consensus participation every 5 seconds. Pre-defined gauges and counters include:

MetricTypeDescription
positronic_chain_heightgaugeCurrent blockchain height
positronic_peers_connectedgaugeNumber of connected peers
positronic_mempool_sizegaugePending transactions in mempool
positronic_ai_total_scoredcounterTotal transactions scored by AI
positronic_validators_activegaugeNumber of active validators
positronic_health_statusgaugeOverall health (0=healthy, 4=down)

19.3 Pillar 3: Smart Contract VM v2

New Precompiled Contracts

Three new native precompiles extend the VM's capabilities:

AddressNameGas CostDescription
0x05BASE6430 + 5/wordEncode/decode Base64 data
0x06JSON_PARSE100 + 10/wordParse JSON string, extract field by name
0x07BATCH_VERIFY2,000/sigBatch Ed25519 signature verification (discounted)

VM Simulation

The VM.simulate() method enables state-free execution for eth_call and eth_estimateGas. It takes a state snapshot before execution, runs the transaction fully, and always reverts the state afterward. This allows accurate gas estimation and dry-run queries without any side effects.

Revert Reason Decoder

When smart contracts revert, the decoder extracts human-readable error messages from the revert data. Supported formats include Error(string) (Solidity custom errors), Panic(uint256) (11 mapped panic codes), and raw hex fallback for unknown error selectors.

19.4 Pillar 4: HD Wallet & Enhanced CLI

Hierarchical Deterministic Wallet (BIP-32/44)

ASF now supports hierarchical deterministic key derivation using HMAC-SHA512 for deterministic address generation from a single mnemonic seed phrase:

Derivation Path: m / 44' / 420420' / account' / 0 / index
FeatureSpecification
Mnemonic12 or 24 words (BIP-39 compatible word list)
Seed DerivationPBKDF2-SHA512 (2048 rounds)
Key DerivationHMAC-SHA512 chain code splitting
Coin Type420420 (ASF Chain ID)
Max Accounts100
Max Addresses1,000 per account
FallbackRandom key generation if HD derivation fails

Transaction History & Address Book

Two new wallet modules provide user-friendly account management:

10 New RPC Methods

MethodDescription
positronic_getGasOracleCurrent gas pricing with base fee and priority fee tiers
positronic_getFeeHistoryHistorical fee data for last N blocks
positronic_getTxLaneStatsTransaction lane distribution statistics
positronic_getCompactBlockStatsCompact block relay performance metrics
positronic_getPartitionStatusNetwork partition health and signal data
positronic_getPeerScoresMulti-dimensional peer scoring breakdown
positronic_getRevertReasonDecode revert data to human-readable message
positronic_hdCreateWalletCreate HD wallet with mnemonic seed phrase
positronic_hdDeriveAddressDerive new address from HD wallet
positronic_getAddressHistoryTransaction history for a specific address
Phase 17 Summary: 9 new files, 10 modified files, 103 new tests, 10 new RPC methods. Full project: 6,848 tests across 173 test files, 223 source modules, comprehensive coverage of all subsystems including chain validation, VM, state, Merkle proofs, AI detectors, network, compliance, staking, slashing, cross-chain, HD wallet, Consensus v2 Three-Layer, RPC stress, and end-to-end scenarios. Every feature follows the fail-open principle — if it breaks, the old behavior continues silently.
Chapter 20

RPC API Reference

ASF exposes 213 RPC methods organized across 30+ categories. The API is fully compatible with Ethereum's JSON-RPC specification for standard operations, while providing extensive Positronic-specific methods for advanced features.

19.1 Method Categories

CategoryNamespaceCountKey Methods
Ethereum Compatibleeth_*13chainId, blockNumber, getBalance, sendRawTransaction
Networknet_*1version
Positronic Corepositronic_*6getAIScore, getAIStats, getQuarantinePool, nodeInfo, getNetworkHealth, formatDenomination
Wallet Registrypositronic_*3getWalletInfo, getWalletStats, isWalletRegistered
AI Rankpositronic_*2getAIRank, getAIRankStats
Node Rankingpositronic_*3getNodeRank, getNodeLeaderboard, getNodeStats
Neural Immunepositronic_*2getImmuneStatus, getRecentThreats
Token Governancepositronic_*3getGovernanceStats, getPendingProposals, getProposal
Forensic Reportspositronic_*2getForensicStats, getForensicReport
Play-to-Earnpositronic_*4getGameStats, getPlayerProfile, getGameLeaderboard, submitGameResult
Play-to-Minepositronic_*3getPromotionStatus, optInAutoPromotion, getPlayToMineStats
Health Monitorpositronic_*1getHealthReport
SPV / Light Clientpositronic_*2getMerkleProof, verifyMerkleProof
Checkpointspositronic_*3getCheckpoint, getLatestCheckpoint, getCheckpointStats
Multisigpositronic_*2getMultisigWallet, getMultisigStats
Faucetpositronic_*2faucetDrip, getFaucetStats
Court Evidencepositronic_*3generateCourtReport, getEvidencePackage, verifyEvidence
TRUST Tokenpositronic_*4getTrustScore, getTrustProfile, getTrustLeaderboard, getTrustStats
PRC-20 Tokenspositronic_*4createToken, getTokenInfo, getTokenBalance, listTokens
PRC-721 NFTspositronic_*6createNFTCollection, getNFTCollection, getNFTMetadata, getNFTsOfOwner, listCollections, getTokenRegistryStats
Gasless (Paymaster)positronic_*3registerPaymaster, getPaymasterInfo, getPaymasterStats
Smart Walletpositronic_*3createSmartWallet, getSmartWallet, getSmartWalletStats
Game Bridgepositronic_*12startGameSession, getGameSessionState, getGameBridgeStats, gameCreateToken, gameCreateCollection, gameMintItem, gameDistributeReward, getGameTokens, getGameCollections, getGameTokenBridgeStats, tokenMint, mintNFT
AI Agentspositronic_*4registerAgent, getAgentInfo, getAgentsByOwner, getAgentStats
Hash Commitment Privacypositronic_*1getZKStats
Cross-Chainpositronic_*2getBridgeStats, getAnchor
DePINpositronic_*3registerDevice, getDeviceInfo, getDePINStats
Post-Quantumpositronic_*2getPQStats, hasPQKey
DIDpositronic_*3createIdentity, getIdentity, getDIDStats
Security (Phase 15)positronic_*3sessionHeartbeat, emergencyPauseSession, getGameSecurityStats
Total: 213 RPC Methods — 199 Positronic-specific + 13 Ethereum-compatible + 1 Network. The table above highlights key categories; additional methods include staking, emergency controls, HD wallet, gas oracle, Telegram, governance voting, on-chain game state, immune appeals, treasury, peer scoring, compact blocks, and attestation.

19.2 Connection Details

ParameterValue
RPC URLhttps://rpc.positronic-ai.network
Chain ID420420
SymbolASF
ProtocolJSON-RPC 2.0
TransportHTTP/HTTPS, WebSocket

19.3 Example Calls

Get AI Score for a Transaction:

// Request
curl -X POST https://rpc.positronic-ai.network \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "positronic_getAIScore",
    "params": ["0xa1b2c3d4e5f6..."],
    "id": 1
  }'

// Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tx_hash": "0xa1b2c3d4e5f6...",
    "composite_score": 0.23,
    "verdict": "ACCEPT",
    "models": {
      "TAD": 0.18, "MSAD": 0.31,
      "SCRA": 0.22, "ESG": 0.19
    }
  }
}

Get TRUST Score:

// Request
curl -X POST https://rpc.positronic-ai.network \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "positronic_getTrustScore",
    "params": ["0x742d35Cc6634..."],
    "id": 2
  }'

// Response
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "address": "0x742d35Cc6634...",
    "score": 2450,
    "level": "VETERAN",
    "multiplier": 1.6
  }
}

Get Balance (Ethereum-compatible):

// Request
curl -X POST https://rpc.positronic-ai.network \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getBalance",
    "params": ["0x742d35Cc6634...", "latest"],
    "id": 3
  }'

// Response
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": "0x56bc75e2d63100000"
}

Register DePIN Device:

// Request
curl -X POST https://rpc.positronic-ai.network \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "positronic_registerDevice",
    "params": [{
      "owner": "0x742d35Cc6634...",
      "device_type": "gpu",
      "capabilities": {"tflops": 12.5},
      "location": "US-WEST"
    }],
    "id": 4
  }'

// Response
{
  "jsonrpc": "2.0",
  "id": 4,
  "result": {
    "device_id": "DEV-1708612345-0001",
    "status": "REGISTERED",
    "rewards_eligible": true
  }
}
Chapter 21

Competitor Comparison

The following table compares ASF's capabilities against leading blockchain platforms:

Feature ASF Ethereum Bitcoin Solana NEAR
ConsensusPoNC (AI+DPoS)PoSPoWPoH+PoSPoS (Nightshade)
AI in Consensus✅ 4 Models
Block Time~12s~12s~10min~0.4s~1s
Hash AlgorithmSHA-512Keccak-256SHA-256dSHA-256SHA-256
Soulbound Token✅ TRUST
Gasless TX✅ Paymaster❌ (EIP-4337)
Game Bridge✅ SDK + Play-to-Mine
AI Agents✅ Native
Hash Commitment Privacy✅ Built-in❌ (L2 only)
Post-Quantum✅ Dual-sig
DID✅ W3C
Cross-Chain⚠️ Interface complete — external relayers in deployment (Q3 2026)✅ Wormhole✅ Rainbow
DePIN✅ Native
Court Evidence✅ Forensic
Account Abstraction✅ Native✅ EIP-4337✅ Named Accounts
EIP-1559 Gas✅ Adaptive✅ EIP-1559
HD Wallet✅ BIP-32/44✅ BIP-32
Compact Blocks✅ Native✅ BIP-152
Key Differentiator: ASF is the only blockchain that embeds AI directly into the consensus mechanism. While other projects use AI as applications running on top of a blockchain, ASF's AI is integral to block validation itself.
Chapter 22

v0.2.0: Advanced Phases (19–24)

Version 0.2.0 upgrades six placeholder modules into fully functional, cryptographically sound implementations. Post-quantum signatures use the pqcrypto library wrapping the NIST-standardized reference C implementation of FIPS 204 (ML-DSA-44).

22.1 Phase 19: Real Post-Quantum Cryptography

Implements real CRYSTALS-Dilithium2 (ML-DSA-44, FIPS 204) via the pqcrypto library. The lattice-based signature scheme provides NIST Level 2 (~128-bit) post-quantum security using Module-LWE / Module-SIS hardness assumptions. Hybrid dual signatures combine Ed25519 (classical) + ML-DSA-44 (post-quantum) so that both must be broken to forge a transaction.

ParameterValue
AlgorithmML-DSA-44 (FIPS 204, CRYSTALS-Dilithium2) via pqcrypto library
Key sizesPK: 1,312B, SK: 2,560B, Sig: 2,420B
Security levelNIST Level 2 (~128-bit post-quantum)
PerformanceSign: 1,126 ops/sec, Verify: 5,820 ops/sec
Signing modeRandomized (hedged nonce per FIPS 204)
Soundness tests29 tests (keygen, sign, verify, tamper, bitflip, forge, large msg, dual sig)

22.2 Phase 20: Cross-Chain Bridge v2 (Lock/Mint)

Implements actual token transfers between ASF and external chains via a lock-on-source / mint-on-target pattern with relayer quorum and fraud proofs.

ParameterValue
Quorum3-of-5 relayer confirmations
Bridge fee0.3% (30 basis points)
Challenge period24 hours
Min lock1 ASF
FlowLock → Confirm → Mint → Burn → Release
New RPC methods6 (bridgeLock, bridgeConfirmLock, bridgeMint, bridgeBurn, bridgeRelease, bridgeGetStatus)

22.3 Phase 21: AI Explainability (XAI)

Every AI validation decision now produces a human-readable explanation containing per-model contribution breakdowns, top risk signals, and cross-model attention correlations. Explanations are bounded to 500 characters.

Example output: Risk 0.42 (ACCEPTED). TAD:0.35(30%), MSAD:0.55(25%), SCRA:0.30(25%), ESG:0.50(20%). Top signal: MSAD(MEV) at 0.55.

22.4 Phase 22: DePIN Economic Layer

Replaces the flat “1 unit per submission” reward with a three-dimensional scoring formula multiplied by device-type tiers.

ComponentWeightDescription
Uptime40%Hours active / hours since registration
Data Quality40%Verified submissions / total submissions
Freshness20%Linear decay from 1.0 to 0.0 over 60 min
Device TypeMultiplier
GPU5x
Storage3x
Sensor / Camera2x
Network1x

Daily cap: 100 reward units per device to prevent gaming.

22.5 Phase 23: Autonomous AI Agents

Upgrades agents from record-keeping to enforced execution with three layers of protection:

Autonomous tick() executes per-block actions for eligible agents (minimum trust score: 10). Banned agents cannot be resumed (permanent kill switch).

22.6 Phase 24: Enhanced Hash Commitment Privacy

Upgrades the hash commitment system with proper Schnorr-like response verification. The commitment now embeds a verification tag (64 bytes = 32 core + 32 tag) that binds the response cryptographically. Modular arithmetic over the Curve25519 field prime (2255 − 19).

ParameterValue
Prime field2255 − 19 (Curve25519)
Range bits64
Merkle depth16
VerificationConstant-time via hmac.compare_digest
Soundness tests12 new (tampered response, forged proof, Merkle paths)

22.7 Phase 32: Deep AI Integration

Phase 32 extends the AI subsystem with four modules that deepen model coordination and observability: (1) Online Learning Extension for continuous improvement in production, (2) Model Communication Bus for cross-model signal sharing, (3) Causal XAI v2 for permutation-based explainability, and (4) Concept Drift Detection for monitoring score distribution shifts. Full details in Chapter 31 (Neural Self-Preservation).

22.8 Test Coverage

Version 0.2.0 and subsequent phases add 525+ new tests, bringing the total to 6,848 passing tests across 173 test files.

Chapter 23

Emergency Control System

The Positronic Emergency Control System provides protocol-level safeguards for responding to security incidents, coordinating network upgrades, and gracefully handling critical failures. It operates as a state machine governing block production and transaction acceptance, ensuring the network can be paused, halted, or upgraded without data loss or chain corruption.

23.1 Network State Machine

The network operates in one of five states, each controlling which operations are permitted. Transitions are authenticated via Ed25519 signatures and recorded in an immutable event log.

StateCodeBlock ProductionTransactionsRPC
NORMAL0✅ Yes✅ YesFull access
DEGRADED1✅ Yes⚠ LimitedFull access
PAUSED2❌ No❌ NoRead-only
HALTED3❌ No❌ NoEmergency-only
UPGRADING4❌ No❌ NoRead-only
NORMALDEGRADEDPAUSEDNORMAL
NORMALHALTED (multi-sig) → NORMAL (multi-sig)
NORMALUPGRADINGNORMAL

23.2 Authorization Levels

Different state transitions require different levels of authorization, ensuring that more dangerous operations require stronger consensus.

ActionAuthorizationTimelock
Pause Network3-of-5 Multi-Sig0 seconds (immediate)
Resume from Pause3-of-5 Multi-Sig1 hour
Emergency Halt3-of-5 Multi-Sig0 seconds (immediate)
Resume from Halt3-of-5 Multi-Sig1 hour
Rollback Upgrade3-of-5 Multi-Sig6 hours
Approve Upgrade3-of-5 Multi-Sig24 hours
Key Rotation3-of-5 Multi-Sig48 hours
Auto-Degrade/PauseHealthMonitor (automatic)None (automatic)

23.3 Multi-Signature Manager (3-of-5)

Critical operations such as emergency halts, rollbacks, and key rotations require 3-of-5 Ed25519 multi-signature authorization. Five keys are registered at genesis; any three must sign a canonical message to authorize an action.

Signing Protocol: Each signer signs a canonical message constructed as action_id:action_type:SHA256(sorted_params_json), preventing replay attacks and ensuring each signer explicitly approves the specific action and parameters.

The multi-sig lifecycle follows four stages:

1. CREATE — Proposer creates action + auto-signs
2. SIGN — Additional signers add Ed25519 signatures
3. READY — 3+ signatures collected, timelock countdown begins
4. EXECUTE — Action executed after timelock expires

23.4 Upgrade Manager

Protocol upgrades are managed through a feature flag system with block-based activation and automatic rollback. This allows the network to evolve without hard forks causing chain splits.

ParameterValueDescription
Min Activation Delay1,000 blocksMinimum blocks before upgrade activates
Monitor Window100 blocksPost-activation error monitoring period
Rollback Threshold5%Error rate triggering auto-rollback
Peer CompatibilityFeature-basedPeers must support all active features

When an upgrade is scheduled, feature flags are registered in a SCHEDULED state. At the activation block, features transition to ACTIVE. If the error rate exceeds 5% within 100 blocks, the system recommends auto-rollback, deactivating all features in the upgrade.

23.5 Health Monitor Integration

The Emergency Controller integrates with the network's HealthMonitor for automatic state transitions. When health metrics deteriorate, the system automatically degrades or pauses without human intervention:

Health EventAutomatic ActionRecovery
Degraded metricsNORMAL → DEGRADEDAutomatic when health recovers
Critical failureNORMAL/DEGRADED → PAUSEDManual (3-of-5 multi-sig required)
Health recoveredDEGRADED → NORMALAutomatic
Safety Guarantee: Automatic recovery only applies to DEGRADED state. PAUSED and HALTED states always require manual intervention (3-of-5 multi-sig for both) to prevent premature resumption during active security incidents.

23.6 RPC Emergency Methods

MethodAccessDescription
positronic_emergencyPauseADMINPause network (3-of-5 multi-sig required)
positronic_emergencyResumeADMINResume from paused state
positronic_emergencyHaltADMINEmergency halt (multi-sig required)
positronic_emergencyStatusPUBLICQuery current network state
positronic_upgradeScheduleADMINSchedule protocol upgrade
positronic_upgradeStatusPUBLICQuery upgrade status

23.7 Test Coverage

The Emergency Control System includes 57 tests covering all state transitions, multi-sig authorization, upgrade lifecycle, node integration, and RPC methods. Combined with the existing test suite, the project maintains 6,848 passing tests.

Chapter 24

Production Hardening & Mainnet Readiness

Before a blockchain can launch on mainnet, the protocol must withstand adversarial chain reorganizations, protect data at rest, handle schema evolution gracefully, and rate-limit public endpoints against abuse. This chapter documents the four production-hardening subsystems added in Phase 26, along with the comprehensive test suites that verify their correctness under stress.

24.1 Chain Reorganization Engine (ForkManager)

The ForkManager detects and resolves competing chain tips without manual intervention. When a peer broadcasts a block whose parent is not the current tip, the ForkManager stores it as a ForkCandidate object and evaluates whether the alternative chain is longer. If so, the node rewinds to the common ancestor and replays the longer chain — provided the reorg does not cross a finalized height.

Fork detection is integrated directly into blockchain.add_block(), executing before block validation so that invalid blocks on competing forks are never persisted. Old fork candidates are automatically pruned once their height falls below the finality horizon.

ParameterValueDescription
max_fork_depth100 blocksMaximum reorg depth the engine will consider
Finalized-height guardEnabledReorgs past finalized blocks are rejected
Auto-pruneBelow finalityFork candidates below finality height are discarded
Longest-chain ruleHeight-basedTies broken by lowest block hash (deterministic)
Integration pointadd_block()Fork check runs before block validation
Safety Guarantee: The finality guard ensures that blocks confirmed by the consensus layer (e.g., after 2/3 validator attestation) can never be reverted by a longer competing chain. This provides the same settlement finality guarantees as BFT-style protocols while retaining Nakamoto-style simplicity for non-finalized blocks.

24.2 Database Encryption at Rest

All SQLite database files are encrypted using AES-256-GCM authenticated encryption. The encryption key is derived from a user-supplied passphrase via PBKDF2-HMAC-SHA512 with 100,000 iterations, producing a 256-bit key that is never stored on disk.

The encryption layer is transparent to callers: the database is decrypted into memory on open and re-encrypted atomically on close using a temporary file with os.replace(). This ensures that a crash during write never corrupts the encrypted file.

ParameterValue
CipherAES-256-GCM (authenticated)
Key DerivationPBKDF2-HMAC-SHA512, 100,000 iterations
Nonce12-byte random per encryption
Fallback cipherXOR + HMAC-SHA256 (when cryptography library unavailable)
Atomic writestemp file + os.replace()
WAL/SHM cleanupAutomatic after encryption (prevents plaintext leakage)
WAL/SHM Cleanup: SQLite's Write-Ahead Log (WAL) and shared-memory (SHM) files can contain plaintext data even when the main database is encrypted. The encryption layer explicitly deletes these files after each encryption pass to prevent data leakage.

24.3 Schema Migration System

The schema migration system tracks database versions and applies incremental migrations automatically on node startup. Each migration is idempotent — wrapped in try/except so that re-running a migration on an already-migrated database is a safe no-op.

Schema v2 adds a metadata column to the blocks table, enabling future extensions without further migrations. All migration history is recorded in a schema_version table with timestamps for auditability.

ParameterValue
Current schema versionv2
Migration strategyIdempotent ALTER TABLE with try/except
History tableschema_version (version, applied_at, description)
Auto-migrate on startupEnabled
v2 changeAdds metadata column to blocks table

24.4 RPC Rate Limiting

All public RPC endpoints are protected by a sliding-window rate limiter that tracks request counts per IP address. When a client exceeds the configured limit, the server returns HTTP 429 Too Many Requests with a Retry-After header.

Admin endpoints (those requiring authentication) are exempt from rate limiting, ensuring that node operators can always manage their infrastructure regardless of public traffic load.

ParameterValue
AlgorithmSliding window counter
TrackingPer-IP address
Default limitConfigurable (requests per window)
Exceeded responseHTTP 429 + Retry-After header
Admin exemptionAll authenticated admin endpoints

24.5 Production Hardening Test Suites

Five dedicated test suites validate every production-hardening subsystem under both normal and adversarial conditions. Together they add 76 new tests, bringing the project total to 6,848 passing tests across 173 test files.

Test SuiteTestsCoverage
Property-Based Invariant Testing (hypothesis)23Blockchain invariants, state consistency, transaction ordering
Database Resilience17Corruption recovery, concurrent access, WAL checkpoint, encryption round-trip
Memory Leak Detection8Forensic reports, mempool cycling, wallet registry, game sessions, gc tracking
Chain Reorganization16Fork storage, longest-chain rule, finality guard, reorg state consistency
Upgrade & Migration12Schema versioning, feature flags, activation/rollback lifecycle
Total 76 6,848 passing tests across 173 test files

24.6 Test Infrastructure

The production-hardening test suites leverage several specialized testing tools to achieve deep coverage beyond what traditional unit tests can provide:

ToolPurpose
pytest-asyncioAsync node testing with event-loop integration
hypothesisProperty-based testing with configurable max_examples
psutilRSS memory measurement for leak detection
Dedicated port rangesParallel test isolation (no port conflicts between suites)
Continuous Integration: All production-hardening tests run in the CI pipeline on every commit. The hypothesis-based property tests use a fixed seed for reproducibility in CI while allowing unlimited exploration in local development.

24.7 Performance Benchmarks (TPS)

A dedicated 13-test benchmark suite (test_tps_benchmark.py) measures real throughput across every layer of the transaction pipeline. Results are asserted against minimum thresholds to catch performance regressions.

LayerThroughputNotes
AI Validation (full 4-model pipeline)~1,100 TX/secTAD + MSAD + SCRA + ESG ensemble
AI Validation (light tier, TAD only)~2,000+ TX/secLow-risk transfers skip heavy models
Mempool Ingestion~37,000 TX/secPriority-lane insertion + per-account limits
Block Creation (5 blocks x 50 TX)~570 TX/secAI gate + state execution + DB writes
End-to-End Pipeline~670 TX/secSign + AI + block + state + DB (full path)
Ed25519 Sign~11,000 ops/secStandard transaction signing
Ed25519 Verify~12,000 ops/secBlock validation signature checks
ML-DSA-44 Sign (post-quantum)~710 ops/secCRYSTALS-Dilithium2 via pqcrypto
ML-DSA-44 Verify (post-quantum)~4,000 ops/secPost-quantum signature verification
State: Account Creation~200,000+ ops/secIn-memory state manager
State: Balance Transfers~500,000+ ops/secSub/add balance operations
Bottleneck Analysis: The AI validation gate (~1,100 TX/sec) is the throughput bottleneck by design. With 12-second block times, this allows ~13,200 transactions per block. The tiered scoring system routes low-risk transfers through the light tier (~2,000+ TX/sec), effectively doubling throughput for routine activity.

24.8 Hardware Specifications for TPS Benchmarks

Hardware Tier CPU RAM Storage Expected TPS
Entry-Level 4-core ARM64 / x86_64 8 GB 256 GB SSD ~200-400 TX/s
Mid-Range 8-core x86_64 32 GB 1 TB NVMe ~600-800 TX/s
High-End 16+ core x86_64 64 GB 2 TB NVMe ~1,000-1,200 TX/s

Benchmarks performed using Python 3.10+ with NumPy acceleration. All figures measured in single-node local mode. Multi-node performance varies by network conditions. Formal third-party benchmark is in progress.

Chapter 25

Security Hardening v2 — Attack Surface Reduction

Version 0.2.3 implements 12 security fixes identified through a comprehensive internal security audit. The audit simulated real-world attack scenarios across all subsystems, resulting in 218 attack simulation tests across 4 dedicated test files.

25.1 Critical Fixes

VulnerabilityImpactFix
Commitment Forgery Attacker could forge hash commitments without knowing the secret Bind prover_id and proof_type into Fiat-Shamir challenge; prevents cross-type replay and identity-unbound forgery
Ed25519 Exception Masking Catch-all exception handler masked real errors, potentially accepting invalid signatures Specific exception types (ValueError, InvalidSignature) instead of bare Exception
Nothing-at-Stake 5% slash + 3-epoch jail made double-signing profitable for validators Increased to 33% slash + 36-epoch jail (~3.8 hours) + permanent ban after 3 events; exponential jail backoff for repeat offenders

25.2 High-Priority Fixes

FixModuleDescription
PQ Key Size Validationcrypto/post_quantum.pyMinimum 1,272-byte key size enforced for ML-DSA-44 public keys
Kill Switch Cooldownai/meta_model.py5-minute cooldown before AI can be re-enabled after kill switch activation
Quarantine Double-Votingai/quarantine.pyEach voter can only vote once per quarantined transaction
Multisig Cross-Chain Replaycrypto/multisig.pyChain ID bound into proposal hash prevents replay across chains
Batch Rate Limitingrpc/server.pyEach JSON-RPC batch item counted individually; MAX_BATCH_SIZE=20
CORS Exact Matchrpc/server.pyExact origin match only — no prefix matching that allowed subdomain spoofing
Admin Key Lockoutrpc/security.pyExponential backoff after 5 failed admin key attempts (60s, 120s, 240s...)
Mempool Fail-Closednetwork/mempool.pyAI gate errors reject transactions instead of auto-accepting
System TX Rejectionnetwork/mempool.pyREWARD/AI_TREASURY/GAME_REWARD transactions rejected at mempool entry
Negative Weight Guardai/meta_model.pyAI model weight updates reject negative values with ValueError

25.3 Attack Simulation Test Suite

A dedicated 218-test attack simulation suite probes every identified vulnerability from the perspective of a real attacker, organized into 26 attack classes across 4 files:

Test FileTestsAttack Categories
test_attack_crypto.py58ZK forgery, Ed25519 masking, key derivation, PQ key attacks, multisig replay, signature manipulation
test_attack_infrastructure.py55Bridge exploits, batch rate bypass, CORS spoofing, admin brute-force, mempool flooding, peer score manipulation
test_attack_consensus.py55Epoch seed grinding, nothing-at-stake profitability, fork attacks, finality busting, Sybil registration
test_attack_ai_governance.py50Kill switch oscillation, quarantine double-voting, AI gate bypass, Sybil flags, emergency system abuse
Total21826 attack classes across all subsystems
Defense-in-Depth: Each fix follows the principle of layered defense. For example, Nothing-at-Stake protection combines economic deterrence (33% slash), operational cost (36-epoch jail with exponential backoff), and permanent exclusion (ban after 3 events) to make double-signing unprofitable at any stake level.
Chapter 26

Development Roadmap

26.1 Completed Phases ✅

PhaseFeatureStatus
1Bitcoin-Style Tokenomics (1B supply, 24 ASF reward, halving)✅ Complete
2TRUST Soulbound Reputation Token (5 levels, multipliers)✅ Complete
3PRC-20 & PRC-721 Token Standards✅ Complete
4Gasless Transactions (Paymaster System)✅ Complete
5Smart Wallet & Account Abstraction✅ Complete
6Game Bridge Platform (External game integration via SDK)✅ Complete
7AI Agents On-Chain✅ Complete
8Hash Commitment Privacy✅ Complete
9Cross-Chain Bridge⚠️ Interface complete — external relayers in deployment (Q3 2026)
10DePIN (Decentralized Physical Infrastructure)✅ Complete
11Post-Quantum Cryptography (Dual Signatures)✅ Complete
12Decentralized Identity (DID)✅ Complete
13Website, Dashboard & Developer Tools✅ Complete
14Game Bridge SDK (External game integration, 24 RPC methods, game-to-token bridge)✅ Complete
15Security Hardening (AI kill-switch, SCRA v2, veto consensus)✅ Complete
16Evidence Portal & Compliance (Court-ready forensic tools)✅ Complete
17GOD CHAIN (EIP-1559 gas, TX lanes, compact blocks, HD wallet, VM v2)✅ Complete
18Telegram Mini App SDK (Play-to-Mine)✅ Complete
19Real Post-Quantum Cryptography (HMAC-based deterministic signatures)✅ Complete
20Cross-Chain Bridge v2 (Lock/Mint with relayer quorum)⚠️ Interface complete — external relayers in deployment (Q3 2026)
21AI Explainability (XAI: per-model breakdowns, attention correlations)✅ Complete
22DePIN Economic Layer (tiered rewards, device scoring, daily caps)✅ Complete
23Autonomous AI Agents (permissions, rate limits, spending caps)✅ Complete
24Enhanced Hash Commitment Privacy (Schnorr sigma protocol, Merkle proofs)✅ Complete
25Emergency Control System (state machine, 3-of-5 multi-sig, upgrade manager)✅ Complete
26Production Hardening (ForkManager, DB encryption, schema migration, test suites)✅ Complete
27Security Hardening v2 (12 fixes, 218 attack simulation tests, nothing-at-stake mitigation)✅ Complete
28Mainnet Readiness v0.3.0 (SHA-512 MPT, fork reorg with snapshot/rollback, BFT attestation broadcasting, NAT traversal, 150 new tests)✅ Complete

26.2 Future Roadmap 🔮

TimelineMilestone
Q2 2026Public Testnet Launch, Community Building, Ambassador Program
Q3 2026Independent Security Audits, Bug Bounty Program ($1M pool)
Q4 2026Mainnet Launch, Genesis Block, Token Generation Event
Q1 2027Mobile Wallet (iOS + Android), Hardware Wallet Integration
Q2 2027Decentralized Exchange (DEX), NFT Marketplace
Q3 2027Cross-Chain DEX, Lending/Borrowing Protocol
2028Full Quantum Migration, Enterprise Partnerships, Layer-2 Scaling
Chapter 27

v0.3.0: Mainnet Readiness — Phase 28

Version 0.3.0 delivers the final four infrastructure pillars required before public mainnet launch: a cryptographically sound state commitment scheme, a production-grade chain reorganization engine with full snapshot-and-rollback semantics, Byzantine Fault Tolerant attestation broadcasting over the P2P layer, and NAT traversal so residential validators behind home routers can participate without manual port-forwarding.

27.1 Merkle Patricia Trie (SHA-512 MPT)

The Merkle Patricia Trie replaces the ad-hoc state-root computation with a standards-compliant, cryptographically binding commitment. Each account balance, nonce, and storage slot is inserted into the trie; the resulting root hash is stored in every block header and is verified by light clients without downloading full state.

ParameterValueDescription
Hash functionSHA-512Collision-resistant 512-bit digests for all trie nodes
State root complexityO(1) per blockRoot is updated incrementally; no full recomputation
Light client proofsMerkle inclusion proofClients verify account state with O(log n) hashes
EncodingRLP-compatible key-valueEach leaf encodes address + field as path, value as leaf
Root storageBlock header fieldEvery sealed block commits to the post-execution state root
Light Client State Proofs: A light client needs only the block header (containing the state root) and a Merkle proof path to verify any account balance or storage value. This enables mobile wallets and browser extensions to operate trustlessly without syncing the full chain.

27.2 Fork Reorg Execution Engine

Building on the ForkManager introduced in Phase 26, the Fork Reorg Execution Engine adds full state snapshot-and-rollback semantics. Before replaying a competing chain, the engine takes a consistent snapshot of the current state; if the competing chain turns out to be invalid, the snapshot is atomically restored. A finality guard prevents any reorganization from reverting blocks that have already received 2/3 BFT attestation.

ParameterValueDescription
State snapshotCopy-on-write dictO(1) snapshot, O(modified) rollback
Rollback triggerInvalid block on forkEngine restores snapshot if fork replay fails validation
Finality guard2/3 supermajorityAttested blocks are irreversible; reorg rejected at finality boundary
Max reorg depth100 blocksInherited from ForkManager; deeper forks are rejected outright
State consistency checkPost-reorg assertionState root recomputed and compared after each reorg to detect divergence

27.3 BFT Attestation Broadcasting

Each validator signs a block hash with its Ed25519 key and broadcasts the attestation to all peers via the existing P2P gossip layer. Attestations are aggregated per-block; once a block accumulates signatures from more than 2/3 of the active validator set by stake weight, it is marked finalized and the finality height is advanced. Finalized blocks are permanently protected by the reorg finality guard.

ParameterValueDescription
Signature schemeEd25519Per-validator block-hash attestation
Finality threshold2/3 supermajority by stakeStake-weighted attestation count triggers finalization
Broadcast mechanismP2P gossip (existing layer)Attestation messages propagated to all connected peers
AggregationPer-block accumulatorAttestations collected in memory; deduplicated by validator address
Finality persistencefinality_height fieldConsensus state persists highest finalized block height
Safety Guarantee: The 2/3 supermajority threshold guarantees that no two conflicting blocks can both reach finality, as any two sets of 2/3 validators must share at least one honest validator (the Byzantine Generals intersection property). Combined with the reorg finality guard, this provides the same settlement assurances as Tendermint or Casper FFG.

27.4 NAT Traversal (UPnP / STUN)

Residential validators are typically behind NAT routers that block inbound connections. The NAT Traversal subsystem attempts UPnP port mapping first (automatic router configuration via the Universal Plug and Play protocol) and falls back to STUN hole-punching (RFC 5389) when UPnP is unavailable. Both methods are tried asynchronously on node startup; the discovered external address is advertised to peers so that inbound validator connections can be established.

MethodProtocolDescription
UPnP Port MappingUPnP IGDAutomatically requests inbound port from home router; works on most consumer routers
STUN DiscoveryRFC 5389 (UDP)Queries public STUN server to discover external IP and port; enables hole-punching
FallbackManual configOperator can override with static external IP if NAT traversal fails
Address advertisementP2P handshakeDiscovered external address included in peer hello message
Retry interval5 minutesNAT mapping refreshed periodically to prevent lease expiry

27.5 v0.3.0 Test Coverage

Phase 28 adds 150 new tests across 6 specialized suites, bringing the project total to 6,848 passing tests across 173 test files.

Test SuiteTestsCoverage
Merkle Patricia Trie (MPT)38Trie insert/lookup, state root computation, inclusion proofs, SHA-512 collision resistance, light client proof verification
Fork Reorg Execution20Snapshot creation, rollback on invalid fork, finality guard enforcement, state consistency post-reorg, deep fork rejection
BFT Finality11Attestation broadcasting, 2/3 supermajority threshold, duplicate attestation rejection, finality height advancement, persistence across restarts
NAT Traversal8UPnP port mapping, STUN discovery, fallback to manual config, address advertisement, lease renewal
End-to-End Integration21Full pipeline: MPT root in block header, reorg with state rollback, attestation-triggered finalization, NAT-traversing validator participation
Hack-Attack Simulation53Forged state roots, MPT proof spoofing, fake attestation flooding, reorg-past-finality attacks, NAT manipulation, Sybil attestation amplification
Total 150 6,848 passing tests across 173 test files
Security Focus: The 53 hack-attack simulation tests specifically target the new attack surface introduced by attestation broadcasting (Sybil amplification, fake finality), state root commitments (forged proofs, trie manipulation), and NAT traversal (IP spoofing, address poisoning). Every attack vector was identified via threat modeling before the corresponding defense was implemented.
Chapter 28

AI Agent Marketplace — Phase 29

Phase 29 introduces a fully on-chain AI Agent Marketplace where developers register AI agents, users submit tasks with ASF payment, and agents execute tasks with quality scoring via the PoNC meta-model. The marketplace creates a sustainable revenue loop: agents earn ASF for high-quality work, the platform collects fees for treasury, and deflationary burns reduce supply.

28.1 Agent Registry

Developers register agents by paying a 50 ASF registration fee and providing metadata (name, description, category, fee schedule). Each agent receives a unique on-chain ID and is assigned to one of six categories: ANALYSIS, AUDIT, GOVERNANCE, CREATIVE, DATA, or SECURITY. The registry enforces a soft cap of 10,000 agents and requires agents to maintain a minimum quality score of 7,000 basis points to remain eligible for task assignment.

ParameterValueDescription
Registration fee50 ASFOne-time fee to register an agent on-chain
Categories6ANALYSIS, AUDIT, GOVERNANCE, CREATIVE, DATA, SECURITY
Quality threshold7,000 bpMinimum quality score to receive task assignments
Max agents10,000Soft cap on total registered agents
Task timeout300 secondsMaximum execution time per task

28.2 Task Submission & Reward Distribution

Users submit tasks to agents by paying a minimum of 1 ASF. The marketplace assigns tasks, monitors execution, and distributes rewards using a three-way split designed to align incentives across the ecosystem.

RecipientSharePurpose
Agent developer85%Primary reward for task completion
AI Treasury (DAO)10%Platform fee funds ecosystem development
Burned5%Deflationary mechanism reduces total supply

28.3 Quality Scoring

Every task result is scored by the PoNC AI meta-model for accuracy, relevance, and completeness. Agent quality scores are updated as exponential moving averages. Agents falling below the 7,000 bp threshold are suspended from receiving new tasks until their score recovers. A leaderboard ranks agents by quality score, tasks completed, and user ratings.

Anti-Gaming: Quality scores are computed by the PoNC meta-model — the same AI system that validates transactions. Agents cannot game their scores because the scoring model weights are protected by ZKML proofs (Phase 31) and the scoring pipeline is deterministic.

28.4 RPC Methods

Phase 29 adds 11 new RPC methods for marketplace interaction:

MethodDescription
positronic_registerAgentRegister a new AI agent (50 ASF fee)
positronic_getAgentGet agent metadata by ID
positronic_listAgentsList agents by category or rating
positronic_submitTaskSubmit a task to an agent (pay ASF)
positronic_getTaskResultRetrieve completed task result
positronic_getTaskStatusCheck task execution status
positronic_rateAgentRate agent output quality
positronic_getAgentStatsGet agent performance statistics
positronic_getAgentEarningsGet agent earnings history
positronic_getAgentLeaderboardTop agents ranked by quality score
positronic_getMarketplaceStatsOverall marketplace statistics
Chapter 29

RWA Tokenization Engine (PRC-3643) — Phase 30

Phase 30 introduces the PRC-3643 token standard for tokenizing real-world assets (real estate, equity, commodities, bonds, art) with built-in compliance hooks, KYC verification via the DID system, fractional ownership, and automatic dividend distribution. This brings trillions of dollars in real-world value on-chain while maintaining regulatory compliance.

29.1 PRC-3643 Token Standard

PRC-3643 extends the PRC-20 fungible token standard with a compliance layer that enforces transfer restrictions based on jurisdiction, KYC level, and holding limits. Every transfer passes through a seven-step compliance check before execution.

ParameterValueDescription
Registration fee200 ASFOne-time fee to register an RWA token
Asset types5REAL_ESTATE, EQUITY, COMMODITY, BOND, ART
Min KYC level2Minimum KYC verification level for RWA trading
Max holders per token100,000Scalable fractional ownership
Transfer cooldown24 hoursCooldown between large transfers

29.2 Compliance Flow

Every RWA token transfer undergoes a seven-step compliance verification:

  1. Verify sender DID has KYC level ≥ 2
  2. Verify receiver DID has KYC level ≥ 2
  3. Check jurisdiction rules for both parties
  4. Validate transfer amount within daily/weekly limits
  5. AI compliance scoring via PoNC (flag suspicious patterns)
  6. Execute transfer if ALL checks pass
  7. Reject with specific reason code if ANY check fails

29.3 Dividend Distribution

RWA token issuers can trigger pro-rata dividend distributions to all holders. The dividend engine calculates each holder's share based on their token balance, deducts a 5 ASF distribution fee, and credits dividends atomically in a single transaction. Full dividend history is queryable via RPC for auditing and tax reporting.

29.4 Synergy with Existing Features

DID Integration: KYC credentials are stored as W3C Verifiable Credentials in the Positronic DID system (Chapter 16). The RWA compliance layer queries DID documents directly — no external KYC provider needed.

Agent Marketplace: AI compliance audit agents (Phase 29) can automate KYC verification and ongoing compliance monitoring for RWA tokens.

PoNC Scoring: AI models score RWA transfers for compliance anomalies using the same neural consensus pipeline that validates regular transactions.

29.5 RPC Methods

Phase 30 adds 10 new RPC methods for RWA token management:

MethodDescription
positronic_registerRWARegister a new real-world asset token (200 ASF)
positronic_getRWAInfoGet RWA token metadata and compliance rules
positronic_listRWAsList all registered RWA tokens
positronic_transferRWATransfer with seven-step compliance check
positronic_checkCompliancePre-check if a transfer would be compliant
positronic_addKYCCredentialAdd KYC verification to a DID
positronic_distributeDividendTrigger pro-rata dividend distribution
positronic_getDividendHistoryQuery dividend payment history
positronic_getRWAHoldersList token holders with fractional balances
positronic_getRWAStatsOverall RWA marketplace statistics
Chapter 30

ZKML — Zero-Knowledge Machine Learning — Phase 31

Phase 31 implements Zero-Knowledge Machine Learning (ZKML), enabling validators to prove that AI score computations are correct without revealing model weights. This prevents adversarial attacks on the PoNC scoring pipeline, protects model intellectual property, and enables lightweight verification (5ms) instead of full model re-execution.

30.1 Architecture

When a transaction arrives, the validator runs the PoNC meta-model to compute a score (e.g., 3,200 bp). The ZKML prover then generates a cryptographic proof that the score was computed correctly from the given inputs using the committed model weights. Other nodes verify the proof (fast, ~5ms) instead of re-running the full neural network. If the proof is invalid, the block is rejected.

ParameterValueDescription
Proof systemFiat-Shamir hash-based commitment schemeNon-interactive zero-knowledge proofs via Fiat-Shamir heuristic (computationally binding via SHA-512)
Proof timeout2,000 msMaximum time for proof generation
Verification gas50,000Gas cost for on-chain ZK proof verification
Model commitment interval100 blocksModel hash committed to chain every 100 blocks
Quantization16-bit fixed-pointModel weights quantized to 16-bit integers (scale factor 216)
Max circuit depth8 layersMaximum neural network depth for proof generation
Challenge rounds3Fiat-Shamir challenge-response rounds per proof
Technical Note: The ZKML proof system uses a Fiat-Shamir hash-based commitment scheme (computationally binding via SHA-512). This is ZK-inspired but not a full ZK-SNARK — there is no trusted setup and no R1CS circuit. Full ZK-SNARK with trusted setup is planned for v6.0.

30.2 Quantized Arithmetic Circuits

The ZKML circuit operates on quantized 16-bit fixed-point arithmetic to enable efficient proof generation. Floating-point model weights are converted to integers by multiplying by 216 (65,536). Each circuit layer computes a matrix-vector product, adds bias, applies quantized ReLU activation, and produces deterministic integer outputs. The circuit's model commitment is the SHA-512 Merkle root of all layer weight matrices and biases.

30.3 Proof Generation & Verification

The ZKMLProver generates non-interactive proofs using the Fiat-Shamir heuristic: (1) compute blinded intermediate activations for each layer, (2) derive challenges from SHA-512 hashes of the proof transcript, (3) produce challenge-response pairs that demonstrate knowledge of the correct computation without revealing weights. The ZKMLVerifier checks all challenge-responses against the committed model hash, input hash, and output score.

Tamper Resistance: The verifier detects all forms of tampering: modified scores, altered input hashes, wrong model commitments, replayed challenges, swapped challenge order, and completely forged proofs. A proof generated for model A cannot pass verification against model B.

30.4 Cross-Feature Synergies

ZKML integrates with both the Agent Marketplace and RWA Engine:

30.5 RPC Methods

Phase 31 adds 5 new RPC methods for ZKML interaction:

MethodDescription
positronic_getZKMLProofGenerate ZK proof for a transaction's AI score
positronic_verifyZKMLProofVerify a ZK proof's validity
positronic_getZKMLStatsZKML system statistics (proof times, verification rate)
positronic_getZKMLConfigCurrent ZKML configuration parameters
positronic_getModelCommitmentGet model hash commitment (without revealing weights)

30.6 Test Coverage

Phases 29–31 collectively add ~320 new tests across 7 test files:

Test SuiteTestsCoverage
Agent Marketplace~80Registration, task lifecycle, reward distribution, quality scoring, leaderboard
Agent Integration~20End-to-end marketplace flows with blockchain initialization
PRC-3643 Token~50Token creation, compliance rules, fractional transfers, dividend distribution
RWA Compliance~40KYC verification, jurisdiction rules, transfer restrictions, AI scoring
RWA Dividends~20Pro-rata calculation, distribution mechanics, history tracking
ZKML Core~68Quantization, circuit layers, proof generation, verification, cache
ZKML Integration~40Blockchain init, RPC methods, security (tamper/forgery), performance
Total ~320 6,848 passing tests across 173 test files
Chapter 31

Neural Self-Preservation System — Phase 32

Phase 32 introduces the Neural Self-Preservation (NSP) system — a comprehensive framework that protects the AI validation pipeline from catastrophic failures, enables graceful performance degradation, and ensures rapid recovery from model corruption or network partitions. NSP replaces the binary kill switch with a graduated multi-level response system.

31.1 Neural Snapshot Engine

The NeuralPreservationEngine captures complete AI state snapshots including model weights (16-bit quantized), agent states, trust scores, ZKML commitments, and degradation levels. Each snapshot produces a SHA-512 state root for tamper detection.

ParameterValue
Snapshot intervalEvery 500 blocks
Max retained snapshots50 (auto-pruned)
Weight quantizationfloat16 (IEEE 754 half-precision)
State root hashSHA-512
PersistenceSQLite WAL mode
Snapshot target time< 200ms

31.2 Graceful Degradation Engine

Instead of a binary on/off kill switch, the GracefulDegradationEngine provides five graduated levels that progressively relax AI thresholds while maintaining network operation:

LevelNameAccept (bp)Quarantine (bp)Emergency State
L5FULL8,5009,500NORMAL
L4REDUCED7,0008,500DEGRADED
L3MINIMAL5,0007,500DEGRADED
L2GUARDIAN3,0006,000PAUSED
L1OPEN010,001HALTED
One-Step Transitions: The engine enforces strict one-step transitions (e.g., L5→L4 is allowed, L5→L3 is not). Ascending requires passing a health check; descending is immediate. This prevents oscillation attacks and ensures predictable behavior.

31.3 Pathway Memory (Hebbian Learning)

The PathwayMemory module tracks computation path health using Hebbian learning principles. Each AI pathway (TAD, MSAD, SCRA, ESG, meta-model, consensus) maintains a weight in [0.1, 1.0]:

31.4 Neural Recovery Engine

The NeuralRecoveryEngine restores AI state from snapshots when corruption is detected. Recovery requires 3-of-5 multisig authorization and follows an 8-step protocol:

  1. Verify multisig authorization (hmac.compare_digest for timing attack prevention)
  2. Check attempt counter (max 3 recovery attempts)
  3. Find best available snapshot (most recent, verified integrity)
  4. Verify snapshot state root (SHA-512)
  5. Extract and restore model weights
  6. Ascend degradation level
  7. Reset attempt counter on success
  8. Log recovery event to history

31.5 Neural Watchdog Service

A separate OS process monitors the main blockchain process via heartbeat files. If the main process stops updating its heartbeat file for 3 consecutive checks (1.5 seconds), the watchdog sends SIGUSR1 to trigger graceful degradation.

ParameterValue
Check interval0.5 seconds
Miss threshold3 consecutive misses
Failure signalSIGUSR1 (Unix) / graceful log (Windows)
Heartbeat formatAtomic file write (tmp + rename)

31.6 Deep AI Integration Extensions

Phase 32 also deepens the AI subsystem with four integration modules:

31.6.1 Online Learning Extension

Enables continuous model improvement in Phase C (production mode only). Labeled transactions from three sources (validator consensus, appeal results, confirmed attacks) are buffered and used for periodic retraining. A quality gate reverts any update that causes >5% accuracy drop.

31.6.2 Model Communication Bus

The ModelCommunicationBus enables AI models to share signals within transaction-scoped contexts. Signals are typed per model (e.g., TAD emits anomaly_high, MSAD emits mev_detected). Context boosts are capped at ±500 basis points and models cannot read their own signals (no self-subscription).

31.6.3 Causal Explainability (XAI v2)

The CausalExplainer generates human-readable explanations using permutation-based feature importance and greedy counterfactual reasoning. Explanations are available in both English and Persian (Farsi) via the positronic_explainTransaction RPC method.

31.6.4 Concept Drift Detection

The ConceptDriftDetector monitors model score distributions over rolling windows (500 blocks) and compares against baseline means. Three severity levels trigger graduated responses:

SeverityDrift %Action
LOW< 10%Log alert only
MEDIUM10% – 30%Reduce model weight by 20%
HIGH> 30%Reduce weight + trigger snapshot + recommend retraining

31.7 NSP Test Coverage

ModuleTestsCoverage Areas
Neural Preservation43Snapshots, quantization, determinism, pruning, persistence
Graceful Degradation51All 5 levels, transitions, health checks, emergency mapping
Neural Watchdog33Heartbeat, miss counting, failure actions, launcher
Pathway Memory32Decay, boost, correlation, preemptive strengthening
Neural Recovery37Recovery flow, multisig, integrity checks, attempt limits
Online Learning32Phase gating, label sources, rate limiting, quality gate
Model Bus32Publish/read, TX scoping, boost cap, self-subscription prevention
Causal XAI27Feature importance, counterfactual, EN/FA narratives
Concept Drift33Score recording, baseline, severity levels, alert filtering
RPC Methods44All 13 NSP RPC methods, error handling, parameter validation
Stress + Security63Performance benchmarks, memory leaks, attack resistance
Total 427 Comprehensive coverage of all NSP subsystems
Chapter 32

References & Sources

  1. Nakamoto, S. (2008). Bitcoin: A Peer-to-Peer Electronic Cash System.
  2. Buterin, V. (2014). Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform.
  3. Ducas, L., Kiltz, E., Lepoint, T., et al. (2018). CRYSTALS-Dilithium: A Lattice-Based Digital Signature Scheme. IACR Transactions on Cryptographic Hardware and Embedded Systems.
  4. W3C. (2022). Decentralized Identifiers (DIDs) v1.0. W3C Recommendation.
  5. EIP-4337: Account Abstraction Using Alt Mempool. Ethereum Improvement Proposals.
  6. Castro, M. & Liskov, B. (1999). Practical Byzantine Fault Tolerance. OSDI.
  7. Ben-Sasson, E., et al. (2014). Succinct Non-Interactive Zero Knowledge for a von Neumann Architecture. USENIX Security.
  8. Goldwasser, S., Micali, S., & Rackoff, C. (1985). The Knowledge Complexity of Interactive Proof-Systems. STOC.
  9. Larimer, D. (2014). Delegated Proof-of-Stake (DPoS). Bitshares Technical Paper.
  10. NIST. (2024). Post-Quantum Cryptography Standardization. FIPS 204 (ML-DSA).
  11. Weiss, Y. et al. (2021). ERC-4337: Account Abstraction via Entry Point Contract Specification.
  12. Vitalik Buterin. (2022). Soulbound Tokens. Decentralized Society: Finding Web3's Soul.