RootIB: RB-20260427020607-D7E8F9A0

# Reward Architecture — Proof-of-Participation Mesh Network

**Creator:** Ryan Barbrick (BarbrickDesign@gmail.com)  
**AI Assistant:** Merlin AI  
**Date:** 2026-04-27  
**Repository:** https://github.com/barbrickdesign/barbrickdesign.github.io  

---

## Overview

Every device that runs a mesh node becomes an **autonomous agent AND a crypto-earning worker**.  
Participation is rewarded through a three-layer stack:

```
Layer 1 → Participation Events    (uptime, relays, missions, recruits, sensors, tasks)
Layer 2 → XP (safe, non-financial)
Layer 3 → Crypto Tokens + Project Coins
```

No speculation. No promises of financial return. Just rewards for participation.

---

## Full Architecture Diagram

```
┌──────────────────────────────────────────────────────────────────────────────────┐
│                         MESH NODE (device / browser)                             │
│                                                                                  │
│  ┌──────────────────┐   build & sign    ┌──────────────────────────────────┐    │
│  │  Node Telemetry  │ ─────────────── → │   RewardPacketFormat             │    │
│  │                  │                   │   (reward-packet-format.js)      │    │
│  │  • uptime        │                   │                                  │    │
│  │  • relay_count   │                   │  buildPacket(raw)                │    │
│  │  • missions      │                   │  signPacket(packet, NODEKEY)     │    │
│  │  • recruit_count │                   │  validatePacket(packet)          │    │
│  │  • sensor_events │                   │  submitRewardPacket(…)           │    │
│  │  • cpu_percent   │                   └────────────┬─────────────────────┘    │
│  │  • tasks         │                                │ AGENT-REWARD-REQUEST     │
│  └──────────────────┘                                │ {node_id, timestamp,     │
│                                                       │  uptime, relay_count,    │
└──────────────────────────────────────────────────────│──missions, signature, …}─┘
                                                        │
                                                        ▼ POST /node-rewards/log
┌──────────────────────────────────────────────────────────────────────────────────┐
│                         BACKEND (Railway / Express)                              │
│                                                                                  │
│  ┌───────────────────────────────────────────────────────────────────────────┐  │
│  │  node-rewards.js  (backend/routes/node-rewards.js)                        │  │
│  │                                                                            │  │
│  │  • recordReward(nodeId, opts)    — hardware-aware USD reward calculation  │  │
│  │  • computeFairnessMultiplier()   — normalises reward vs all active nodes  │  │
│  │  • GET /node-rewards/:nodeId/summary  — per-node USD summary for UI       │  │
│  │  • GET /node-rewards               — global rewards leaderboard           │  │
│  │                                                                            │  │
│  │  Reward formula:                                                           │  │
│  │    wattHours       = NODE_WATT_ESTIMATE × hardwareMultiplier               │  │
│  │                      × (IDLE_POWER_FRAC + LOAD_POWER_FRAC × cpu/100)      │  │
│  │    energyCostUSD   = wattHours / 1000 × KWH_PRICE_USD (default $0.12)     │  │
│  │    taskBonusUSD    = tasksCompleted × PER_TASK_USD (default $0.005)        │  │
│  │    netRewardUSD    = (energyCostUSD + taskBonusUSD) × fairnessMultiplier   │  │
│  │                      − systemCostUSD                                       │  │
│  └───────────────────────────────────────────────────────────────────────────┘  │
│                                                                                  │
└──────────────────────────────┬───────────────────────────────────────────────────┘
                               │ netRewardUSD recorded in in-memory ledger
                               │ (also returned to client as { ok, entry })
                               ▼
┌──────────────────────────────────────────────────────────────────────────────────┐
│                         XP SCORING SYSTEM (client-side)                          │
│                                                                                  │
│  ┌───────────────────────────────────────────────────────────────────────────┐  │
│  │  xp-scoring-system.js  (src/systems/xp-scoring-system.js)                 │  │
│  │                                                                            │  │
│  │  NodeXPScorer.processPacket(packet)                                        │  │
│  │                                                                            │  │
│  │  Event → XP Award (base, multiplied by level)                             │  │
│  │  ─────────────────────────────────────────────                            │  │
│  │  NODE_LAUNCH        75 XP   first node activation                         │  │
│  │  NODE_HEARTBEAT      2 XP   per 30-second interval                        │  │
│  │  RELAY_MESSAGE       3 XP   per relayed message                           │  │
│  │  TASK_COMPLETE      15 XP   per task resolved                             │  │
│  │  MISSION_COMPLETE   50 XP   per agent mission                             │  │
│  │  RECRUIT_NODE      100 XP   per new node recruited                        │  │
│  │  SENSOR_DATA         1 XP   per sensor event                              │  │
│  │  COVERAGE_BONUS     25 XP   >1 hour cumulative uptime                     │  │
│  │  SWARM_MISSION      150 XP  ≥5 missions in one packet                     │  │
│  │                                                                            │  │
│  │  XP Level Ladder (level multiplier applied to all awards)                 │  │
│  │  ─────────────────────────────────────────────────────────                │  │
│  │  👁️  VISITOR      0 XP              Explorer  ×1.0                        │  │
│  │  🌱  APPRENTICE   0–1,000 XP        Explorer  ×1.0                        │  │
│  │  🔧  BUILDER      1,000–5,000 XP   Builder   ×1.5                         │  │
│  │  🏛️  ARCHITECT    5,000–15,000 XP  Automator ×2.0                         │  │
│  │  🔮  ORACLE       15,000–50,000 XP Engineer  ×3.0                         │  │
│  │  ⚔️  COMMANDER    50,000+ XP       Core Dev  ×5.0                          │  │
│  └───────────────────────────────────────────────────────────────────────────┘  │
│                                                                                  │
└──────────────────────────────┬───────────────────────────────────────────────────┘
                               │ totalXP accumulated in localStorage
                               ▼
┌──────────────────────────────────────────────────────────────────────────────────┐
│                         XP → CRYPTO BRIDGE                                       │
│                                                                                  │
│  xp-transmutation.js  (js/xp-transmutation.js)                                   │
│                                                                                  │
│  ┌─────────────────────────────┐   ┌────────────────────────────────────────┐   │
│  │  OKK — Overkill Kulture     │   │  RootIB — Root Idea Block              │   │
│  │                             │   │                                        │   │
│  │  Rate:    100 XP = 1 OKK   │   │  Rate:    500 XP = 1 RootIB            │   │
│  │  Min XP:  1,000 XP         │   │  Min XP:  5,000 XP                     │   │
│  │  Role:    Governance        │   │  Role:    IP protocol / provenance      │   │
│  │                             │   │                                        │   │
│  │  Join: pump.fun/HSag/8e4bmubb│  │  Join: pump.fun/HSag/ko3gg0x0          │   │
│  └─────────────────────────────┘   └────────────────────────────────────────┘   │
│                                                                                  │
│  Distributor wallet: 5cEViMoVC383m92PhLxKRjUQUmLtktCWd2TDxYmKrajN               │
│  Vault wallet:       6HTjfgWZYMbENnMAJJFhxWR2VZDxdze3qV7zznSAsfk                │
│                                                                                  │
└──────────────────────────────┬───────────────────────────────────────────────────┘
                               │
                               ▼
┌──────────────────────────────────────────────────────────────────────────────────┐
│                         PROJECT COIN CREATION FLOW                               │
│                                                                                  │
│  project-coin-creation-flow.js  (src/systems/project-coin-creation-flow.js)      │
│                                                                                  │
│  Trigger: project milestone reached (manual / CI / XP threshold)                 │
│                                                                                  │
│  Tokenomics per project coin (total supply: 1,000,000,000):                     │
│  ┌──────────────────────────────────────────────────────────────────────────┐   │
│  │  50% → Vault wallet (locked, ecosystem utility)                          │   │
│  │  30% → Contributors (XP-weighted distribution)                           │   │
│  │  15% → pump.fun initial liquidity pool                                   │   │
│  │   5% → Reserve / future development                                      │   │
│  └──────────────────────────────────────────────────────────────────────────┘   │
│                                                                                  │
│  Contributor share formula:                                                      │
│    contributorSharePct = (contributorXP / totalContributorXP) × 30%             │
│                                                                                  │
│  Lifecycle states:                                                               │
│    PENDING → CREATING → LIVE → DISTRIBUTING → COMPLETE                          │
│                                   ↓ (on API failure)                            │
│                                 FAILED                                           │
│                                                                                  │
└──────────────────────────────┬───────────────────────────────────────────────────┘
                               │
                               ▼
┌──────────────────────────────────────────────────────────────────────────────────┐
│                         NODE OPERATOR DASHBOARD                                  │
│                                                                                  │
│  node-operator-dashboard.html                                                    │
│                                                                                  │
│  Displays:                                                                       │
│  • Node connection form (node ID + optional Solana wallet)                       │
│  • Live stat cards: uptime, relays, missions, recruits, sensors, tasks           │
│  • XP level progress bar with multiplier                                         │
│  • Token earnings: OKK + RootIB with redeem buttons                             │
│  • USD rewards from backend ledger (/node-rewards/:nodeId/summary)               │
│  • Project coin entries (per-flow contribution share)                            │
│  • XP event log (last 50 events, live-updating)                                 │
│  • 30-second heartbeat timer (auto XP accumulation while page is open)          │
│                                                                                  │
└──────────────────────────────────────────────────────────────────────────────────┘
```

