yakmesh 1.8.0 → 2.2.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 (40) hide show
  1. package/CHANGELOG.md +391 -0
  2. package/README.md +93 -2
  3. package/RELEASE_CHECKLIST.md +115 -0
  4. package/SECURITY.md +114 -0
  5. package/adapters/adapter-peerquanta/index.js +1409 -0
  6. package/adapters/adapter-peerquanta/package.json +18 -0
  7. package/adapters/adapter-peerquanta/security.js +833 -0
  8. package/adapters/adapter-peerquanta/tests/security.nodetest.js +255 -0
  9. package/adapters/adapter-website/index.js +955 -0
  10. package/announcements/discord-v1.8.0.md +66 -0
  11. package/announcements/telegram-v1.8.0.md +41 -0
  12. package/announcements/x-v1.8.0.md +65 -0
  13. package/cli/index.js +232 -1
  14. package/dashboard/index.html +530 -1
  15. package/deploy/CADDY-README.md +201 -0
  16. package/deploy/Caddyfile +208 -0
  17. package/identity/node-key.js +36 -1
  18. package/marketing/devto-article.md +79 -0
  19. package/marketing/hacker-news.md +27 -0
  20. package/marketing/linkedin.md +42 -0
  21. package/marketing/product-hunt.md +60 -0
  22. package/marketing/reddit-posts.md +118 -0
  23. package/marketing/twitter-thread.md +83 -0
  24. package/marketing/v1.4.0-discord-header.md +45 -0
  25. package/marketing/v1.4.0-telegram.md +56 -0
  26. package/marketing/v1.4.0-twitter-x.md +92 -0
  27. package/marketing/v2.0.0-announcements.md +268 -0
  28. package/mesh/nakpak-routing.js +5 -3
  29. package/mesh/sherpa-discovery.js +47 -0
  30. package/oracle/index.js +24 -1
  31. package/oracle/module-sealer.js +4 -2
  32. package/oracle/network-identity.js +45 -7
  33. package/package.json +22 -4
  34. package/protocol/yak-handler.cjs +96 -0
  35. package/protocol/yak-handler.js +104 -0
  36. package/protocol/yak-protocol.js +1273 -0
  37. package/protocol/yak-protocol.reg +15 -0
  38. package/server/index.js +262 -1
  39. package/types/index.d.ts +260 -0
  40. package/vitest.config.js +32 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,397 @@
2
2
 
3
3
  All notable changes to YAKMESH will be documented in this file.
4
4
 
