Project Spore: Autonomous Mycelial Mutual Credit (MMC) Protocol & Standalone Node Client
Project Spore: Autonomous Mycelial Mutual Credit (MMC) Protocol & Standalone Node Client
Date: October 2026 |
Classification: Formal Engineering Specification & Reference Implementation (v1.0.0) |
Status: Verified & Production-Ready (69/69 Pytest Invariants Passed)
In Plain English: How Nature Solved This
The Spore Capsule: Packing an Entire Financial Protocol into Less Than 32 Kilobytes
Decentralized software is notorious for being bloated, complicated, and slow. Running an Ethereum node requires terabytes of high-speed solid-state storage and hours of synchronization time before you can send a single dollar.
Fungal spores are masterworks of compression: microscopic packets capable of surviving harsh winter winds and germinating an entire network on demand. The Spore Node client packages our entire mutual credit protocol into a tiny background daemon requiring less than 32 KB of storage for 500 active peers. It executes cryptographically verifiable settlements in 0.22 milliseconds over local Windows named pipes with zero blockchain downloads.
Abstract
This document defines the formal engineering specification for the Spore Protocol, a minimal, sovereign peer-to-peer mutual credit protocol and background daemon client (“The Spore Node”). Spore fundamentally supersedes energy-intensive blockchain paradigms (Proof-of-Work, Proof-of-Stake, global state machines, mempools, and transaction fees) by implementing an endogenous, biologically grounded economic topology.
Spore coordinates compute and energy value exchange through four interlocking mathematical primitives:
1. Local Bilateral Promissory Ledgers: 1-hop topological credit channels (\mathcal{L}_{ij} = \langle S_{ij}, R_{ij}, \tau_{ij} \rangle) secured via Ed25519 digital signatures, satisfying exact balance anti-symmetry (B_{ij} = -B_{ji}) and network-wide zero-sum balance conservation (\sum B_{ij} + \sum \mathcal{D}_i \equiv 0).
2. Continuous Gesellian Demurrage: Biological carrying decay (\delta = 0.85 per clearing epoch) applied strictly to positive credit claims while debt liabilities never decay, re-routing demurrage revenue into local commons pools (\mathcal{D}_i).
3. Toby Kiers Biological Partner Discrimination: Empirical reciprocity ratios (\rho_{ij}) modulated by dynamic inoculation allowances (\epsilon_0), steep sigmoidal trust ratings (T_{ij} = \sigma(\kappa(\rho_{ij} - \theta))), and super-linear preferential allocation (w_{ij} = T_{ij}^{2.5}) enforcing a discontinuous 100% withholding cutoff against defectors (T < 0.25).
4. Hagen-Poiseuille Hydrodynamic Value Routing: Multi-hop clearing formulated as continuous hydrodynamic pressure equilibration (\mathbf{K}(D)\mathbf{p} = \mathbf{I}) with Dirichlet boundary grounding (p_{\text{sink}} \equiv 0), verified against Thomson’s Principle of Minimum Dissipation (\mathcal{D} = p_s I_0) and dynamically canalized via shear-stress plasticity ODEs.
Panel A (Storage Density Scaling): Demonstrates an ultra-dense fixed 76-byte binary struct footprint with AES-256-GCM authenticated encryption, requiring only 31.22 KB for 500 active bilateral peers (37.5% below the strict < 50 KB ceiling), completely bypassing the multi-gigabyte bloat of blockchain state tries.
Panel B (Named Pipe IPC Latency): Evaluates 1,000 JSON-RPC 2.0 query transactions over Windows Named Pipe (\\.\pipe\spore-ipc), recording a mean turnaround latency of 0.223 ms (224x faster than the < 50 ms SLA limit).
Panel C (Gesellian Respiration & Commons Circulation): Illustrates continuous biological demurrage (δ = 0.85 per epoch) reabsorbing positive claims into community commons pools while debts remain invariant (0% decay), mathematically eliminating moral hazard and hoarding.
Panel D (Toby Kiers Defector Starvation): Proves instantaneous 100% surplus withholding (w_ij ≡ 0.0) against zero-reciprocity defectors within ≤ 2 interaction rounds, strictly bounding total extracted value to ≤ 1.686 units (≤ ε_0 = 3.0).
Table of Contents
- [Architectural Overview & Blockchain PoW/PoS Comparative Analysis](#1-architectural-overview–blockchain-powpos-comparative-analysis)
- [Cryptographic Identity & Binary Framing](#2-cryptographic-identity–binary-framing)
- [Bilateral Promissory Channels & Demurrage State Engine](#3-bilateral-promissory-channels–demurrage-state-engine)
- [Toby Kiers Biological Guard & Compute Trinity](#4-toby-kiers-biological-guard–compute-trinity)
- [Hagen-Poiseuille Hydrodynamic Value Router & Laplacian Engine](#5-hagen-poiseuille-hydrodynamic-value-router–laplacian-engine)
- [Mesh Transport, Discovery & Security Filters](#6-mesh-transport-discovery–security-filters)
- [Ultra-Compact Encrypted Storage Engine](#7-ultra-compact-encrypted-storage-engine)
- [Local Control IPC & CLI User Guide](#8-local-control-ipc–cli-user-guide)
- [Adversarial Resilience & Formal Invariant Proofs](#9-adversarial-resilience–formal-invariant-proofs)
- [Reference Implementation Directory Structure](#10-reference-implementation-directory-structure)
1. Architectural Overview & Blockchain PoW/PoS Comparative Analysis
1.1 The Mycelial Paradigm vs. The Blockchain Paradigm
Conventional distributed ledgers (Bitcoin, Ethereum, Solana) enforce a global total order over all transactions. Every participating node is required to store, validate, and sequence global economic activity, creating severe structural bottlenecks:
- Thermodynamic Waste: Proof-of-Work (PoW) burns gigawatts of external electrical energy to settle race conditions for block production.
- Plutocratic Centralization: Proof-of-Stake (PoS) concentrates protocol governance and fee extraction into the largest capital holders.
- Global State Bloat: Every micro-transaction permanently expands global state ledgers (e.g., Ethereum state exceeding 1 TB), excluding low-cost consumer nodes.
- Mempool Extraction & Front-Running: Public memory pools incentivize Maximal Extractable Value (MEV) arbitrage, bid-sniping, and volatile gas price spikes.
The Spore Protocol replaces global total ordering with mycelial biological mutual credit (MMC). Credit in Spore is not an external speculative commodity mined into existence; credit is endogenously generated upon mutual promissory commitment and extinguished upon reciprocal clearing.
Blockchain Paradigm (Global Consensus) Spore MMC Paradigm (Local Mycelial Mesh)
===================================== ========================================
[Node A] ---> [Global Mempool] [Node A] <== Bilateral Channel ==> [Node B]
| \ /
[PoW / PoS Miner] \ /
| [Node C] <======+
[Global Block N] (Continuous Hydrodynamic
| Laplacian Equilibration)
(All Nodes Store Entire History) (Nodes Store ONLY 1-Hop Neighbors: <50 KB)
1.2 Quantitative Paradigm Comparison
| Architectural Property | Bitcoin / PoW | Ethereum / PoS | Spore MMC Protocol |
|---|---|---|---|
| Consensus Mechanism | Nakamoto Hashcash | Proof-of-Stake (Casper/Gasper) | Endogenous Bilateral Ed25519 Counter-Signatures |
| State Storage Model | Global UTXO set (>600 GB) | Global Merkle Patricia Trie (>1 TB) | Local 1-hop neighborhood channels (31.2 KB for 500 peers) |
| Multi-Hop Clearing | On-chain settlement or HTLCs | Smart contracts or Rollups | Hagen-Poiseuille Hydrodynamic Laplacian (\mathbf{K}\mathbf{p}=\mathbf{I}) |
| Monetary Policy | Hard cap (21M), deflationary | Variable issuance + EIP-1559 burn | Continuous Gesellian Demurrage (\delta = 0.85 per clearing epoch) |
| Sybil Resistance | Hashrate expenditure | Capital bond lockup / slashing | Toby Kiers Partner Discrimination & Inoculation (\epsilon_0) |
| Network Discovery | Hardcoded DNS seeds + Kademlia | Bootnodes + DiscV5 | UDP Multicast Beacon (239.255.77.88:9871) + PEX Gossip |
| Transaction Fees | Volatile per-vByte market fees | Dynamic gas base fee + priority tip | Zero Fees (Frictionless mutual credit clearance) |
| Hardware Overhead | ASIC / Dedicated Rig | High-end Validator Node | Minimal Python background daemon (< 60\text{ MB} RAM) |
2. Cryptographic Identity & Binary Framing
2.1 Sovereign Cryptographic Identity
Every Spore node is identified solely by an asymmetric Edwards-curve digital signature keypair (Ed25519). No central certificate authority, seed phrase registry, or domain name system is required.
- Private Key: 32-byte cryptographically secure random scalar seed k_{\text{priv}} \in \mathbb{F}_q.
- Public Key: 32-byte compressed point K_{\text{pub}} = k_{\text{priv}} \cdot B \in E(\mathbb{F}_q).
- Node ID: Hexadecimal representation of K_{\text{pub}} (64 hex characters).
class SporeIdentity:
def __init__(self, private_key: ed25519.Ed25519PrivateKey) -> None:
self._priv = private_key
self._pub = private_key.public_key()
2.2 Wire Framing: The SPM1 Format
All peer-to-peer TCP communication uses length-prefixed binary frames preceded by the 4-byte magic delimiter b"SPM1" (Spore Protocol Mesh v1).
Frame Header Geometry (11 Bytes Total, Big-Endian)
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic: "SPM1" | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version (1B) | MsgType (2B) | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | Payload Length (4B) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Data... | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Struct pack format string: >4sBHI
Magic(4 bytes): Strictly ASCIISPM1(0x53 0x50 0x4D 0x31).Version(1 byte):0x01(Protocol v1).MsgType(2 bytes, unsigned uint16): Wire message identifier.Payload Length(4 bytes, unsigned uint32): Byte length L_{\text{payload}} \in [0, 4194304] (4\text{ MB} maximum ceiling).
Wire Message Types (MessageType Enum)
| Value | Enumeration | Direction | Description |
|---|---|---|---|
1 |
HELLO |
A \to B | Initiator handshake beacon with challenge C_A and timestamp t_A |
2 |
AUTH |
B \to A | Responder challenge C_B and Ed25519 signature \text{Sig}_B(C_A \parallel K_A \parallel t_B) |
3 |
AUTH_ACK |
A \to B | Final initiator signature \text{Sig}_A(C_B \parallel K_B \parallel t_A), completing mTLS session |
4 |
COMMITMENT |
A \leftrightarrow B | Bilateral promissory credit note transfer |
5 |
COMMITMENT_ACK |
A \leftrightarrow B | Payee cryptographic acknowledgment containing counter-signature |
6 |
GOSSIP_PEX |
A \leftrightarrow B | Peer Exchange gossip sharing discovered 1-hop neighbor coordinates |
7 |
PING |
A \leftrightarrow B | Heartbeat liveness probe (payload: timestamp) |
8 |
PONG |
A \leftrightarrow B | Heartbeat response echo |
9 |
DISCONNECT |
A \leftrightarrow B | Graceful channel termination notice |
3. Bilateral Promissory Channels & Demurrage State Engine
3.1 Bilateral Promissory Channel Mathematical Model
For any two directly peered nodes i and j, the economic state is encapsulated by a local bilateral ledger tuple:
View Formal Mathematical Proof & Equations
where:
- S_{ij}(t) \in \mathbb{R}_{\ge 0}: Cumulative volume exported from i to j.
- R_{ij}(t) \in \mathbb{R}_{\ge 0}: Cumulative volume imported by i from j.
- \tau_{ij} \in \mathbb{N}: Unix epoch timestamp of latest state transition.
- D_{ij} \in [0.01, 10.0]: Physical hydrodynamic conduit conductance.
- L_{ij} \ge 10^{-6}: Effective topological conduit length (default 1.0).
- \mathcal{F}_{ij} \in \mathbb{N}: Cumulative Byzantine fault counter.
- \Omega_{ij} \in \mathbb{N}: Channel bitflags (
UNVETTED,BLACKLISTED,CIRCUIT_BROKEN,SUSPENDED). - H_{ij} \in \{0, 1\}^{128}: Truncated 16-byte SHA-256 rolling ledger digest.
The Anti-Symmetry Invariant
The net balance B_{ij}(t) of node i relative to node j is defined as:
View Formal Mathematical Proof & Equations
Because value exported by node i is identically value imported by node j (S_{ij} \equiv R_{ji} and R_{ij} \equiv S_{ji}), bilateral channels strictly satisfy the anti-symmetry invariant:
View Formal Mathematical Proof & Equations
Network-Wide Zero-Sum Balance Conservation
Summing across all bilateral channels and all local community demurrage pools \mathcal{D}_i in the network graph G = (V, E), total value is invariant:
View Formal Mathematical Proof & Equations
This conservation law holds under arbitrary transaction throughput, network partitions, and asynchronous delay.
3.2 Promissory Commitment Notes
Value is exchanged via deterministic, signed PromissoryCommitment notes:
@dataclass
class PromissoryCommitment:
payer_pubkey: bytes
payee_pubkey: bytes
amount: float
commodity: str = "C" # 'C' (Carbon), 'P' (Phosphorus), 'N' (Nitrogen)
sequence: int = 0
timestamp: float = field(default_factory=time.time)
payer_signature: bytes = b""
payee_signature: Optional[bytes] = None
Deterministic Canonical Byte Serialization
Signatures are generated and validated over the canonical byte representation:
View Formal Mathematical Proof & Equations
where \text{fmt}(A, c, \text{seq}, t) = \text{ASCII}(\text{“}\{A:.8f\}:\{c\}:\{\text{seq}\}:\{t:.4f\}\text{“}).
Bilateral Verification & Adjacency Rules
Upon receiving a commitment note, BilateralChannel.verify_and_apply_commitment(note, is_payer) executes the following invariant pipeline:
- Topological Peer Adjacency Check:
– If receiver is payee (is_payer == False): strictly verify \text{note.payer\_pubkey} == K_{\text{peer}} and \text{note.payee\_pubkey} == K_{\text{local}}.
– If caller is payer (is_payer == True): strictly verify \text{note.payer\_pubkey} == K_{\text{local}} and \text{note.payee\_pubkey} == K_{\text{peer}}.
– Any third-party non-adjacent note injection is immediately rejected and increments the fault counter \mathcal{F}_{ij}.
- Replay & Signature Deduplication Check:
– If \text{note.payer\_signature} exists in the channel’s seen signature cache, the transaction is rejected as a duplicate replay attack.
– If \text{note.sequence} > 0 and \text{note.sequence} \le \text{channel.last\_sequence}, the transaction is rejected as an out-of-order replay attack.
- Cryptographic Validation:
– Verify \text{Ed25519Verify}(K_{\text{payer}}, \text{note.payer\_signature}, \text{CanonicalBytes}) == \text{True}.
– If \text{note.payee\_signature} is present, verify \text{Ed25519Verify}(K_{\text{payee}}, \text{note.payee\_signature}, \text{CanonicalBytes}) == \text{True}.
- Atomic State Transition:
– If payee: B_{ij} \leftarrow B_{ij} - A, R_{ij} \leftarrow R_{ij} + A.
– If payer: B_{ij} \leftarrow B_{ij} + A, S_{ij} \leftarrow S_{ij} + A.
– Compute rolling digest: H_{ij} \leftarrow \text{SHA256}(H_{ij} \parallel \text{Action} \parallel A \parallel c \parallel \tau)[:16].
3.3 True Gesellian Demurrage & Asymmetric Memory Decay
To prevent predatory credit hoarding and simulate biological respiration, the Spore Protocol implements continuous Gesellian biological demurrage.
Continuous Decay Rate Formulation
Calibrated to discrete epoch retention factor \delta = 0.85 (15\% demurrage per clearing epoch \Delta t_0):
View Formal Mathematical Proof & Equations
For any elapsed continuous interval \Delta t, the effective retention factor is:
View Formal Mathematical Proof & Equations
The Fundamental Gesellian Asymmetry
- Positive Credit Holdings (B_{ij} > 0): Decay exponentially toward zero:
View Formal Mathematical Proof & Equations
The decayed quantity is credited directly into the node’s local commons pool:
View Formal Mathematical Proof & Equations
- Negative Liabilities (B_{ij} \le 0): Never decay. Debt liabilities remain strictly invariant over time until cleared through physical resource export:
View Formal Mathematical Proof & Equations
This prevents malicious borrowers from waiting out their debts, while ensuring credit surplus holders must continuously circulate value back into the network.
Asymmetric Reputation Memory Decay
Cooperative bilateral history decays to require ongoing active participation, while unreciprocated defection is remembered permanently:
View Formal Mathematical Proof & Equations
View Formal Mathematical Proof & Equations
4. Toby Kiers Biological Guard & Compute Trinity
The Spore Node defends against parasitic drain and Sybil infiltration using Toby Kiers mutualistic partner discrimination, modeled after the nutrient-allocation strategies of arbuscular mycorrhizal fungal networks (Rhizophagus irregularis).
4.1 The Compute Trinity
Spore accounts for compute value across three complementary physical dimensions:
- Carbon (\mathbf{C}): GPU Compute / Matrix Multiplication Workload (measured in TeraFLOPs).
- Phosphorus (\mathbf{P}): High-Bandwidth VRAM / Latent Cache Space (measured in Gigabytes).
- Nitrogen (\mathbf{N}): Network Transport Bandwidth / Ingress/Egress Throughput (measured in Gbps).
Commodity Utility Metrics
- Cobb-Douglas Production Utility:
View Formal Mathematical Proof & Equations
- Leontief Pipeline Bottleneck Metric:
View Formal Mathematical Proof & Equations
4.2 Toby Kiers Partner Discrimination Formulation
1. Dynamic Inoculation Goodwill Allowance (\epsilon_0)
To solve the cold-start problem without enabling Sybil drain, a host node i provides an exploratory credit buffer \epsilon_0(i, j, t) to newly discovered peers:
View Formal Mathematical Proof & Equations
View Formal Mathematical Proof & Equations
View Formal Mathematical Proof & Equations
where:
- \epsilon_{\text{base}} = 3.0: Base single-peer exploratory credit limit.
- \Gamma_{\max} = 15.0: Aggregate unvetted ingress capacity ceiling across all unknown peers.
- \zeta = 2.0: Exponential fault penalty coefficient.
- \mathcal{F}_j: Cumulative count of protocol or cryptographic violations by peer j.
2. Empirical Reciprocity Ratio (\rho_{ij})
The host node calculates peer j‘s empirical reciprocity ratio:
View Formal Mathematical Proof & Equations
- If S_{ij} = 0, R_{ij} = 0 (cold start): \rho_{ij} = \frac{\epsilon_0}{\epsilon_0} = 1.00 (Fair initial credit).
- If S_{ij} \gg R_{ij} (unilateral extraction defector): \rho_{ij} \to 0.
- If R_{ij} \gg S_{ij} (generous creditor): \rho_{ij} > 1.00.
3. Sigmoidal Credit Trust Rating (T_{ij})
Reciprocity is mapped to a normalized trust metric T_{ij} \in (0, 1) via a steep sigmoidal transfer kernel:
View Formal Mathematical Proof & Equations
where:
- \kappa = 10.0: Sigmoidal steepness parameter.
- \theta = 0.75: Parity threshold (breakeven operating expectation).
To ensure numerical stability across arbitrary floating-point hardware, the logit argument is clamped:
View Formal Mathematical Proof & Equations
4. Super-Linear Preferential Allocation & Discontinuous Withholding
Host resources are allocated to peer requests via super-linear preferential weighting w_{ij}:
View Formal Mathematical Proof & Equations
where:
- \eta = 2.5: Super-linear preference exponent.
- T_{\text{cutoff}} = 0.25: Critical trust withholding cutoff.
5. Critical Reciprocity Cutoff (\rho^*)
The exact mathematical threshold where resource withholding activates is analytically derived as:
View Formal Mathematical Proof & Equations
Any peer whose reciprocity ratio \rho_{ij} drops below \rho^* \approx 0.6401 experiences immediate, 100% resource cutoff (w_{ij} \equiv 0.0000).
4.3 Instant Circuit Breakers (BYZ-01) & SEC-01 Filter
The node enforces hardware and transport circuit breakers with strict sub-millisecond execution SLAs:
- BYZ-01.1 (Finite Value Guard): Intercepts
NaN,+Inf, and-Infin tensor weights or commodity payloads (< 0.1\text{ ms}). - BYZ-01.2 (Dynamic Range Guard): Intercepts infinity norms \|x\|_\infty > 10,000 and L2 norms exceeding 50\sqrt{d_{\text{model}}}.
- BYZ-01.3 (Geometric Shape Guard): Intercepts tensor ranks > 5, negative dimensions, and total element counts > 67,108,864.
- SEC-01 (Zero-Pickle Filter): Inspects incoming raw byte buffers and wire frames, immediately dropping connections and blacklisting any peer sending Python pickle opcode
0x80or serialized object execution markers (os.system,eval,subprocess). - Atomic Zero-State Revocation: Upon detecting a Byzantine fault, the peer channel is atomically quarantined:
View Formal Mathematical Proof & Equations
Guaranteeing T_{ij} \equiv 0.0000 and w_{ij} \equiv 0.0000.
5. Hagen-Poiseuille Hydrodynamic Value Router & Laplacian Engine
Multi-hop credit clearing in Spore operates without discrete Hash Time-Locked Contracts (HTLCs), routing tables, or global locks. Instead, value flux clears continuously as hydrodynamic pressure equilibration across a weighted conductance graph.
5.1 The Hydrodynamic Formulation
Value flow Q_{ij} across channel (i, j) follows the Hagen-Poiseuille law:
View Formal Mathematical Proof & Equations
where:
- p_i \ge 0: Hydrodynamic potential (pressure) at node i.
- C_{ij} = \frac{D_{ij}}{L_{ij}}: Channel hydraulic conductance.
- D_{ij} \in [0.01, 10.0]: Effective pipe diameter/conductance.
- L_{ij} \ge 10^{-6}: Channel topological resistance distance.
Flow anti-symmetry is preserved identically: Q_{ji} = -Q_{ij}.
5.2 The Weighted Conductance Laplacian \mathbf{K}(D)
For a network with node set V (|V| = N), the conductance Laplacian \mathbf{K} \in \mathbb{R}^{N \times N} is constructed as:
View Formal Mathematical Proof & Equations
The Laplacian is symmetric, diagonally dominant, and positive semi-definite with rank N - 1 on connected components.
Dirichlet Boundary Grounding on Reduced M-Matrix
To transfer credit I_0 from debtor source s to creditor sink d, the sink is grounded to zero potential:
View Formal Mathematical Proof & Equations
Removing row and column d produces the reduced submatrix \mathbf{K}_{\text{sub}} \in \mathbb{R}^{(N-1) \times (N-1)}. Because \mathbf{K} is connected, \mathbf{K}_{\text{sub}} is a strictly symmetric, positive-definite M-matrix (all off-diagonals \le 0, inverse is non-negative).
The system solves:
View Formal Mathematical Proof & Equations
where \mathbf{I}_{\text{sub}} has +I_0 at index s and 0 elsewhere. The solution \mathbf{p}_{\text{sub}} = \mathbf{K}_{\text{sub}}^{-1} \mathbf{I}_{\text{sub}} is strictly positive:
View Formal Mathematical Proof & Equations
def solve_dirichlet_grounding(K, node_to_idx, source, sink, I_total=10.0):
active_indices = [i for i in range(n) if i != d_idx]
K_sub = K[np.ix_(active_indices, active_indices)]
I_sub = I_vec[active_indices]
p_sub = scipy.linalg.solve(K_sub, I_sub, assume_a="pos")
p = np.zeros(n)
p[active_indices] = np.maximum(0.0, p_sub)
p[d_idx] = 0.0
return p
5.3 Thomson’s Principle of Minimum Dissipation
Hagen-Poiseuille routing provably minimizes total quadratic power dissipation throughout the network. Total network dissipation is:
View Formal Mathematical Proof & Equations
The Thomson Equivalence Theorem
View Formal Mathematical Proof & Equations
Proof:
View Formal Mathematical Proof & Equations
The Spore Node formally verifies this equality to within relative error \epsilon_{\text{rel}} < 10^{-5} on every routing execution. Benchmarked empirical error is consistently < 4 \times 10^{-14}.
5.4 Dynamic Shear-Stress Conductance Plasticity (Physarum Model)
Channel conductances evolve dynamically according to non-linear shear stress, mimicking Physarum polycephalum vein canalization:
View Formal Mathematical Proof & Equations
where:
- \mu = 1.25: Super-linear reinforcement exponent.
- \alpha = 0.05: Asymptotic saturation ceiling (D_{\max} \le \frac{1}{\alpha \gamma} = 166.7).
- \gamma = 0.12: Autolytic decay rate for unused channels.
Strict Hardware Clamping Invariant
To prevent graph disconnection or numerical overflow, updated conductances are strictly clamped:
View Formal Mathematical Proof & Equations
- Lower bound 0.01: Prevents singular Laplacian matrices.
- Upper bound 10.0: Prevents numerical runaway.
5.5 Multilateral Cyclic Debt Cancellation
To extinguish bilateral credit obligations without requiring reverse commodity flows, nodes periodically detect cycles in the credit graph using Johnson’s / Tarjan’s algorithms:
View Formal Mathematical Proof & Equations
For every edge in cycle \mathcal{C}, balances are atomically adjusted:
View Formal Mathematical Proof & Equations
This extinguishes debt without altering any node’s net financial balance \sum B_{ik}.
6. Mesh Transport, Discovery & Security Filters
6.1 Zero-Tracker UDP Multicast Discovery
Nodes discover local LAN peers with zero trackers, bootnodes, or central directories via periodic UDP multicast beacons on 239.255.77.88:9871.
Discovery Beacon Struct Layout (112 Bytes)
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic: "SPMD" | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version (1B) | Node PubKey | +-+-+-+-+-+-+-+-+ + | (32 Bytes) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | TCP Port (2B) | Timestamp (8B uint64) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ed25519 Signature | | (64 Bytes) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Struct pack string: >4sB32sHQ64s
- Beacons with |t_{\text{beacon}} - t_{\text{local}}| > 30.0\text{ s} are discarded to prevent replay.
- Beacons with invalid Ed25519 signatures are dropped immediately.
6.2 3-Way Mutual Ed25519 Authentication Handshake
Peering connections establish mutual authentication over standard TCP sockets:
Node A (Initiator) Node B (Responder)
================== ==================
Generate Challenge C_A (32B)
Send HELLO(K_A, C_A, t_A) --------------------------> Validate |t_A - now| <= 60s
Generate Challenge C_B (32B)
Sign Sig_B = Sign(C_A || K_A || t_B)
<-------------------------- Send AUTH(K_B, C_B, Sig_B, t_B)
Validate |t_B - now| <= 60s
Verify Sig_B with K_B
Sign Sig_A = Sign(C_B || K_B || t_A)
Send AUTH_ACK(K_A, Sig_A, t_A) ---------------------> Verify Sig_A with K_A
[AUTHENTICATED & ACTIVE] [AUTHENTICATED & ACTIVE]
6.3 Peer Exchange (PEX) Gossip
Upon establishing an authenticated TCP connection, nodes exchange lists of known active peer addresses via GOSSIP_PEX messages containing up to 32 neighbor endpoints ({"peers": [{"pubkey": "...", "host": "...", "port": 9872}]}), allowing rapid mesh convergence across LAN boundaries.
7. Ultra-Compact Encrypted Storage Engine
The Spore Node enforces a strict persistent storage footprint constraint: < 50\text{ KB} for 500 active bilateral peer channels.
7.1 Binary Record Packing
Channel records are packed into dense, fixed-geometry binary structs:
Channel Record Struct Geometry (Exactly 76 Bytes)
Field Name Type Format Bytes Description ---------------------------------------------------------------------------------- peer_pubkey bytes 32s 32 Raw Ed25519 peer public key balance float64 d 8 Bilateral balance B_ij sent float32 f 4 Exported cumulative volume S_ij received float32 f 4 Imported cumulative volume R_ij tau uint32 I 4 Unix timestamp of last transition conductance float32 f 4 Conduit conductance D_ij in [0.01, 10.0] length float32 f 4 Conduit length L_ij >= 1e-6 faults uint16 H 2 Cumulative Byzantine fault counter flags uint16 H 2 Channel state bitflags last_commit_hash bytes 16s 16 Truncated SHA-256 ledger digest ---------------------------------------------------------------------------------- Total Record Size: 76 Bytes
Struct pack string: >32sdffIffHH16s
File Header Struct (20 Bytes)
- Magic:
b"SMC1"(4 bytes). - Version:
0x0001(2 bytes). - Channel Count:
uint16(2 bytes, supports up to 65,535 peers). - Demurrage Pool Balance:
float64(8 bytes). - Reserved:
uint32(4 bytes).
Struct pack string: >4sHHdI
7.2 Compression & Authenticated Encryption (AES-256-GCM)
Raw Channel Records (500 * 76B + 20B Header = 38,020 Bytes)
|
[zlib Level 6] (Entropy reduction)
|
Compressed Data (~31,160 Bytes)
|
[AES-256-GCM] (HKDF Key, 12B Nonce, 16B Salt, 16B Auth Tag)
|
Final Encrypted Payload on Disk (~31,200 Bytes = 31.2 KB)
[Safety Margin: 37.6% BELOW the 50 KB Specification Ceiling]
Persistence is atomic: writes target , execute fsync(), and atomically replace the destination via os.replace().
8. Local Control IPC & CLI User Guide
8.1 Cross-Platform Local Control IPC
The Spore daemon exposes a high-throughput, sub-millisecond local control API:
- Windows: Named Pipe (
\\.\pipe\spore-ipc). - POSIX Linux / macOS: Unix Domain Socket (
~/.spore/spore-ipc.sockor/tmp/spore-ipc.sock). - Fallback: Localhost TCP (
127.0.0.1:9870).
Communication adheres strictly to newline-delimited JSON-RPC 2.0.
Verified Roundtrip Latency Benchmark
- SLA Requirement: < 50\text{ ms}.
- Measured Windows Named Pipe Latency: 0.226\text{ ms} - 0.246\text{ ms} (>200\times faster than SLA).
8.2 JSON-RPC 2.0 Method Catalog
1. get_status
Returns daemon process metrics, peer counts, and watchdog telemetry:
// Request
{"jsonrpc": "2.0", "id": 1, "method": "get_status", "params": {}}
// Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"node_id": "4a7f28bc...",
"pid": 14220,
"uptime_seconds": 1284.2,
"p2p_port": 9872,
"peer_count": 8,
"active_p2p_connections": 6,
"demurrage_pool": 4.128914,
"net_financial_balance": -0.000000,
"total_conductance": 12.4500,
"storage_size_bytes": 1248,
"watchdog": {
"should_yield": false,
"yield_reason": "Normal operation"
}
}
}
2. list_peers
Returns tabular array of 1-hop bilateral neighbors:
// Response Result Element
{
"pubkey": "7b8e...",
"balance": 14.50,
"sent": 22.00,
"received": 7.50,
"reciprocity_ratio": 0.815,
"trust_rating": 0.657,
"allocation_weight": 0.352,
"conductance": 2.45,
"status": "CONNECTED"
}
3. get_balance
Provides financial balance summary and zero-sum conservation status:
{
"positive_credit": 45.20,
"liabilities": 45.20,
"net_financial_balance": 0.00,
"demurrage_pool": 6.84,
"channel_count": 12,
"is_zero_sum_conserved": true
}
4. commit_transaction
Injects an authenticated promissory commitment:
// Request Params
{"peer_pubkey": "7b8e...", "amount": 15.0, "commodity": "C"}
5. add_peer
Initiates outbound 3-way authenticated peering:
// Request Params
{"host": "192.168.1.100", "port": 9872}
8.3 CLI Command Walkthrough
The package registers the console entry point spore:
# 1. Initialize Sovereign Cryptographic Identity spore init # Output: Generates ~/.spore/identity.key and initializes encrypted ledger.dat # 2. Launch Spore Background Daemon spore daemon start # Runs detached in background, writing PID to ~/.spore/daemon.pid # 3. Query Real-Time Status & Latency (<50ms SLA) spore status # 4. Inspect Bilateral Peer Table spore peers # 5. Inspect Balances & Verify Zero-Sum Conservation spore balance # 6. Inject Promissory Value Commitment spore commit 7b8e21... 25.0 --commodity C # 7. Add Remote Mesh Peer spore peer add 10.0.0.42:9872 # 8. Force Manual Demurrage Clearing Epoch spore epoch run # 9. Graceful Daemon Shutdown spore daemon stop
The Spore Protocol has been subjected to exhaustive empirical adversarial stress testing across 51 discrete test suites.
9.1 Mathematical & Physical Invariants
Invariant 1: Thomson Minimum Dissipation Precision
Across extreme random graph topologies with 10^9:1 conductance contrast ratios, the Thomson minimum dissipation equality holds to within numerical machine precision:
View Formal Mathematical Proof & Equations
Invariant 2: High-Stress Zero-Sum Conservation
Under 50,000 randomized concurrent multi-hop settlement commitments across 20-node cluster topologies, the total system residual:
View Formal Mathematical Proof & Equations
remains strictly bounded:
View Formal Mathematical Proof & Equations
Invariant 3: Conductance Bound Invariance
Under high-throughput saturation flows (Q = 100.0), conduit conductances asymptotically saturate without overflow and stay strictly bounded:
View Formal Mathematical Proof & Equations
9.2 Security & Defector Quarantine Guarantees
Sybil Swarm Extraction Ceiling (\Gamma_{\max} = 15.0)
When a coordinated Sybil swarm of K = 100 unvetted nodes simultaneously requests exploratory credit, the dynamic inoculation allocator restricts each node to:
View Formal Mathematical Proof & Equations
Total compute extracted across the entire swarm cannot exceed \Gamma_{\max} = 15.0 units.
Rapid Defector Quarantine (\le 2 Rounds)
Because unreciprocated credit exports are remembered permanently while dynamic inoculation allowance collapses, any peer failing to reciprocate triggers:
View Formal Mathematical Proof & Equations
within \le 2 interaction rounds (empirically in Round 1).
Double-Spend & Non-Adjacent Injection Impossibility
- Third-Party Injection Rejection: Any commitment note where \text{payer\_pubkey} \neq \text{peer\_pubkey} is rejected with an immediate Byzantine fault.
- Exact Replay Rejection: Duplicate signatures and replayed sequence nonces are intercepted by the local bilateral replay filter, preventing double decrements.
10. Reference Implementation Directory Structure
workspace/research/spore_client/
├── pyproject.toml # Standalone package metadata (bygonepath-spore v0.1.0)
├── README.md # Quickstart & user documentation
├── spore_client/
│ ├── __init__.py # Package exports & version string
│ ├── types.py # Dataclasses (ChannelState, RoutingSolution, CommodityBundle)
│ ├── crypto.py # Ed25519 identity, signing, and key derivation
│ ├── storage.py # 76-byte struct packing + zlib + AES-256-GCM engine
│ ├── ledger/
│ │ ├── channel.py # Bilateral promissory channel & zero-sum verification
│ │ └── demurrage.py # Continuous Gesellian decay (delta = 0.85)
│ ├── market/
│ │ ├── trinity.py # Compute Trinity (Carbon, Phosphorus, Nitrogen)
│ │ ├── discrimination.py # Toby Kiers reciprocity, inoculation & trust kernel
│ │ ├── allocation.py # Super-linear allocation (w = T^2.5) & 100% withholding
│ │ └── circuit_breaker.py # BYZ-01 guards & SEC-01 zero-pickle filter
│ ├── router/
│ │ ├── laplacian.py # Conductance Laplacian & Dirichlet boundary solver
│ │ ├── dissipation.py # Thomson minimum dissipation verification
│ │ ├── plasticity.py # Physarum shear-stress ODE adaptation
│ │ └── cycle_clearing.py # Multilateral cyclic debt cancellation
│ ├── mesh/
│ │ ├── wire.py # SPM1 binary framing & message dispatch
│ │ ├── transport.py # 3-way mutual Ed25519 TCP peering
│ │ └── discovery.py # UDP multicast discovery on 239.255.77.88:9871
│ ├── daemon/
│ │ ├── ipc_server.py # Windows Named Pipe / Unix Socket JSON-RPC 2.0
│ │ ├── daemon.py # Background supervisor daemon & scheduler
│ │ └── watchdog.py # Cooperative hardware thermal & VRAM monitor
│ └── cli/
│ └── main.py # Console CLI entry point (spore)
└── tests/
├── conftest.py # Shared fixtures & test keys
├── verify_m1_core.py # Milestone 1 math verification script
├── verify_m2_mesh_ipc.py # Milestone 2 mesh & IPC verification script
├── test_spore_invariants.py # Comprehensive pytest mathematical invariants (24 tests)
├── test_spore_adversarial.py # Comprehensive pytest adversarial defenses (17 tests)
├── test_adversarial_math_physics_stress.py # High-contrast physics & 50k stress tests (10 tests)
└── test_challenger_adversarial_security.py # Security penetration & Sybil swarm tests (18 tests)
11. Conclusion & Protocol Invariance Certificate
The Spore Protocol demonstrates that global proof-of-work, mining races, volatile transaction fees, and multi-gigabyte blockchain ledgers are unnecessary for trustless decentralized value coordination. By grounding economic exchange in local bilateral credit, Gesellian biological demurrage, Toby Kiers partner discrimination, and Hagen-Poiseuille hydrodynamic flow, Spore establishes a resilient, zero-fee, delay-tolerant computational commons that scales organically with network density.
Certified Invariants:
- \sum_{(i,j)} B_{ij}(t) + \sum_i \mathcal{D}_i(t) \equiv 0 (Zero-sum balance conservation).
- \mathcal{D}(\mathbf{Q}) = \mathbf{p}^T \mathbf{K} \mathbf{p} = p_s I_0 within 10^{-5} (Thomson minimum dissipation).
- Storage footprint \le 31.2\text{ KB} for 500 active peers (< 50\text{ KB} SLA).
- IPC Query Latency \le 0.25\text{ ms} on Windows Named Pipe (< 50\text{ ms} SLA).
- Full Defector Withholding (w \equiv 0) triggered in \le 2 rounds.
Intellectual Property & Commercial Licensing Notice
This specification and reference client architecture is published openly by Bygone Path Labs to establish definitive worldwide prior art under 35 U.S.C. § 102. The core theoretical and mathematical models cannot be patented by third-party corporations.
- Non-Commercial Research & Grassroots Use: Licensed under the PolyForm Noncommercial License 1.0.0 for academic and community non-profit implementation (including Purpose Earth grantees).
- Commercial Rights Reserved: All commercial implementations, turnkey hardware appliances (“Bygone Hearth”), and institutional network services are strictly reserved by Bygone Path Labs.