---

## Reward Packet Format

Each node broadcasts a signed `AGENT-REWARD-REQUEST` packet:

```json
{
  "version":       "1.0",
  "node_id":       "my-node-001",
  "timestamp":     "2026-04-27T02:06:07.000Z",
  "uptime":        30,
  "relay_count":   12,
  "missions":      2,
  "recruit_count": 0,
  "sensor_events": 5,
  "cpu_percent":   45,
  "tasks":         3,
  "cores":         8,
  "memory_gb":     16,
  "gpu_in_use":    false,
  "vram_mb":       0,
  "webgpu":        false,
  "battery_pct":   87,
  "reward_mode":   true,
  "ttl":           5,
  "signature":     "<HMAC-SHA256 of canonical payload using NODEKEY>"
}
```

Canonical payload (what is signed):

```
node_id=<id>|timestamp=<ts>|uptime=<n>|relay_count=<n>|missions=<n>|recruit_count=<n>|sensor_events=<n>|tasks=<n>|version=1.0
```

---

## AGENT-ACTIVATE Message (with reward hook)

When a node adopts an agent role, the activation message includes:

```
[AGENT-ACTIVATE]
role=RECRUIT
profile=DEFAULT
reward_mode=ON
ttl=5
action=ADOPT_AND_FORWARD
signature=ROOTIB
```

