yakmesh 2.8.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/CHANGELOG.md +637 -0
  2. package/CONTRIBUTING.md +42 -0
  3. package/Caddyfile +77 -0
  4. package/README.md +119 -29
  5. package/adapters/adapter-mlv-bible/README.md +124 -0
  6. package/adapters/adapter-mlv-bible/index.js +400 -0
  7. package/adapters/chat-mod-adapter.js +532 -0
  8. package/adapters/content-adapter.js +273 -0
  9. package/content/api.js +50 -41
  10. package/content/index.js +2 -2
  11. package/content/store.js +355 -173
  12. package/dashboard/index.html +19 -3
  13. package/database/replication.js +117 -37
  14. package/docs/CRYPTO-AGILITY.md +204 -0
  15. package/docs/MTLS-RESEARCH.md +367 -0
  16. package/docs/NAMCHE-SPEC.md +681 -0
  17. package/docs/PEERQUANTA-YAKMESH-INTEGRATION.md +407 -0
  18. package/docs/PRECISION-DISCLOSURE.md +96 -0
  19. package/docs/README.md +76 -0
  20. package/docs/ROADMAP-2.4.0.md +447 -0
  21. package/docs/ROADMAP-2.5.0.md +244 -0
  22. package/docs/SECURITY-AUDIT-REPORT.md +306 -0
  23. package/docs/SST-INTEGRATION.md +712 -0
  24. package/docs/STEADYWATCH-IMPLEMENTATION.md +303 -0
  25. package/docs/TERNARY-AUDIT-REPORT.md +247 -0
  26. package/docs/TME-FAQ.md +221 -0
  27. package/docs/WHITEPAPER.md +623 -0
  28. package/docs/adapters.html +1001 -0
  29. package/docs/advanced-systems.html +1045 -0
  30. package/docs/annex.html +1046 -0
  31. package/docs/api.html +970 -0
  32. package/docs/business/response-templates.md +160 -0
  33. package/docs/c2c.html +1225 -0
  34. package/docs/cli.html +1332 -0
  35. package/docs/configuration.html +1248 -0
  36. package/docs/darshan.html +1085 -0
  37. package/docs/dharma.html +966 -0
  38. package/docs/docs-bundle.html +1075 -0
  39. package/docs/docs.css +3120 -0
  40. package/docs/docs.js +556 -0
  41. package/docs/doko.html +969 -0
  42. package/docs/geo-proof.html +858 -0
  43. package/docs/getting-started.html +840 -0
  44. package/docs/gumba-tutorial.html +1144 -0
  45. package/docs/gumba.html +1098 -0
  46. package/docs/index.html +914 -0
  47. package/docs/jhilke.html +1312 -0
  48. package/docs/karma.html +1100 -0
  49. package/docs/katha.html +1037 -0
  50. package/docs/lama.html +978 -0
  51. package/docs/mandala.html +1067 -0
  52. package/docs/mani.html +964 -0
  53. package/docs/mantra.html +967 -0
  54. package/docs/mesh.html +1409 -0
  55. package/docs/nakpak.html +869 -0
  56. package/docs/namche.html +928 -0
  57. package/docs/nav-order.json +53 -0
  58. package/docs/prahari.html +1043 -0
  59. package/docs/prism-bash.min.js +1 -0
  60. package/docs/prism-javascript.min.js +1 -0
  61. package/docs/prism-json.min.js +1 -0
  62. package/docs/prism-tomorrow.min.css +1 -0
  63. package/docs/prism.min.js +1 -0
  64. package/docs/privacy.html +699 -0
  65. package/docs/quick-reference.html +1181 -0
  66. package/docs/sakshi.html +1402 -0
  67. package/docs/sandboxing.md +386 -0
  68. package/docs/seva.html +911 -0
  69. package/docs/sherpa.html +871 -0
  70. package/docs/studio.html +860 -0
  71. package/docs/stupa.html +995 -0
  72. package/docs/tailwind.min.css +2 -0
  73. package/docs/tattva.html +1332 -0
  74. package/docs/terms.html +686 -0
  75. package/docs/time-server-deployment.md +166 -0
  76. package/docs/time-sources.html +1392 -0
  77. package/docs/tivra.html +1127 -0
  78. package/docs/trademark-policy.html +686 -0
  79. package/docs/tribhuj.html +1183 -0
  80. package/docs/trust-security.html +1029 -0
  81. package/docs/tutorials/backup-recovery.html +654 -0
  82. package/docs/tutorials/dashboard.html +604 -0
  83. package/docs/tutorials/domain-setup.html +605 -0
  84. package/docs/tutorials/host-website.html +456 -0
  85. package/docs/tutorials/mesh-network.html +505 -0
  86. package/docs/tutorials/mobile-access.html +445 -0
  87. package/docs/tutorials/privacy.html +467 -0
  88. package/docs/tutorials/raspberry-pi.html +600 -0
  89. package/docs/tutorials/security-basics.html +539 -0
  90. package/docs/tutorials/share-files.html +431 -0
  91. package/docs/tutorials/troubleshooting.html +637 -0
  92. package/docs/tutorials/trust-karma.html +419 -0
  93. package/docs/tutorials/yak-protocol.html +456 -0
  94. package/docs/tutorials.html +1034 -0
  95. package/docs/vani.html +1270 -0
  96. package/docs/webserver.html +809 -0
  97. package/docs/yak-protocol.html +940 -0
  98. package/docs/yak-timeserver-design.md +475 -0
  99. package/docs/yakapp.html +1015 -0
  100. package/docs/ypc27.html +1069 -0
  101. package/docs/yurt.html +1344 -0
  102. package/embedded-docs/bundle.js +334 -74
  103. package/gossip/protocol.js +247 -27
  104. package/identity/key-resolver.js +262 -0
  105. package/identity/machine-seed.js +632 -0
  106. package/identity/node-key.js +669 -368
  107. package/identity/tribhuj-ratchet.js +506 -0
  108. package/knowledge-base.js +37 -8
  109. package/launcher/yakmesh.bat +62 -0
  110. package/launcher/yakmesh.sh +70 -0
  111. package/mesh/annex.js +462 -108
  112. package/mesh/beacon-broadcast.js +113 -1
  113. package/mesh/darshan.js +1718 -0
  114. package/mesh/gumba.js +1567 -0
  115. package/mesh/jhilke.js +651 -0
  116. package/mesh/katha.js +1012 -0
  117. package/mesh/nakpak-routing.js +8 -5
  118. package/mesh/network.js +724 -34
  119. package/mesh/pulse-sync.js +4 -1
  120. package/mesh/rate-limiter.js +127 -15
  121. package/mesh/seva.js +526 -0
  122. package/mesh/sherpa-discovery.js +89 -8
  123. package/mesh/sybil-defense.js +19 -5
  124. package/mesh/temporal-encoder.js +4 -3
  125. package/mesh/vani.js +1364 -0
  126. package/mesh/yurt.js +1340 -0
  127. package/models/entropy-sentinel.onnx +0 -0
  128. package/models/karma-trust.onnx +0 -0
  129. package/models/manifest.json +43 -0
  130. package/models/sakshi-anomaly.onnx +0 -0
  131. package/oracle/code-proof-protocol.js +7 -6
  132. package/oracle/codebase-lock.js +257 -28
  133. package/oracle/index.js +74 -15
  134. package/oracle/ma902-snmp.js +678 -0
  135. package/oracle/module-sealer.js +5 -3
  136. package/oracle/network-identity.js +16 -0
  137. package/oracle/packet-checksum.js +201 -0
  138. package/oracle/sst.js +579 -0
  139. package/oracle/ternary-144t.js +714 -0
  140. package/oracle/ternary-ml.js +481 -0
  141. package/oracle/time-api.js +239 -0
  142. package/oracle/time-source.js +137 -47
  143. package/oracle/validation-oracle-hardened.js +1111 -1071
  144. package/oracle/validation-oracle.js +4 -2
  145. package/oracle/ypc27.js +211 -0
  146. package/package.json +20 -3
  147. package/protocol/yak-handler.js +35 -9
  148. package/protocol/yak-protocol.js +28 -13
  149. package/reference/cpp/yakmesh_mceliece_shard.cpp +168 -0
  150. package/reference/cpp/yakmesh_ypc27.cpp +179 -0
  151. package/sbom.json +87 -0
  152. package/scripts/security-audit.mjs +264 -0
  153. package/scripts/update-docs-nav.js +194 -0
  154. package/scripts/update-docs-sidebar.cjs +164 -0
  155. package/security/crypto-config.js +4 -3
  156. package/security/dharma-moderation.js +517 -0
  157. package/security/doko-identity.js +193 -143
  158. package/security/domain-consensus.js +86 -85
  159. package/security/fs-hardening.js +620 -0
  160. package/security/hardware-attestation.js +5 -3
  161. package/security/hybrid-trust.js +227 -87
  162. package/security/karma-rate-limiter.js +692 -0
  163. package/security/khata-protocol.js +22 -21
  164. package/security/khata-trust-integration.js +277 -150
  165. package/security/memory-safety.js +635 -0
  166. package/security/mesh-auth.js +11 -10
  167. package/security/mesh-revocation.js +373 -5
  168. package/security/namche-gateway.js +298 -69
  169. package/security/sakshi.js +460 -3
  170. package/security/sangha.js +770 -0
  171. package/security/secure-config.js +473 -0
  172. package/security/silicon-parity.js +13 -10
  173. package/security/steadywatch.js +1142 -0
  174. package/security/strike-system.js +32 -3
  175. package/security/temporal-signing.js +488 -0
  176. package/security/trit-commitment.js +464 -0
  177. package/server/crypto/annex.js +247 -0
  178. package/server/darshan-api.js +343 -0
  179. package/server/index.js +3259 -362
  180. package/server/komm-api.js +668 -0
  181. package/utils/accel.js +2273 -0
  182. package/utils/ternary-id.js +79 -0
  183. package/utils/verify-worker.js +57 -0
  184. package/webserver/index.js +95 -5
  185. package/assets/yakmesh-logo.png +0 -0
  186. package/assets/yakmesh-logo.svg +0 -80
  187. package/assets/yakmesh-logo2.png +0 -0
  188. package/assets/yakmesh-logo2sm.png +0 -0
  189. package/assets/ymsm.png +0 -0
  190. package/website/assets/silhouettes/adapters.svg +0 -107
  191. package/website/assets/silhouettes/api-endpoints.svg +0 -115
  192. package/website/assets/silhouettes/atomic-clock.svg +0 -83
  193. package/website/assets/silhouettes/base-camp.svg +0 -81
  194. package/website/assets/silhouettes/bridge.svg +0 -69
  195. package/website/assets/silhouettes/docs-bundle.svg +0 -113
  196. package/website/assets/silhouettes/doko-basket.svg +0 -70
  197. package/website/assets/silhouettes/fortress.svg +0 -93
  198. package/website/assets/silhouettes/gateway.svg +0 -54
  199. package/website/assets/silhouettes/gears.svg +0 -93
  200. package/website/assets/silhouettes/globe-satellite.svg +0 -67
  201. package/website/assets/silhouettes/karma-wheel.svg +0 -137
  202. package/website/assets/silhouettes/lama-council.svg +0 -141
  203. package/website/assets/silhouettes/mandala-network.svg +0 -169
  204. package/website/assets/silhouettes/mani-stones.svg +0 -149
  205. package/website/assets/silhouettes/mantra-wheel.svg +0 -116
  206. package/website/assets/silhouettes/mesh-nodes.svg +0 -113
  207. package/website/assets/silhouettes/nakpak.svg +0 -56
  208. package/website/assets/silhouettes/peak-lightning.svg +0 -73
  209. package/website/assets/silhouettes/sherpa.svg +0 -69
  210. package/website/assets/silhouettes/stupa-tower.svg +0 -119
  211. package/website/assets/silhouettes/tattva-eye.svg +0 -78
  212. package/website/assets/silhouettes/terminal.svg +0 -74
  213. package/website/assets/silhouettes/webserver.svg +0 -145
  214. package/website/assets/silhouettes/yak.svg +0 -78
  215. package/website/assets/yakmesh-logo.png +0 -0
  216. package/website/assets/yakmesh-logo.webp +0 -0
  217. package/website/assets/yakmesh-logo128x140.webp +0 -0
  218. package/website/assets/yakmesh-logo2.png +0 -0
  219. package/website/assets/yakmesh-logo2.svg +0 -51
  220. package/website/assets/yakmesh-logo40x44.webp +0 -0
  221. package/website/assets/yakmesh.gif +0 -0
  222. package/website/assets/yakmesh.ico +0 -0
  223. package/website/assets/yakmesh.jpg +0 -0
  224. package/website/assets/yakmesh.pdf +0 -0
  225. package/website/assets/yakmesh.png +0 -0
  226. package/website/assets/yakmesh.svg +0 -70
  227. package/website/assets/yakmesh128.webp +0 -0
  228. package/website/assets/yakmesh32.png +0 -0
  229. package/website/assets/yakmesh32.svg +0 -65
  230. package/website/assets/yakmesh32o.ico +0 -2
  231. package/website/assets/yakmesh32o.svg +0 -65
  232. package/website/assets/yakmesh32o.svgz +0 -0