5
+ ## [2.2.0] - 2026-01-18
6
+
7
+ ### ✨ YAK:// Protocol v2.2.0 - Remote Bookmarks, DOKO Revocation & Comprehensive Testing
8
+
9
+ This release adds mesh-synchronized bookmark sharing, key compromise recovery, and brings test coverage to 352 tests across all modules.
10
+
11
+ #### 🌐 Remote Bookmarks (Mesh Sync)
12
+
13
+ Share bookmark lists between nodes via gossip protocol. Subscribe to trusted nodes and receive their bookmarks automatically.
14
+
15
+ **New Class: `RemoteBookmarkSync`**
16
+ - **Publish**: Share your bookmarks to the mesh (`yakmesh bookmark share <list-name>`)
17
+ - **Subscribe**: Follow other nodes' bookmark lists (`yakmesh bookmark subscribe <node-id>`)
18
+ - **Sync**: Automatic sync via gossip protocol
19
+ - **Priority**: Local bookmarks always override remote ones
20
+
21
+ **Dashboard UI:**
22
+ - New "Remote Bookmarks" panel with subscription management
23
+ - Subscribe/Unsubscribe buttons
24
+ - Publish your bookmarks to mesh
25
+ - View remote bookmarks from subscribed nodes
26
+
27
+ **REST API:**
28
+ - `GET /bookmarks/remote/status` - Sync status and stats
29
+ - `GET /bookmarks/remote` - List remote bookmarks
30
+ - `POST /bookmarks/remote/subscribe` - Subscribe to a node
31
+ - `POST /bookmarks/remote/unsubscribe` - Unsubscribe from a node
32
+ - `POST /bookmarks/remote/publish` - Publish your bookmarks
33
+
34
+ #### 🔑 DOKO Revocation (Key Compromise Recovery)
35
+
36
+ Emergency revocation system for compromised DOKO identities.
37
+
38
+ **New Class: `DOKORevocation`**
39
+ - **Self-revocation**: Sign revocation with your own key (if available)
40
+ - **Emergency revocation**: Pre-generated "break-glass" certificates
41
+ - **Verification**: Validate revocation certificates with ML-DSA
42
+ - **Broadcast**: Share revocations via gossip to prevent trust in compromised DOKOs
43
+
44
+ **Revocation Reasons:**
45
+ - `KEY_COMPROMISED` - Private key leaked or stolen
46
+ - `DOKO_SUPERSEDED` - Replaced by new DOKO
47
+ - `IDENTITY_RETIRED` - Voluntary retirement
48
+ - `LOST_ACCESS` - Lost access to private key
49
+ - `AFFILIATION_ENDED` - Left organization
50
+
51
+ **Usage:**
52
+ ```javascript
53
+ // Generate emergency cert when creating DOKO (store offline!)
54
+ const emergencyCert = DOKORevocation.generateEmergencyCertificate(doko, privateKey);
55
+
56
+ // Self-revoke if key is compromised but still accessible
57
+ const revocation = DOKORevocation.createSelfRevocation(doko, privateKey, 'key_compromised');
58
+
59
+ // Activate emergency revocation if key is lost
60
+ DOKORevocation.activateEmergencyRevocation(emergencyCert);
61
+
62
+ // Check if a DOKO is revoked
63
+ const status = DOKORevocation.isRevoked(dokoId);
64
+ ```
65
+
66
+ #### ✅ Comprehensive Test Coverage
67
+
68
+ **352 tests across all modules:**
69
+
70
+ | Suite | Framework | Tests |
71
+ |-------|-----------|-------|
72
+ | Oracle | Node.js test runner | 98 |
73
+ | Protocol | Node.js test runner | 56 |
74
+ | Multi-Node | Node.js test runner | 18 |
75
+ | Security | Vitest | 180 |
76
+ | **Total** | | **352** |
77
+
78
+ **New Test Files:**
79
+ - `protocol/tests/yak-protocol.test.js` - 56 tests for URL parsing, bookmarks, DOKO integration
80
+ - `tests/multi-node.test.js` - 18 tests for cross-node sync with mock network
81
+
82
+ #### 🎨 Dashboard Improvements
83
+
84
+ - **Bookmarks Panel**: Add, list, remove local bookmarks
85
+ - **Remote Bookmarks Panel**: Subscribe, publish, view mesh-synced bookmarks
86
+ - **Version**: Updated to v2.2.0
87
+
88
+ ---
89
+
90
+ ## [2.1.0] - 2026-01-18
91
+
92
+ ### ✨ YAK:// Protocol v2.1.0 - Bookmarks, SSL Binding & Domain Transfers
93
+
94
+ This release completes Phase 2 of the YAK:// protocol implementation with local bookmarks, SSL/TLS certificate binding, and secure domain transfer workflows.
95
+
96
+ #### 🔖 Local Bookmarks (Phase 2)
97
+
98
+ Personal "pet names" for YAK:// addresses. No global registry needed - bookmarks are local to your node.
99
+
100
+ **Features:**
101
+ - **BookmarkManager**: Manages local bookmarks stored in `data/bookmarks.json`
102
+ - **URL Resolution**: Bookmarks are resolved after builtins, before content hashes
103
+ - **CLI Commands**: Full bookmark management via CLI
104
+ - `yakmesh protocol bookmark add <name> <target>` - Add bookmark
105
+ - `yakmesh protocol bookmark list` - List all bookmarks
106
+ - `yakmesh protocol bookmark get <name>` - Get bookmark details
107
+ - `yakmesh protocol bookmark rm <name>` - Remove bookmark
108
+ - **REST API**: `/bookmarks` endpoints for programmatic access
109
+ - `GET /bookmarks` - List all bookmarks
110
+ - `GET /bookmarks/:name` - Get specific bookmark
111
+ - `POST /bookmarks` - Add bookmark
112
+ - `DELETE /bookmarks/:name` - Remove bookmark
113
+
114
+ **Usage:**
115
+ ```bash
116
+ # Add a bookmark
117
+ yakmesh protocol bookmark add docs yak://site/docs
118
+
119
+ # Use the bookmark
120
+ yakmesh protocol open yak://docs
121
+
122
+ # Test resolution
123
+ yakmesh protocol test yak://docs
124
+ # → http://localhost:3000/site/docs
125
+ ```
126
+
127
+ #### 🔐 SSL/TLS Certificate Binding
128
+
129
+ Bind SSL certificates to DOKO identities for enhanced domain verification.
130
+
131
+ **New Class: `DOKOCertBinding`**
132
+ - `computeFingerprint(cert)` - SHA-256 fingerprint from PEM or DER certificate
133
+ - `createBinding(options)` - Create SSL binding for a domain
134
+ - `addBinding(doko, binding)` - Add binding to DOKO extensions
135
+ - `verifyBinding(binding, cert)` - Verify certificate matches binding
136
+ - `getBindingForDomain(doko, domain)` - Get binding for specific domain
137
+ - `validateBindings(doko)` - Validate all bindings (expiration, etc.)
138
+
139
+ **Cryptographic Chain:**
140
+ ```
141
+ Domain → SSL Certificate → DOKO Identity → Mesh Verification
142
+ ```
143
+
144
+ **19 tests** covering fingerprint computation, binding management, and verification.
145
+
146
+ #### 🔄 Domain Transfer Workflow
147
+
148
+ Secure ownership transfer of domains and DOKO-bound assets.
149
+
150
+ **New Class: `DOKOTransfer`**
151
+ - `createRequest(options)` - Create transfer request with expiration
152
+ - `authorize(request, signature, nodeId)` - Owner authorizes transfer
153
+ - `reject(request, reason)` - Owner rejects transfer
154
+ - `cancel(request)` - Requester cancels pending transfer
155
+ - `verifyAuthorization(transfer, publicKey)` - Verify owner signature
156
+ - `complete(transfer, toNodeId)` - Complete transfer with proof
157
+ - `createProof(completedTransfer)` - Generate mesh-verifiable proof
158
+
159
+ **Transfer Flow:**
160
+ ```
161
+ New Owner → Request → Current Owner → Authorize →
162
+ Mesh Verifies → Complete → Ownership Updated
163
+ ```
164
+
165
+ **Transfer States:** `pending`, `authorized`, `completed`, `rejected`, `expired`, `cancelled`
166
+
167
+ **Transfer Types:** `domain`, `website`, `asset`
168
+
169
+ **19 tests** covering request creation, state transitions, completion, and proof validation.
170
+
171
+ #### 📊 Test Results
172
+
173
+ | Test Suite | Tests | Status |
174
+ |------------|-------|--------|
175
+ | Oracle Tests | 98 | ✅ Pass |
176
+ | Security Tests | 152 | ✅ Pass |
177
+ | DOKO Identity | 60 | ✅ Pass |
178
+ | **Total** | **310** | ✅ All Pass |
179
+
180
+ #### 🔧 Other Changes
181
+
182
+ - Updated protocol version to 2.1.0
183
+ - Fixed regex in DOKO ID format test (mixed case shortId)
184
+ - Improved BookmarkManager normalization (simple `/` prefix)
185
+
186
+ ---
187
+
188
+ ## [2.0.1] - 2026-01-18
189
+
190
+ ### 🔧 Security Patch & Export Completeness
191
+
192
+ This patch release fixes critical ML-DSA-65 argument order bugs discovered during post-release audit.
193
+
194
+ #### 🐛 Bug Fixes
195
+
196
+ ##### ML-DSA-65 Argument Order (CRITICAL)
197
+ Fixed incorrect argument order in two files where the noble-post-quantum API was used incorrectly:
198
+
199
+ - **`oracle/module-sealer.js`**: Fixed `sign()` and `verify()` argument order
200
+ - `sign(secretKey, message)` → `sign(message, secretKey)` ✅
201
+ - `verify(publicKey, message, signature)` → `verify(signature, message, publicKey)` ✅
202
+
203
+ - **`mesh/nakpak-routing.js`**: Fixed `sign()` and `verify()` argument order
204
+ - Same corrections as above
205
+
206
+ **Impact**: Module attestations and NakPak routing signatures were failing validation.
207
+
208
+ ##### JSON Serialization in DOKO Identity
209
+ Fixed `getSignableBytes()` to properly serialize nested objects using recursive key sorting.
210
+
211
+ #### ✨ New Exports
212
+
213
+ Added missing module exports to `package.json`:
214
+
215
+ | Export Path | Module |
216
+ |-------------|--------|
217
+ | `./security/khata-protocol` | KHATA peer endorsement protocol |
218
+ | `./security/mesh-auth` | Mesh authentication |
219
+ | `./identity/node-key` | Node key management |
220
+ | `./mesh/annex` | ANNEX encrypted P2P channels |
221
+ | `./mesh/temporal-encoder` | Temporal encoding utilities |
222
+
223
+ #### 📋 Release Process
224
+
225
+ Added `RELEASE_CHECKLIST.md` with pre-release verification steps including:
226
+ - Cryptographic API argument order verification
227
+ - Export file existence checks
228
+ - Documentation accuracy review
229
+
230
+ ---
231
+
232
+ ## [2.0.0] - 2026-01-18
233
+
234
+ ### 🧭 NAMCHE Gateway & 📜 DOKO Identity — The "Sherpa Security Stack"
235
+
236
+ This major release introduces **mathematical trust** — replacing certificate authorities with cryptographic proof. The mesh now verifies identity through 7 independent gates, eliminating the need to trust any central authority.
237
+
238
+ > *"The Sherpa does not prove knowledge by certificate. The Sherpa proves knowledge by walking the path."*
239
+
240
+ ---
241
+
242
+ #### 🧭 NAMCHE: Network Authenticated Mesh Certificate Hub & Exchange
243
+
244
+ A 7-gate verification gateway inspired by Nepal's Namche Bazaar — the last checkpoint before Everest.
245
+
246
+ ##### The 7 Gates of Verification
247
+ | Gate | Name | Verification |
248
+ |------|------|-------------|
249
+ | 1 | Cryptographic Gate | Valid ML-DSA-65 signature |
250
+ | 2 | Format Gate | DOKO structure compliance |
251
+ | 3 | Temporal Gate | Not expired, within clock tolerance |
252
+ | 4 | Domain Gate | DNS TXT record verification |
253
+ | 5 | Mesh Gate | 3+ peer endorsements (KHATA protocol) |
254
+ | 6 | Behavioral Gate | Historical trust score ≥ threshold |
255
+ | 7 | Freshness Gate | Proof-of-liveliness within 5 minutes |
256
+
257
+ ##### New Module: `security/namche-gateway.js`
258
+ - `NamcheGateway` - Main verification orchestrator
259
+ - `GateResult` - Individual gate pass/fail with evidence
260
+ - `VerificationReport` - Complete 7-gate assessment
261
+ - `TrustDecision` - Final ALLOW/DENY/CHALLENGE decision
262
+
263
+ ##### Trust Levels
264
+ ```javascript
265
+ TRUST_LEVELS = {
266
+ UNTRUSTED: 0, // Failed critical gates
267
+ BRONZE: 1, // Passed gates 1-3 only
268
+ SILVER: 2, // Passed gates 1-5
269
+ GOLD: 3, // Passed all 7 gates
270
+ PLATINUM: 4 // Gold + extended history
271
+ }
272
+ ```
273
+
274
+ ---
275
+
276
+ #### 📜 DOKO: Distributed Ownership & Key Object
277
+
278
+ Self-sovereign identity documents verified by the mesh, not a CA.
279
+
280
+ ##### New Module: `security/doko-identity.js`
281
+ - `DOKODocument` - The identity document structure
282
+ - `DOKOGenerator` - Create new DOKO documents
283
+ - `DOKOValidator` - Validate document structure and signatures
284
+ - `DOKOExtensions` - Optional capability declarations
285
+
286
+ ##### DOKO Structure
287
+ ```javascript
288
+ {
289
+ version: "1.0",
290
+ type: "node" | "user" | "service" | "device",
291
+ nodeId: "cryptographic-hash",
292
+ publicKey: "ML-DSA-65 public key",
293
+ created: 1737225600000,
294
+ expires: 1768761600000,
295
+ claims: {
296
+ domain: "example.com",
297
+ name: "My Node"
298
+ },
299
+ extensions: {
300
+ capabilities: ["annex", "nakpak", "sherpa"],
301
+ tlsBinding: { ... }
302
+ },
303
+ endorsements: [...],
304
+ signature: "self-signature"
305
+ }
306
+ ```
307
+
308
+ ---
309
+
310
+ #### 🔐 mTLS Phase 1: TLS Certificate Binding
311
+
312
+ Bind DOKO identity to X.509 certificates for TLS-level verification.
313
+
314
+ ##### New Module: `security/tls-binding.js`
315
+ - `DOKOCertificateGenerator` - Create X.509 certs from DOKO
316
+ - `TLSVerifier` - Verify TLS connections against DOKO
317
+ - `TLSCapabilityAdvertiser` - Announce TLS capabilities to mesh
318
+
319
+ ---
320
+
321
+ #### 🤝 Hybrid Trust Model
322
+
323
+ Multi-factor trust assessment combining cryptographic proof with behavioral history.
324
+
325
+ ##### New Module: `security/hybrid-trust.js`
326
+ - `TrustEvidence` - Collect evidence from multiple sources
327
+ - `HybridTrustModel` - Calculate weighted trust scores
328
+ - `TrustBasedAccessControl` - Gate features by trust level
329
+
330
+ ##### Trust Factors
331
+ | Factor | Weight | Source |
332
+ |--------|--------|--------|
333
+ | Cryptographic | 40% | NAMCHE gates 1-3 |
334
+ | Social | 25% | Mesh endorsements (KHATA) |
335
+ | Behavioral | 20% | Historical interactions |
336
+ | Temporal | 15% | Identity age, freshness |
337
+
338
+ ---
339
+
340
+ #### 🌐 Domain Consensus Protocol
341
+
342
+ Mesh-verified domain ownership without centralized DNS authorities.
343
+
344
+ ##### New Module: `security/domain-consensus.js`
345
+ - `DomainClaim` - Claim domain ownership
346
+ - `DomainConsensus` - Multi-peer verification
347
+ - `DNSVerifier` - Check DNS TXT records
348
+
349
+ ---
350
+
351
+ #### 📊 Test Coverage
352
+
353
+ | Module | Tests | Status |
354
+ |--------|-------|--------|
355
+ | NAMCHE Gateway | 37 | ✅ Passing |
356
+ | Domain Consensus | 36 | ✅ Passing |
357
+ | TLS Binding | 26 | ✅ Passing |
358
+ | Hybrid Trust | 30 | ✅ Passing |
359
+ | **Total Security** | **129** | ✅ All Passing |
360
+
361
+ ---
362
+
363
+ #### 🏔️ The Sherpa Protocol Family
364
+
365
+ | Protocol | Full Name | Purpose |
366
+ |----------|-----------|---------|
367
+ | **NAMCHE** | Network Authenticated Mesh Certificate Hub & Exchange | 7-gate verification |
368
+ | **DOKO** | Distributed Ownership & Key Object | Self-sovereign identity |
369
+ | **SHERPA** | Secure Hidden Endpoint Resolution Path Architecture | Peer discovery |
370
+ | **NAKPAK** | NAK Protocol for Anonymous Kommunication | Onion routing |
371
+ | **ANNEX** | Autonomous Network Negotiated eXchange | Encrypted P2P channels |
372
+ | **KHATA** | Kryptographic Handshake for Automated Trust Acceptance | Trust distribution |
373
+
374
+ ---
375
+
376
+ #### Breaking Changes
377
+
378
+ - `identity.js` replaced by `doko-identity.js` (migration guide in docs)
379
+ - Trust verification now requires NAMCHE gateway for new connections
380
+ - Minimum Node.js version: 18.0.0
381
+
382
+ #### Migration Guide
383
+
384
+ ```javascript
385
+ // Before (v1.x)
386
+ import { Identity } from 'yakmesh/oracle/identity';
387
+ const id = new Identity();
388
+
389
+ // After (v2.0)
390
+ import { DOKOGenerator } from 'yakmesh/security/doko-identity';
391
+ const doko = await DOKOGenerator.create({ type: 'node', claims: { name: 'My Node' } });
392
+ ```
393
+
394
+ ---
395
+
5
396
  ## [1.8.0] - 2026-01-18