This causes the node to:
1. Enable reward reporting (`reward_mode=ON`)
2. Start earning XP automatically
3. Become part of the swarm economy
4. Forward the activation to TTL-1 neighbours

---

## XP Scoring Breakdown

| Event | XP (base) | Trigger |
|---|---|---|
| NODE_LAUNCH | 75 | First time node comes online |
| NODE_HEARTBEAT | 2 | Every 30-second interval |
| RELAY_MESSAGE | 3 | Per message forwarded |
| TASK_COMPLETE | 15 | Per task resolved |
| MISSION_COMPLETE | 50 | Per agent mission completed |
| RECRUIT_NODE | 100 | Per new node recruited |
| SENSOR_DATA | 1 | Per sensor event submitted |
| COVERAGE_BONUS | 25 | Cumulative session uptime > 1h |
| SWARM_MISSION | 150 | ≥5 missions in one packet |

Level multipliers stack on top of all base awards.

---

## Data Flow Summary

```
Node telemetry
  → reward-packet-format.js (build, sign, validate)
  → POST /node-rewards/log (backend USD calculation)
  → xp-scoring-system.js (XP award per event)
  → localStorage (persistent XP state)
  → xp-transmutation.js (XP → OKK / RootIB tokens)
  → project-coin-creation-flow.js (project milestone → pump.fun coin → distribution)
  → node-operator-dashboard.html (live UI for operators)
```

---

## Key Addresses & Links

| Resource | Value |
|---|---|
| Vault wallet (Solana) | `6HTjfgWZYMbENnMAJJFhxWR2VZDxdze3qV7zznSAsfk` |
| OKK token | `FwHB1xfXJWRz4ogkEdrt3LX7j9tQYkVwmN8Wi7eupump` |
| RootIB token | `FwHB1xfXJWRz4ogkEdrt3LX7j9tQYkVwmN8Wi7eupump` |
| Node operator join | https://join.pump.fun/HSag/8e4bmubb |
| General onboarding | https://join.pump.fun/HSag/ko3gg0x0 |
| Referral URL | https://refer.pump.fun/DiamondBoi |
| Backend origin | https://barbrickdesigngithubio-production.up.railway.app |

---

## Source Files

| File | Purpose |
|---|---|
| `src/systems/reward-packet-format.js` | Packet schema, signing, validation, submission |
| `src/systems/xp-scoring-system.js` | XP award table, level ladder, token conversion |
| `src/systems/project-coin-creation-flow.js` | Project coin lifecycle, distribution engine |
| `node-operator-dashboard.html` | Live dashboard for node operators |
| `backend/routes/node-rewards.js` | USD reward calculation (backend) |
| `js/xp-transmutation.js` | XP → OKK / RootIB on-chain bridge |
| `js/xp-rewards-sync.js` | XP level sync across platform pages |
| `src/systems/pumpfun-ecosystem-config.js` | Canonical pump.fun constants |

---

*© 2008-2026 Ryan Barbrick (Barbrick Design). All Rights Reserved.*