@@ -0,0 +1,623 @@
1
+ # YAKMESH™ Whitepaper
2
+
3
+ ## A Hardened Yielding Atomic Kernel for Post-Quantum Mesh Orchestration
4
+
5
+ **Author:** yakmesh.dev
6
+ **Date:** January 2026
7
+ **USPTO Serial No:** 99594620
8
+ **Version:** 1.5.0
9
+
10
+ ---
11
+
12
+ ## Table of Contents
13
+
14
+ 1. [Executive Summary](#1-executive-summary)
15
+ 2. [Theoretical Framework: The Yielding Atomic Kernel](#2-theoretical-framework-the-yielding-atomic-kernel)
16
+ 3. [Technical Architecture](#3-technical-architecture)
17
+ - 3.1 [Physical Layer: Hardware Alignment](#31-physical-layer-hardware-alignment)
18
+ - 3.2 [Temporal Matrix Encoding (TME)](#32-temporal-matrix-encoding-tme)
19
+ - 3.3 [Security Hardening Modules](#33-security-hardening-modules)
20
+ - 3.4 [Yakmesh Annex: Encrypted P2P Channels](#34-yakmesh-annex-encrypted-p2p-channels)
21
+ 4. [Comparison: YAKMESH vs. Walrus (Red Stuff)](#4-comparison-yakmesh-vs-walrus-red-stuff)
22
+ 5. [Security & Cryptographic Hardening](#5-security--cryptographic-hardening)
23
+ 6. [Real-World Use Cases](#6-real-world-use-cases)
24
+ 7. [Roadmap & Conclusion](#7-roadmap--conclusion)
25
+
26
+ ---
27
+
28
+ ## 1. Executive Summary
29
+
30
+ ### The Problem
31
+
32
+ Current decentralized networks struggle with the **"Inconsistency Gap"**—the latency between nodes in asynchronous environments. Existing protocols (like Walrus/Red Stuff) solve this for **storage** but fail in **real-time transmission**.
33
+
34
+ The gap manifests in three critical ways:
35
+
36
+ 1. **Latency Amplification:** Retransmission-based recovery adds round-trip delays
37
+ 2. **Harvest Now, Decrypt Later (HNDL):** Quantum computers will break today's encryption
38
+ 3. **Byzantine Vulnerability:** Malicious nodes can poison routing tables and timing
39
+
40
+ ### The Solution
41
+
42
+ YAKMESH introduces the **Yielding Atomic Kernel (YAK)**, a networking layer that utilizes:
43
+
44
+ - **Hardware-based atomic timing** (PCIe/PTP) for nanosecond synchronization
45
+ - **Post-Quantum Cryptography** (ML-DSA-65, FIPS 204) for quantum resistance
46
+ - **Temporal Matrix Encoding (TME)** for zero-retransmit packet recovery
47
+
48
+ The result: a "Synchronous Mesh" in an asynchronous world.
49
+
50
+ ---
51
+
52
+ ## 2. Theoretical Framework: The Yielding Atomic Kernel
53
+
54
+ ### 2.1 The "Yielding" Concept
55
+
56
+ The kernel is designed to **gracefully degrade** under high interference without losing synchronization. When a node experiences:
57
+
58
+ - High packet loss → TME reconstructs from temporal slices
59
+ - Clock drift → Atomic sync re-calibrates from mesh consensus
60
+ - Byzantine attack → NAVR and reputation systems isolate the threat
61
+
62
+ The kernel "yields" resources to maintain core timing integrity, never sacrificing the mesh timebase for throughput.
63
+
64
+ ### 2.2 Atomic Precision
65
+
66
+ YAKMESH utilizes nanosecond-level hardware timestamps to eliminate "drift" in mesh routing tables:
67
+
68
+ | Timing Method | Precision | YAKMESH Suitability |
69
+ |---------------|-----------|---------------------|
70
+ | NTP | ~10ms | ❌ Too coarse |
71
+ | SNTP | ~1ms | ❌ Still insufficient |
72
+ | PTP (IEEE 1588) | ~100ns | ✅ Baseline |
73
+ | PCIe Atomic Clock | ~1ns | ✅ Optimal |
74
+
75
+ This precision enables **Temporal Matrix Encoding**—impossible with traditional timing.
76
+
77
+ ### 2.3 Security Layer
78
+
79
+ Integration of NIST-standardized Post-Quantum Cryptography:
80
+
81
+ - **ML-DSA-65 (FIPS 204):** Digital signatures resistant to Shor's algorithm
82
+ - **Cryptographic Time Binding:** Each packet's hash includes its timestamp
83
+ - **Temporal Chain Integrity:** Packets form an immutable chain via `prevTemporalHash`
84
+
85
+ ---
86
+
87
+ ## 3. Technical Architecture
88
+
89
+ ### 3.1 Physical Layer: Hardware Alignment
90
+
91
+ #### The Role of PCIe Atomic Clock Interfaces
92
+
93
+ Traditional network timing (NTP/SNTP) suffers from:
94
+
95
+ - **Jitter:** Variable network latency corrupts timestamps
96
+ - **Drift:** Crystal oscillators diverge over hours
97
+ - **Spoofing:** Software timestamps can be forged
98
+
99
+ YAKMESH's PCIe-based timing interface establishes a **Universal Mesh Timebase**:
100
+
101
+ ```
102
+ ┌─────────────────────────────────────────────────────────────┐
103
+ │ YAKMESH NODE │
104
+ ├─────────────────────────────────────────────────────────────┤
105
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
106
+ │ │ Application │ │ YAK Core │ │ PCIe Clock │ │
107
+ │ │ Layer │◄──►│ (Kernel) │◄──►│ Interface │ │
108
+ │ └──────────────┘ └──────────────┘ └──────────────┘ │
109
+ │ │ │ │ │
110
+ │ ▼ ▼ ▼ │
111
+ │ ┌──────────────────────────────────────────────────────┐ │
112
+ │ │ Atomic Mesh Timebase (±1ns) │ │
113
+ │ └──────────────────────────────────────────────────────┘ │
114
+ └─────────────────────────────────────────────────────────────┘
115
+ ```
116
+
117
+ #### Comparative Analysis: Why NTP is Insufficient
118
+
119
+ | Requirement | NTP | YAKMESH Atomic |
120
+ |-------------|-----|----------------|
121
+ | Sub-ms routing decisions | ❌ | ✅ |
122
+ | Temporal slice alignment | ❌ | ✅ |
123
+ | Tamper-resistant timestamps | ❌ | ✅ |
124
+ | Cross-continent sync | ⚠️ ~50ms | ✅ ~100ns |
125
+
126
+ ---
127
+
128
+ ### 3.2 Temporal Matrix Encoding (TME)
129
+
130
+ > *"Time IS the redundancy dimension."*
131
+
132
+ #### The Space vs. Time Paradigm
133
+
134
+ Traditional erasure coding (Walrus/Red Stuff) treats a network like a **Hard Drive**—data is spread across spatial nodes.
135
+
136
+ YAKMESH TME treats the network like a **Synthesizer**—data is spread across temporal intervals.
137
+
138
+ | Approach | Walrus (Spatial) | YAKMESH (Temporal) |
139
+ |----------|------------------|-------------------|
140
+ | **Encoding Dimension** | Space (N nodes) | Time (T intervals) |
141
+ | **Recovery Method** | Quorum from K nodes | Reconstruction from adjacent slices |
142
+ | **Sync Requirement** | Asynchronous | Atomically synchronized |
143
+ | **Optimized For** | Static blobs | Dynamic packet flow |
144
+ | **Latency on Loss** | Full retransmit | Zero (parity recovery) |
145
+
146
+ #### How TME Works
147
+
148
+ **Step 1: Temporal Slicing**
149
+
150
+ A message is divided into slices, each bound to a specific timestamp:
151
+
152
+ ```
153
+ Original Message: "Hello YAKMESH World!"
154
+
155
+ Slice 0 @ T=0ns: "Hello" + timestamp + prevHash → temporalHash₀
156
+ Slice 1 @ T=50ms: " YAKM" + timestamp + hash₀ → temporalHash₁
157
+ Slice 2 @ T=100ms: "ESH W" + timestamp + hash₁ → temporalHash₂
158
+ Slice 3 @ T=150ms: "orld!" + timestamp + hash₂ → temporalHash₃
159
+ ```
160
+
161
+ **Step 2: Cryptographic Time Binding**
162
+
163
+ Each slice's `temporalHash` is computed from:
164
+
165
+ ```javascript
166
+ temporalHash = SHA256(
167
+ data + // Payload bytes
168
+ timestamp + // Nanosecond precision BigInt
169
+ sequenceNumber + // Position in stream
170
+ streamId + // Unique stream identifier
171
+ prevTemporalHash + // Chain to previous slice
172
+ meshPosition // [x, y, z] topology coordinates
173
+ )
174
+ ```
175
+
176
+ This creates an **immutable temporal chain**. If any slice is tampered with, the chain breaks.
177
+
178
+ **Step 3: Multi-Path Transmission**
179
+
180
+ Slices are sent across different mesh paths:
181
+
182
+ ```
183
+ Sender ──Path A──► Slice 0 ──────────► Receiver
184
+ ──Path B──► Slice 1 ──────────► Receiver
185
+ ──Path C──► Slice 2 ──(LOST)──► Receiver
186
+ ──Path A──► Slice 3 ──────────► Receiver
187
+ ```
188
+
189
+ **Step 4: Temporal Reconstruction**
190
+
191
+ If Slice 2 is lost, the receiver:
192
+
193
+ 1. Detects the gap via sequence numbers
194
+ 2. Verifies Slice 3's `prevTemporalHash` points to the expected Slice 2 hash
195
+ 3. Requests **Timing Proofs** from mesh neighbors who saw Slice 2
196
+ 4. Achieves consensus: "Slice 2 existed with hash X at time T"
197
+ 5. Reconstructs or requests the specific slice from a neighbor
198
+
199
+ **No full retransmit. No round-trip delay.**
200
+
201
+ #### The Atomic Sync Secret Sauce
202
+
203
+ TME is **only possible** because of atomic synchronization:
204
+
205
+ - **Traditional PTP/NTP:** Has too much jitter. The receiver can't distinguish "late packet" from "wrong temporal slice."
206
+ - **YAKMESH Atomic Sync:** All nodes share Universal Mesh Time. A packet arriving at T+5ns is unambiguously Slice N, not Slice N+1.
207
+
208
+ You are essentially treating the entire mesh as one giant, distributed CPU clock.
209
+
210
+ #### Implementation: Core Classes
211
+
212
+ ```javascript
213
+ import {
214
+ TemporalSlice, // Atomic unit with time binding
215
+ TemporalStream, // Message → slices with chaining
216
+ TemporalReconstructor, // Recovery via timing proofs
217
+ TemporalMeshEncoder // High-level encode/decode API
218
+ } from 'yakmesh/mesh/temporal-encoder.js';
219
+
220
+ // Encode a message
221
+ const encoder = new TemporalMeshEncoder({ meshPosition: [1, 2, 3] });
222
+ const { streamId, slices, metadata } = encoder.encode('Hello TME!');
223
+
224
+ // Receive and decode
225
+ const decoder = new TemporalMeshEncoder();
226
+ decoder.initReceive({ streamId, ...metadata });
227
+ for (const slice of slices) {
228
+ decoder.receiveSlice(slice);
229
+ }
230
+ const { success, data } = decoder.decode(streamId);
231
+ ```
232
+
233
+ ---
234
+
235
+ ### 3.3 Security Hardening Modules
236
+
237
+ YAKMESH includes defense-in-depth security layers:
238
+
239
+ #### 3.3.1 NAVR (Network Assimilation Validation Routine)
240
+
241
+ > *"You're NAVR getting in without solving this puzzle."*
242
+
243
+ A computational challenge for new node registration:
244
+
245
+ - **Not blockchain PoW:** One-time puzzle, not per-transaction mining
246
+ - **Configurable difficulty:** Scales with network threat level
247
+ - **Purpose:** Prevents Sybil attacks by making identity creation costly
248
+
249
+ ```javascript
250
+ import { NAVR } from 'yakmesh/mesh/sybil-defense.js';
251
+
252
+ const navr = new NAVR({ difficulty: 16 });
253
+ const challenge = navr.createChallenge('new-node-id');
254
+ const solution = navr.solve(challenge); // CPU-bound work
255
+ const valid = navr.verify(challenge, solution);
256
+ ```
257
+
258
+ #### 3.3.2 Reputation Tracker
259
+
260
+ Trust scoring for mesh nodes (0.0 to 1.0):
261
+
262
+ | Behavior | Trust Impact |
263
+ |----------|--------------|
264
+ | Valid packets forwarded | +0.01 |
265
+ | Timing proof provided | +0.02 |
266
+ | Invalid signature | -0.1 |
267
+ | Timing manipulation | -0.3 |
268
+ | Sybil attempt detected | -1.0 (ban) |
269
+
270
+ #### 3.3.3 Subnet Diversity
271
+
272
+ Eclipse attack prevention:
273
+
274
+ - Maximum 3 connections per /24 subnet
275
+ - Ensures no single ISP can dominate a node's view
276
+ - Automatic connection balancing
277
+
278
+ #### 3.3.4 Replay Defense
279
+
280
+ Multi-layer protection against message replay:
281
+
282
+ | Layer | Mechanism | Window |
283
+ |-------|-----------|--------|
284
+ | Nonce Registry | 32-byte cryptographic nonces | 1 hour expiry |
285
+ | Timestamp Validator | 10-minute freshness window | ±10 minutes |
286
+ | Sequence Tracker | Per-sender message ordering | 64-item window |
287
+
288
+ #### 3.3.5 Message Validator
289
+
290
+ Amplification attack prevention:
291
+
292
+ | Message Type | Size Limit |
293
+ |--------------|------------|
294
+ | Gossip | 64 KB |
295
+ | Handshake | 8 KB |
296
+ | Listing | 128 KB |
297
+ | Maximum | 1 MB |
298
+
299
+ Additional protections:
300
+
301
+ - Nesting depth limit: 10 levels
302
+ - Prototype pollution protection (`__proto__` blocked)
303
+
304
+ ---
305
+
306
+ ### 3.4 Yakmesh Annex: Encrypted P2P Channels
307
+
308
+ > *"Changes pass through math alone."*
309
+
310
+ #### The Need for Sovereign Data Channels
311
+
312
+ While the gossip protocol and TME handle public mesh communication, many use cases require **private, authenticated messaging** between specific peers:
313
+
314
+ - Beacon acknowledgments that shouldn't reveal recipient identity
315
+ - Application-specific payloads requiring confidentiality
316
+ - Authentication tokens for CDN/site access
317
+ - Direct peer-to-peer secure messaging
318
+
319
+ #### ANNEX: Autonomous Network Negotiated Encrypted eXchange
320
+
321
+ ANNEX establishes encrypted point-to-point channels using post-quantum cryptography:
322
+
323
+ | Component | Algorithm | Purpose |
324
+ |-----------|-----------|---------|
325
+ | **Key Exchange** | ML-KEM-768 (Kyber) | NIST FIPS 203 post-quantum KEM |
326
+ | **Encryption** | AES-256-GCM | Authenticated symmetric encryption |
327
+ | **Authentication** | ML-DSA-65 | Signature verification on all messages |
328
+ | **Replay Defense** | Sequence + AAD | Sequence numbers bound to session |
329
+
330
+ #### How ANNEX Works
331
+
332
+ **Step 1: Channel Opening (Key Exchange)**
333
+
334
+ ```text
335
+ Initiator Responder
336
+ │ │
337
+ │ KEY_EXCHANGE(sessionId, kemPublicKey) │
338
+ │────────────────────────────────────────►│
339
+ │ │
340
+ │ KEY_RESPONSE(kemPublicKey, kemCiphertext)│
341
+ │◄────────────────────────────────────────│
342
+ │ │
343
+ ▼ Both derive shared secret via ML-KEM ▼
344
+ [═══════ Encrypted Channel Established ═══════]
345
+ ```
346
+
347
+ **Step 2: Message Encryption**
348
+
349
+ Each message is encrypted with AES-256-GCM:
350
+
351
+ ```javascript
352
+ // Additional Authenticated Data (AAD) includes session + sequence
353
+ const aad = `${sessionId}:${sequenceNumber}`;
354
+
355
+ // Encrypt with random nonce
356
+ const { ciphertext, authTag, nonce } = encrypt(payload, key, aad);
357
+
358
+ // Envelope is signed with ML-DSA-65
359
+ envelope.signature = identity.sign(envelope);
360
+ ```
361
+
362
+ **Step 3: Perfect Forward Secrecy**
363
+
364
+ ANNEX automatically re-keys sessions:
365
+
366
+ | Trigger | Action |
367
+ |---------|--------|
368
+ | 5 minutes elapsed | Generate new ephemeral KEM keys |
369
+ | 10,000 messages sent | Force re-key |
370
+ | Session expiry (1 hour) | Close and re-establish |
371
+
372
+ This ensures that compromise of a session key doesn't expose past or future communications.
373
+
374
+ #### Security Properties
375
+
376
+ 1. **Post-Quantum Confidentiality:** ML-KEM-768 is resistant to Shor's algorithm
377
+ 2. **Authentication:** Every envelope signed with ML-DSA-65
378
+ 3. **Replay Protection:** Sequence numbers + AAD verification
379
+ 4. **Forward Secrecy:** Automatic ephemeral key rotation
380
+ 5. **Integrity:** AES-GCM authenticated encryption
381
+
382
+ #### API Usage
383
+
384
+ ```javascript
385
+ import { Annex } from 'yakmesh/mesh/annex.js';
386
+
387
+ // Initialize with node identity and mesh connection
388
+ const annex = new Annex({ identity, mesh });
389
+
390
+ // Open encrypted channel to peer
391
+ await annex.openChannel(peerNodeId);
392
+
393
+ // Send encrypted message
394
+ await annex.send(peerNodeId, {
395
+ type: 'beacon_ack',
396
+ beaconId: 'emergency-123',
397
+ ack: true,
398
+ });
399
+
400
+ // Receive messages
401
+ annex.onMessage(({ from, payload, sessionId }) => {
402
+ console.log(`Decrypted from ${from}:`, payload);
403
+ });
404
+
405
+ // Close channel
406
+ await annex.closeChannel(peerNodeId);
407
+ ```
408
+
409
+ #### Integration with Yakmesh Protocol Stack
410
+
411
+ ANNEX slots into the protocol stack as the private messaging layer:
412
+
413
+ ```text
414
+ ┌─────────────────────────────────────────────────────────────┐
415
+ │ YAKMESH PROTOCOL STACK │
416
+ ├─────────────────────────────────────────────────────────────┤
417
+ │ HTTP API │ Public content delivery (CDN layer) │
418
+ ├─────────────────────────────────────────────────────────────┤
419
+ │ ANNEX │ ML-KEM768 + AES-256-GCM encrypted P2P │
420
+ ├─────────────────────────────────────────────────────────────┤
421
+ │ Gossip │ ML-DSA-65 signed message propagation │
422
+ ├─────────────────────────────────────────────────────────────┤
423
+ │ Beacon │ Flood-based priority broadcasts │
424
+ ├─────────────────────────────────────────────────────────────┤
425
+ │ Nakpak │ Post-quantum onion routing (NAKPAK) │
426
+ ├─────────────────────────────────────────────────────────────┤
427
+ │ Sherpa │ Peer discovery DHT (SHERPA) │
428
+ ├─────────────────────────────────────────────────────────────┤
429
+ │ Mesh Core │ WebSocket + Code Proof Protocol │
430
+ └─────────────────────────────────────────────────────────────┘
431
+ ```
432
+
433
+ ---
434
+
435
+ ## 4. Comparison: YAKMESH vs. Walrus (Red Stuff)
436
+
437
+ ### 4.1 Storage vs. Flow
438
+
439
+ | Aspect | Walrus | YAKMESH |
440
+ |--------|--------|---------|
441
+ | **Purpose** | Static blob storage | Dynamic packet transmission |
442
+ | **Data Lifetime** | Epochs (days/weeks) | Milliseconds |
443
+ | **Node Requirements** | Storage capacity | Atomic timing hardware |
444
+ | **Recovery Unit** | Data shard | Temporal slice |
445
+
446
+ ### 4.2 Encoding Philosophy
447
+
448
+ **Walrus (2D Erasure Coding):**
449
+ ```
450
+ Node1 Node2 Node3
451
+ Row1 [A] [B] [P_row1]
452
+ Row2 [C] [D] [P_row2]
453
+ [P_c1] [P_c2]
454
+
455
+ Recovery: Download from surviving nodes
456
+ ```
457
+
458
+ **YAKMESH (Temporal Matrix Encoding):**
459
+ ```
460
+ T=0ns: [Slice0] → Path A
461
+ T=50ms: [Slice1] → Path B
462
+ T=100ms: [Slice2] → Path C
463
+ T=150ms: [Slice3] → Path A
464
+
465
+ Recovery: Reconstruct from adjacent temporal slices + timing proofs
466
+ ```
467
+
468
+ ### 4.3 Synergy: The Transit Layer
469
+
470
+ YAKMESH is the optimal **Transit Layer** for protocols like Walrus:
471
+
472
+ ```
473
+ ┌─────────────────────────────────────────────────┐
474
+ │ APPLICATION LAYER │
475
+ ├─────────────────────────────────────────────────┤
476
+ │ Walrus Storage │ DeFi │ IoT │ Messaging │
477
+ ├─────────────────────────────────────────────────┤
478
+ │ YAKMESH TRANSIT LAYER │
479
+ │ (TME + Atomic Sync + Post-Quantum Crypto) │
480
+ ├─────────────────────────────────────────────────┤
481
+ │ PHYSICAL NETWORK │
482
+ └─────────────────────────────────────────────────┘
483
+ ```
484
+
485
+ ---
486
+
487
+ ## 5. Security & Cryptographic Hardening
488
+
489
+ ### 5.1 Quantum Resistance
490
+
491
+ YAKMESH implements NIST-standardized post-quantum algorithms:
492
+
493
+ | Algorithm | NIST Standard | Purpose | YAKMESH Usage |
494
+ |-----------|---------------|---------|---------------|
495
+ | ML-DSA-65 | FIPS 204 | Digital Signatures | Node identity, packet signing |
496
+ | ML-KEM-768 | FIPS 203 | Key Encapsulation | Future: Session key exchange |
497
+
498
+ **Why ML-DSA-65?**
499
+ - Security Level 3 (128-bit post-quantum security)
500
+ - Smaller signatures than Dilithium-5
501
+ - Optimized for high-throughput signing
502
+
503
+ ### 5.2 Byzantine Fault Tolerance
504
+
505
+ The Atomic Kernel identifies and "Yields" (isolates) malicious nodes:
506
+
507
+ 1. **Timing Manipulation Detection:** Nodes with >5ms clock drift are flagged
508
+ 2. **Reputation Degradation:** Bad behavior reduces trust score
509
+ 3. **Automatic Isolation:** Trust < 0.2 triggers connection termination
510
+ 4. **Subnet Rebalancing:** Connections redistributed to diverse subnets
511
+
512
+ ### 5.3 Quantum-Temporal Security
513
+
514
+ By encoding cryptographic material across temporal slices:
515
+
516
+ - An adversary must capture **100% of the temporal stream**
517
+ - With **perfect timing precision** (sub-nanosecond)
518
+ - Across **multiple mesh paths simultaneously**
519
+
520
+ This makes HNDL attacks computationally infeasible even for quantum adversaries.
521
+
522
+ ---
523
+
524
+ ## 6. Real-World Use Cases
525
+
526
+ ### 6.1 Edge Intelligence
527
+
528
+ Low-latency machine-to-machine communication for autonomous systems:
529
+
530
+ - Self-driving vehicle mesh networks
531
+ - Drone swarm coordination
532
+ - Industrial robotics synchronization
533
+
534
+ **TME Benefit:** Zero-retransmit recovery critical for real-time control loops.
535
+
536
+ ### 6.2 Critical Infrastructure
537
+
538
+ Private, quantum-secure mesh networks for:
539
+
540
+ - Power grid monitoring
541
+ - Water treatment facilities
542
+ - Transportation systems
543
+
544
+ **Security Benefit:** ML-DSA-65 protects against future quantum attacks on long-lived infrastructure.
545
+
546
+ ### 6.3 Financial Systems
547
+
548
+ High-frequency trading and settlement networks:
549
+
550
+ - Atomic timestamp on every transaction
551
+ - Verifiable ordering via temporal chain
552
+ - Post-quantum protection for regulatory compliance
553
+
554
+ ### 6.4 Global Discovery Hub
555
+
556
+ The `yakmesh.dev` portal serves as:
557
+
558
+ - Node discovery and registration
559
+ - Mesh topology visualization
560
+ - Orchestration API for distributed deployments
561
+
562
+ ---
563
+
564
+ ## 7. Roadmap & Conclusion
565
+
566
+ ### 7.1 Development Phases
567
+
568
+ | Phase | Timeline | Deliverables |
569
+ |-------|----------|--------------|
570
+ | **Phase 1** | Q1 2026 ✅ | Core kernel, TME, security modules, npm package |
571
+ | **Phase 2** | Q2 2026 | Hardware reference designs (PCIe timing cards) |
572
+ | **Phase 3** | Q3 2026 | Production mesh deployment, monitoring dashboard |
573
+ | **Phase 4** | Q4 2026 | ML-KEM integration, full post-quantum handshake |
574
+
575
+ ### 7.2 Current Implementation Status
576
+
577
+ | Component | Status | npm Package |
578
+ |-----------|--------|-------------|
579
+ | Network Identity Unification | ✅ Complete | yakmesh@1.5.0 |
580
+ | Yakmesh Annex (Encrypted P2P) | ✅ Complete | yakmesh@1.4.0 |
581
+ | Content Delivery API | ✅ Complete | yakmesh@1.3.2 |
582
+ | TME (Temporal Matrix Encoding) | ✅ Complete | yakmesh@1.2.0 |
583
+ | NAVR (Sybil Defense) | ✅ Complete | yakmesh@1.1.0 |
584
+ | Replay Defense | ✅ Complete | yakmesh@1.1.0 |
585
+ | Message Validator | ✅ Complete | yakmesh@1.1.0 |
586
+ | Rate Limiter | ✅ Complete | yakmesh@1.0.3 |
587
+ | ML-DSA-65 Signatures | ✅ Complete | yakmesh@1.0.0 |
588
+
589
+ ### 7.3 Conclusion
590
+
591
+ The move toward a **"Sturdy & Secure"** internet begins at the kernel level.
592
+
593
+ YAKMESH provides:
594
+
595
+ 1. **Temporal Resilience:** TME eliminates retransmission latency
596
+ 2. **Quantum Security:** ML-DSA-65 protects against HNDL attacks
597
+ 3. **Byzantine Tolerance:** Multi-layer defense against malicious nodes
598
+ 4. **Atomic Precision:** Hardware-based timing enables new paradigms
599
+
600
+ The Yielding Atomic Kernel is not just an incremental improvement—it is a fundamental rethinking of how mesh networks achieve resilience.
601
+
602
+ ---
603
+
604
+ ## References
605
+
606
+ - NIST FIPS 204: Module-Lattice-Based Digital Signature Standard (ML-DSA)
607
+ - NIST FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard (ML-KEM)
608
+ - IEEE 1588-2019: Precision Time Protocol (PTP)
609
+ - Walrus Whitepaper: 2D Erasure Coding for Decentralized Storage
610
+
611
+ ---
612
+
613
+ ## Legal
614
+
615
+ **YAKMESH™** is a trademark. USPTO Serial No. 99594620.
616
+
617
+ **TME (Temporal Matrix Encoding)** is a proprietary technology of the YAKMESH project.
618
+
619
+ This whitepaper is provided for informational purposes. Implementation details may change.
620
+
621
+ ---
622
+
623
+ *Powered by TME — The world's first temporal-erasure protocol for atomically-synced mesh networks.*