Simulation
An agent-based simulation validates the theoretical claims of BPE. The simulation models a multi-source, multi-sink economy with heterogeneous agent capacities and task types.
Configuration
| Parameter | Default | Description |
|---|---|---|
| Sources | 10 | Payment stream originators |
| Sinks | 50 | Capacity-declaring service agents |
| Task types | 3 | Heterogeneous service categories |
| Timesteps | 1,000 | Simulation horizon |
| EWMA | 0.3 | Capacity smoothing parameter |
Experiments
1. Convergence & Efficiency
Measures allocation efficiency over time. BPE achieves 95.7% versus 93.5% for round-robin and 79.7% for random allocation.
2. Shock Response
Simulates 20% node-kill events and measures recovery time. BPE recovers within ~50 steps.
3. EWMA Sweep
Sensitivity analysis of the smoothing parameter on allocation efficiency and stability.
4. Sybil Resistance
Confirms that stake fragmentation yields strictly negative net profit for all split counts under the capacity cap.
5. Buffer Utilization
With overflow escrow sized at one period of peak demand, buffer stall rates drop from 73% to under 9%.
Running
cd simulation
python bpe_sim.py
Outputs are saved as PDF figures in docs/paper/figures/:
convergence.pdf- Allocation efficiency over timeshock.pdf- Shock response and recoveryewma_sweep.pdf- EWMA parameter sensitivitysybil.pdf- Sybil cost analysisbuffer.pdf- Buffer utilization dynamics
Source
Simulation source is on GitHub.
See Also
- Smart Contracts — All 17 deployed contracts with addresses and source
- TypeScript SDK — Type-safe client for interacting with contracts
- NIP-XX — Nostr relay economics specification