6
397
 
7
398
  ### 🏔️ SHERPA: Decentralized Peer Discovery
package/README.md CHANGED
@@ -52,6 +52,15 @@ In an era where traditional ECDSA is increasingly vulnerable and network jitter
52
52
  - 🔌 **Plugin Architecture** - Adapters for any database or API
53
53
  - 🛡️ **Phase Modulation** - Time-based anti-replay protection
54
54
 
55
+ ### v2.0 — The Sherpa Security Stack
56
+
57
+ - 🧭 **NAMCHE Gateway** - 7-gate mathematical verification (no CA required)
58
+ - 📜 **DOKO Identity** - Self-sovereign identity documents verified by mesh
59
+ - 🏔️ **SHERPA Discovery** - Decentralized peer discovery via public web beacons
60
+ - 🎒 **NAKPAK Routing** - Post-quantum onion routing for anonymity
61
+ - 🔐 **ANNEX Channels** - ML-KEM768 encrypted P2P with perfect forward secrecy
62
+ - 🤝 **Hybrid Trust** - Multi-factor trust combining crypto + behavior + social proof
63
+
55
64
  ## Quick Start
56
65
 
57
66
  ```bash
@@ -90,11 +99,18 @@ Full documentation available at **[yakmesh.dev](https://yakmesh.dev)**
90
99
 
91
100
  ```
92
101
  yakmesh/
102
+ ├── security/ # NAMCHE gateway, DOKO identity, trust models
103
+ │ ├── namche-gateway.js # 7-gate verification
104
+ │ ├── doko-identity.js # Self-sovereign identity
105
+ │ ├── hybrid-trust.js # Multi-factor trust scoring
106
+ │ ├── tls-binding.js # mTLS certificate binding
107
+ │ └── domain-consensus.js # Mesh-verified domains
93
108
  ├── oracle/ # Self-verifying validation engine
94
109
  ├── mesh/ # WebSocket P2P networking
110
+ │ ├── sherpa-discovery.js # Decentralized peer discovery
111
+ │ ├── nakpak-routing.js # Onion routing
112
+ │ └── annex-channel.js # Encrypted P2P channels
95
113
  ├── gossip/ # Epidemic-style message propagation
96
- ├── identity/ # Post-quantum key management
97
- ├── database/ # SQLite replication engine
98
114
  ├── adapters/ # Platform integration plugins
99
115
  ├── webserver/ # Embedded Caddy web server
100
116
  └── server/ # HTTP/WS server
@@ -143,6 +159,72 @@ class MyAdapter extends BaseAdapter {
143
159
 
144
160
  - `@yakmesh/adapter-peerquanta` - PeerQuanta phpBB marketplace
145
161
 
162
+ ## v2.2.0 — YAK:// Protocol & Identity Recovery
163
+
164
+ ### 🔗 YAK:// Protocol
165
+
166
+ Custom URL protocol for mesh-native addressing. Escape HTTP entirely!
167
+
168
+ ```bash
169
+ # Built-in routes
170
+ yak://dashboard # Node dashboard
171
+ yak://peers # Connected peers
172
+ yak://content/<hash> # Content by hash
173
+
174
+ # Personal bookmarks (pet names)
175
+ yakmesh bookmark add alice /site/alice-homepage
176
+ yak://alice # Opens your bookmark
177
+ ```
178
+
179
+ ### 📚 Remote Bookmarks
180
+
181
+ Share bookmark lists between nodes via gossip protocol:
182
+
183
+ ```javascript
184
+ import { getRemoteBookmarkSync } from 'yakmesh/protocol/yak-protocol';
185
+
186
+ const sync = getRemoteBookmarkSync({ nodeId: 'my-node' });
187
+
188
+ // Subscribe to another node's bookmarks
189
+ sync.subscribe('trusted-node-id');
190
+
191
+ // Publish your bookmarks to the mesh
192
+ sync.publish('my-bookmarks', ['project', 'docs', 'friends']);
193
+
194
+ // Resolve remote bookmarks
195
+ sync.resolveRemote('alice'); // Returns target from subscribed node
196
+ ```
197
+
198
+ ### 🔐 DOKO Revocation
199
+
200
+ Key compromise recovery with self-revocation and emergency "break-glass" certificates:
201
+
202
+ ```javascript
203
+ import { DOKORevocation, REVOCATION_REASONS } from 'yakmesh/security/doko-identity';
204
+
205
+ const revocation = new DOKORevocation({ generator, nodeId });
206
+
207
+ // Normal self-revocation
208
+ const cert = revocation.revoke(dokoId, REVOCATION_REASONS.KEY_COMPROMISED, privateKey);
209
+
210
+ // Emergency revocation (primary key compromised, use backup)
211
+ const emergencyCert = revocation.createEmergencyCertificate(
212
+ dokoId,
213
+ REVOCATION_REASONS.KEY_COMPROMISED,
214
+ backupPrivateKey
215
+ );
216
+
217
+ // Check revocation status
218
+ revocation.isRevoked(dokoId); // true
219
+ ```
220
+
221
+ **Revocation Reasons:**
222
+ - `KEY_COMPROMISED` - Private key was exposed
223
+ - `DOKO_SUPERSEDED` - Replaced with new identity
224
+ - `IDENTITY_RETIRED` - No longer in use
225
+ - `LOST_ACCESS` - Cannot access keys
226
+ - `AFFILIATION_ENDED` - Organization membership ended
227
+
146
228
  ## API Endpoints
147
229
 
148
230
  | Endpoint | Method | Description |
@@ -155,6 +237,15 @@ class MyAdapter extends BaseAdapter {
155
237
  | `/time/status` | GET | Time source detection |
156
238
  | `/time/capabilities` | GET | Time oracle eligibility |
157
239
  | `/connect` | POST | Connect to a peer |
240
+ | `/bookmarks` | GET | List local bookmarks |
241
+ | `/bookmarks` | POST | Add a bookmark |
242
+ | `/bookmarks/:name` | DELETE | Remove a bookmark |
243
+ | `/bookmarks/remote` | GET | List remote bookmarks |
244
+ | `/bookmarks/remote/subscribe` | POST | Subscribe to node |
245
+ | `/bookmarks/remote/publish` | POST | Publish bookmark list |
246
+ | `/bookmarks/remote/status` | GET | Remote sync status |
247
+ | `/security/doko/stats` | GET | DOKO identity stats |
248
+ | `/security/namche/gates` | GET | Gateway verification status |
158
249
 
159
250
  ## Pro Features
160
251
 
@@ -0,0 +1,115 @@
1
+ # Yakmesh Release Checklist
2
+
3
+ This checklist ensures releases are complete, accurate, and secure.
4
+
5
+ ## Pre-Release Checklist
6
+
7
+ ### 1. Code Quality
8
+
9
+ - [ ] **All tests pass** - Run `npm test` and verify 0 failures
10
+ - [ ] **No lint errors** - Run `npm run lint` if available
11
+ - [ ] **No TODO/FIXME in critical paths** - Search security code for unfinished work
12
+ ```powershell
13
+ Get-ChildItem -Recurse -Filter "*.js" security,oracle,mesh,identity | Select-String -Pattern "TODO|FIXME"
14
+ ```
15
+
16
+ ### 2. Cryptographic API Verification
17
+
18
+ **ML-DSA-65 (Post-Quantum Signatures):**
19
+ - [ ] All `ml_dsa65.sign()` calls use `sign(message, secretKey)` order
20
+ - [ ] All `ml_dsa65.verify()` calls use `verify(signature, message, publicKey)` order
21
+
22
+ **ML-KEM-768 (Post-Quantum Key Exchange):**
23
+ - [ ] All `ml_kem768.encapsulate()` calls use `encapsulate(publicKey)` order
24
+ - [ ] All `ml_kem768.decapsulate()` calls use `decapsulate(ciphertext, secretKey)` order
25
+
26
+ **Verification command:**
27
+ ```powershell
28
+ Get-ChildItem -Recurse -Filter "*.js" | Select-String -Pattern "ml_dsa65\.(sign|verify)|ml_kem768\.(encapsulate|decapsulate)"
29
+ ```
30
+
31
+ ### 3. Exports Verification
32
+
33
+ - [ ] **All exports exist** - Every path in `package.json exports` resolves to a real file
34
+ ```powershell
35
+ # Run from yakmesh-node directory
36
+ node -e "const pkg = require('./package.json'); Object.values(pkg.exports).flat().forEach(p => { const fs = require('fs'); const path = p.replace('./', ''); if (!fs.existsSync(path)) console.log('MISSING:', path); })"
37
+ ```
38
+
39
+ ### 4. Documentation
40
+
41
+ - [ ] **README.md is accurate** - All features, APIs, and examples are current
42
+ - [ ] **API documentation matches implementation** - Check function signatures
43
+ - [ ] **CHANGELOG.md updated** - Version, date, and all changes documented
44
+ - [ ] **Migration guide** (if breaking changes) - Clear upgrade path for users
45
+
46
+ ### 5. Version Management
47
+
48
+ - [ ] **Version bumped** in `package.json`
49
+ - [ ] **Version tag matches** - `npm version` output matches intended release
50
+ - [ ] **No debug code** - Remove `console.log` from production paths
51
+ - [ ] **Dependencies updated** - Run `npm audit` and address critical issues
52
+
53
+ ## Post-Release Verification
54
+
55
+ ### 1. Installation Test
56
+
57
+ ```powershell
58
+ # Create a test directory
59
+ mkdir test-install && cd test-install
60
+ npm init -y
61
+ npm install yakmesh-node@<version>
62
+
63
+ # Test basic import
64
+ node -e "const yk = require('yakmesh-node'); console.log('Import successful')"
65
+ ```
66
+
67
+ ### 2. Smoke Tests
68
+
69
+ - [ ] Can generate node identity
70
+ - [ ] Can create and verify signatures
71
+ - [ ] Can establish encrypted channels
72
+ - [ ] Core mesh operations work
73
+
74
+ ### 3. Documentation Deployment
75
+
76
+ - [ ] Website updated with new version
77
+ - [ ] API docs regenerated
78
+ - [ ] Release notes published
79
+
80
+ ## Critical Files to Review
81
+
82
+ | File | Purpose | Priority |
83
+ |------|---------|----------|
84
+ | `security/doko-identity.js` | Identity signatures | HIGH |
85
+ | `security/namche-gateway.js` | Gateway security | HIGH |
86
+ | `oracle/module-sealer.js` | Module attestation | HIGH |
87
+ | `mesh/nakpak-routing.js` | Packet signing | HIGH |
88
+ | `identity/node-key.js` | Node authentication | HIGH |
89
+
90
+ ## Known Pitfalls
91
+
92
+ ### ML-DSA-65 Argument Order
93
+ The noble-post-quantum library uses:
94
+ - `sign(message, secretKey)` - **message FIRST**
95
+ - `verify(signature, message, publicKey)` - **signature FIRST**
96
+
97
+ This is opposite to some other crypto libraries (e.g., sodium). Always verify against the [noble-post-quantum documentation](https://github.com/paulmillr/noble-post-quantum).
98
+
99
+ ### JSON Serialization for Signing
100
+ When creating signable bytes from objects:
101
+ - Use stable/deterministic JSON serialization
102
+ - Sort keys recursively (not just top-level)
103
+ - Use a helper function like `stableStringify()` for nested objects
104
+
105
+ ## Release Types
106
+
107
+ | Type | Version | When to Use |
108
+ |------|---------|-------------|
109
+ | Major | X.0.0 | Breaking changes, major features |
110
+ | Minor | 0.X.0 | New features, backward compatible |
111
+ | Patch | 0.0.X | Bug fixes, security patches |
112
+
113
+ ---
114
+
115
+ *Last updated: 2026-01-18 (v2.0.1 preparation)*