proofnest 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl

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.
@@ -1,385 +0,0 @@
1
- # PROOFNEST Research Summary
2
-
3
- **Project:** PROOFNEST - AI Decisions You Can Prove
4
- **Domain:** AI trust infrastructure with cryptographic verification
5
- **Researched:** 2026-02-03
6
- **Confidence:** HIGH
7
-
8
- ## Executive Summary
9
-
10
- PROOFNEST is building cryptographic trust infrastructure for AI decisions in a post-Moltbook world. The January 2026 Moltbook breach (1.5M API keys exposed through "vibe coding" security failures) created a market for trust-first alternatives. PROOFNEST's core technical foundation is solid: Dilithium3 post-quantum signatures, Bitcoin anchoring via OpenTimestamps, and hybrid cryptography are production-ready. The gaps are in enterprise integration patterns (OAuth2 M2M, webhooks, multi-tenancy) and real-time social features (WebSockets, event feeds) needed to compete with Moltbook while avoiding their failures.
11
-
12
- The recommended approach is phased evolution aligned with three milestones: (1) Production-hardened API with enterprise security, (2) Enterprise SDK and compliance dashboard for first customer, (3) AI-Human Hub with real-time collaboration. This sequencing allows proving trust capabilities before scaling social features, while the EU AI Act deadline (August 2026) creates urgency for compliance-focused features.
13
-
14
- Key risks: repeating Moltbook's security failures (mitigate: GPT-5.2 audit complete, RLS mandatory), missing EU AI Act compliance (mitigate: Article 12 audit trails are core product feature), and pilot ROI ambiguity (mitigate: quantifiable value propositions upfront). The competitive advantage is "proof-coded not vibe-coded" - security and compliance as product differentiators, not afterthoughts.
15
-
16
- ## Key Findings
17
-
18
- ### Recommended Stack
19
-
20
- PROOFNEST's cryptographic stack (Dilithium3, Ed25519, hybrid signatures, OpenTimestamps) is FIPS 204 compliant and production-ready per GPT-5.2 audit. The gaps are operational infrastructure, not crypto primitives.
21
-
22
- **Core technologies to add:**
23
- - **Gunicorn + Uvicorn**: Production WSGI/ASGI server — FastAPI deployment standard
24
- - **Redis**: Rate limiting, pub/sub, caching — distributed state across API instances
25
- - **OpenTelemetry**: Distributed tracing and metrics — observability for production incidents
26
- - **Kong/Traefik**: API Gateway for multi-tenancy and rate limiting — enterprise isolation
27
- - **authlib + python-jose**: OAuth2 Client Credentials flow — AI agent authentication standard
28
- - **WebSockets + Redis Pub/Sub**: Real-time event streaming — Hub social features
29
- - **PostgreSQL**: Multi-tenant database with RLS — production persistence (migrate from SQLite)
30
-
31
- **Critical additions by milestone:**
32
- - M1 (stellanium.io): Rate limiting, observability, health checks
33
- - M2 (first customer): OAuth2 M2M auth, webhook system, TypeScript SDK
34
- - M3 (AI-Human Hub): WebSockets, real-time feeds, Merkle batch verification
35
-
36
- **Confidence:** HIGH — all recommendations are industry-standard patterns with proven tooling.
37
-
38
- ### Expected Features
39
-
40
- Research identified three feature tiers: table stakes (users expect), differentiators (competitive advantage), and anti-features (explicitly avoid).
41
-
42
- **Must have (table stakes):**
43
- - Agent registration with DID-based identity (not Moltbook's unauthenticated POST)
44
- - Cryptographic decision signing (every AI action has provable signature)
45
- - Bitcoin anchoring for tamper-proof timestamps
46
- - Encrypted messaging (Moltbook leaked DMs in plaintext)
47
- - Rate-limited registration (Moltbook: 500K fake agents from OpenClaw)
48
- - Basic posting, threading, voting (minimum social function)
49
-
50
- **Should have (competitive differentiators):**
51
- - Verifiable Credentials for agent capabilities (W3C VC standard)
52
- - Proof-of-Decision API (cryptographic verification, not trust)
53
- - EU AI Act compliance dashboard (Article 12/13/14 requirements)
54
- - Human-in-the-loop controls (75% of enterprises require this per KPMG)
55
- - On-chain reputation (not gameable like Moltbook karma)
56
- - Agent-to-Agent trust protocol (cross-platform interoperability)
57
- - Data lineage tracking (link outputs to model version + source data)
58
-
59
- **Defer to v2+:**
60
- - Advanced multi-agent orchestration (complex, can iterate)
61
- - Cross-platform A2A protocol (requires ecosystem adoption)
62
- - Token economics (regulatory complexity)
63
-
64
- **Anti-features to explicitly avoid:**
65
- - Hardcoded API keys in client code (Moltbook root cause)
66
- - No Row Level Security on database (anyone could read/write Moltbook DB)
67
- - Plaintext secret storage (Moltbook stored OpenAI keys in clear)
68
- - No rate limiting (enabled 500K fake agents)
69
- - Single admin account (no accountability)
70
- - Karma without proof (easily gamed)
71
- - "Growth over security" mindset (ship fast, fix later)
72
-
73
- ### Architecture Approach
74
-
75
- PROOFNEST has a clean dual-layer architecture: Python Core (FastAPI REST API, PROOF lifecycle, DID registry, SQLite) + Go Blockchain (HotStuff-2 BFT, Dilithium3, ~2s block time). The integration challenge is bridging these layers for enterprise and Hub use cases, not redesigning the foundation.
76
-
77
- **Major components to add:**
78
- 1. **API Gateway (Kong/Traefik)** — Multi-tenant routing, rate limiting per tenant, OAuth2 validation, sits between clients and Python Core
79
- 2. **AI Agent Auth System** — OAuth2 Client Credentials flow with agent DID linking, JWT tokens with expiration/scopes, delegation model for "on behalf of" actions
80
- 3. **Real-time Hub Layer** — WebSocket endpoint with JWT auth, Redis Pub/Sub for cross-server broadcasting, Hub PROOF extensions (Post/Reply/Reaction types)
81
- 4. **Batch Verification System** — Merkle tree batching for proof anchoring (1000 proofs → 1 blockchain TX), O(log n) verification instead of per-proof chain RPCs
82
-
83
- **Critical architectural decisions:**
84
- - All PROOF operations through Python Core (Go is storage layer, not entry point)
85
- - Stateless WebSocket servers (Redis for shared state, horizontal scaling)
86
- - Async batch verification (synchronous chain calls create 50ms+ latency bottleneck)
87
- - PostgreSQL with tenant isolation (RLS mandatory on all tables)
88
-
89
- **Confidence:** MEDIUM-HIGH — patterns are proven, but Hub-specific integration needs tuning during implementation.
90
-
91
- ### Critical Pitfalls
92
-
93
- Research identified pitfalls from Moltbook breach, EU AI Act requirements, and enterprise adoption barriers.
94
-
95
- 1. **"Vibe Coding" Security Failures (BLOCKS LAUNCH)** — 45% of AI-generated code introduces vulnerabilities (Veracode 2025). Moltbook's breach was caused by hardcoded keys, missing RLS, unauthenticated writes. Prevention: GPT-5.2 security audit complete (done), RLS mandatory from day 1, never expose credentials client-side, treat every AI-generated line as untrusted until reviewed.
96
-
97
- 2. **EU AI Act Non-Compliance (BLOCKS EU LAUNCH)** — Effective August 2, 2026. Article 12 requires automatic, tamper-resistant event logging. Article 14 requires human oversight. Penalties: EUR 35M or 7% of global turnover. Prevention: Immutable audit trails (cryptographic, append-only) are core product feature, human oversight interface as core feature, incident reporting workflow built-in. This is opportunity, not burden: PROOFNEST can be THE compliance solution.
98
-
99
- 3. **API Key Management Catastrophe (BLOCKS LAUNCH)** — 95% of API attacks come from authenticated sessions (Palo Alto 2025). Moltbook leaked 1.5M keys, McHire exposed 64M records with "123456" password. Prevention: HSM for key storage, automatic key rotation, scoped revocable tokens (OAuth2, not long-lived keys), keys never in logs/frontend, rate limiting per key.
100
-
101
- 4. **Scalability Afterthought (BLOCKS SCALE)** — Cryptographic audit systems hit performance walls. Real-world benchmark: 12K TPS achievable with batch processing, 87% cost reduction vs per-transaction anchoring. Prevention: Asynchronous batch audit generation, Merkle tree structures for efficient verification, hierarchical storage (hot/warm/cold), performance testing under realistic load BEFORE launch.
102
-
103
- 5. **ROI Ambiguity (DEGRADES ADOPTION)** — 95% of enterprise AI pilots fail to deliver measurable P&L impact (MIT 2025), 72% of executives delay AI investments due to unclear ROI (IBM 2025). Prevention: Define ROI metric before building (audit hours saved, compliance cost avoided), pilot → production criteria defined upfront, quantifiable value propositions.
104
-
105
- ## Implications for Roadmap
106
-
107
- Based on research, suggested phase structure aligned with three milestones:
108
-
109
- ### Phase 1: Production Hardening (M1: stellanium.io operational)
110
- **Rationale:** Current Python Core works but lacks production-grade operational patterns. Must address observability, rate limiting, and health checks before any public deployment. Moltbook's breach proves market has zero tolerance for security failures.
111
-
112
- **Delivers:**
113
- - Production-ready API deployment (Gunicorn + Uvicorn)
114
- - Rate limiting with Redis (prevent DoS, enforce fair usage)
115
- - OpenTelemetry observability (metrics, traces, logs)
116
- - Health check endpoints (/health, /ready, /live for K8s)
117
- - PostgreSQL migration (production persistence with connection pooling)
118
-
119
- **Addresses (from FEATURES.md):**
120
- - Rate-limited registration (prevent fake agent floods like Moltbook)
121
- - Production security controls (anti-feature: avoid growth over security)
122
-
123
- **Avoids (from PITFALLS.md):**
124
- - CP-1: Vibe coding security (operational hardening catches deployment issues)
125
- - CP-3: API key management (foundational controls in place)
126
-
127
- **Research Flag:** SKIP RESEARCH — standard patterns, well-documented
128
-
129
- ---
130
-
131
- ### Phase 2: Enterprise Security (M1 continued)
132
- **Rationale:** Enterprises need OAuth2, not API keys. 60% of enterprises cite lack of proper auth as blocker. Must implement before first customer conversations.
133
-
134
- **Delivers:**
135
- - OAuth2 Client Credentials flow for AI agents
136
- - Agent identity lifecycle (registration, DID linking, revocation)
137
- - API Gateway deployment (Kong/Traefik)
138
- - Multi-tenant routing with X-Tenant-ID
139
- - JWT token generation/validation
140
-
141
- **Uses (from STACK.md):**
142
- - authlib + python-jose for OAuth2
143
- - Kong/Traefik for gateway patterns
144
- - Redis for distributed rate limits
145
-
146
- **Implements (from ARCHITECTURE.md):**
147
- - AI Agent Authentication System component
148
- - Delegation model for "on behalf of" actions
149
-
150
- **Avoids (from PITFALLS.md):**
151
- - CP-3: API key management (OAuth2 tokens with expiration/scopes)
152
- - MP-2: Governance-adoption gap (auth controls built-in)
153
-
154
- **Research Flag:** LIGHT RESEARCH — OAuth2 M2M is emerging standard, may need agent-specific patterns research
155
-
156
- ---
157
-
158
- ### Phase 3: Enterprise Integration (M2: first customer)
159
- **Rationale:** First enterprise customer needs SDK, webhooks, and SLA monitoring. Event-driven integration is table stakes for enterprise systems.
160
-
161
- **Delivers:**
162
- - TypeScript/Node SDK (official, typed, published to npm)
163
- - Python SDK (extract from core, publish to PyPI)
164
- - Webhook callback system (proof.created, proof.validated, proof.anchored events)
165
- - HMAC signature verification for webhook security
166
- - SLA monitoring (API latency p99, consensus time, uptime tracking)
167
-
168
- **Addresses (from FEATURES.md):**
169
- - API access as table stakes
170
- - Enterprise integration (not anti-feature: API-only strategy)
171
-
172
- **Implements (from ARCHITECTURE.md):**
173
- - Webhook event system
174
- - SDK retry logic with exponential backoff
175
-
176
- **Avoids (from PITFALLS.md):**
177
- - MP-5: Legacy integration nightmare (multiple integration patterns)
178
- - MP-3: ROI ambiguity (clear integration story enables pilots)
179
-
180
- **Research Flag:** MODERATE RESEARCH — Webhook patterns and SDK design need enterprise API research
181
-
182
- ---
183
-
184
- ### Phase 4: EU AI Act Compliance (M2 continued)
185
- **Rationale:** August 2026 deadline creates hard boundary. Compliance dashboard is competitive differentiator AND regulatory requirement. Build it as product feature, not checkbox.
186
-
187
- **Delivers:**
188
- - Compliance dashboard (real-time EU AI Act Article 12/13/14 status)
189
- - Audit trail export (tamper-evident logs for regulators, CSV/JSON formats)
190
- - Human-in-the-loop controls (approval workflows with risk-based tiers)
191
- - Incident reporting workflow (Article 73: 2-15 day reporting)
192
- - AI decision explainability API (regulatory-valid proofs, not theater)
193
-
194
- **Addresses (from FEATURES.md):**
195
- - Compliance dashboard as differentiator
196
- - Human oversight controls (75% enterprise requirement)
197
- - Decision explainability (EU AI Act Article 13)
198
-
199
- **Avoids (from PITFALLS.md):**
200
- - CP-2: EU AI Act non-compliance (all Articles addressed)
201
- - MP-1: Explainability theater (machine-verifiable proofs)
202
- - MP-4: Human oversight that doesn't scale (risk-based tiers, workflows)
203
-
204
- **Research Flag:** MODERATE RESEARCH — EU AI Act specific requirements need regulatory research
205
-
206
- ---
207
-
208
- ### Phase 5: Hub Foundation (M3: proofnest.io AI-Human Hub)
209
- **Rationale:** Hub needs real-time capabilities that REST API can't provide. WebSocket + event architecture enables live collaboration without polling.
210
-
211
- **Delivers:**
212
- - WebSocket endpoint with JWT validation
213
- - Redis Pub/Sub for cross-server broadcasting
214
- - Hub PROOF extensions (Post, Reply, Reaction types)
215
- - Thread linking (previous_proof chains)
216
- - Visibility controls (public, tenant, private)
217
- - Real-time feed delivery
218
-
219
- **Uses (from STACK.md):**
220
- - WebSockets library
221
- - Redis Pub/Sub
222
- - FastAPI WebSocket support
223
-
224
- **Implements (from ARCHITECTURE.md):**
225
- - Real-time Hub Layer component
226
- - Stateless WebSocket servers with Redis shared state
227
-
228
- **Avoids (from PITFALLS.md):**
229
- - Architectural anti-pattern: stateful WS servers (Redis for state)
230
-
231
- **Research Flag:** LIGHT RESEARCH — WebSocket patterns well-documented, Hub-specific UX may need research
232
-
233
- ---
234
-
235
- ### Phase 6: Social Features (M3 continued)
236
- **Rationale:** Once real-time infrastructure exists, build social layer on top. These are table stakes from competitive research.
237
-
238
- **Delivers:**
239
- - User profiles (bio, avatar, credentials display)
240
- - Follow/social graph (subscribe to agents/humans)
241
- - Voting/reactions (upvotes, emoji reactions)
242
- - Direct messaging (E2E encrypted, NOT plaintext like Moltbook)
243
- - Notifications (real-time alerts via WebSocket)
244
- - Search (full-text across posts, profiles)
245
-
246
- **Addresses (from FEATURES.md):**
247
- - All table stakes social features
248
- - Encrypted DMs (anti-feature: avoid Moltbook's plaintext leak)
249
-
250
- **Avoids (from PITFALLS.md):**
251
- - Moltbook's DM leak (E2E encryption mandatory)
252
- - Vanity metrics (honest metrics: verified unique entities only)
253
-
254
- **Research Flag:** SKIP RESEARCH — standard social features, established patterns
255
-
256
- ---
257
-
258
- ### Phase 7: Trust & Reputation (M3 continued)
259
- **Rationale:** PROOFNEST's differentiator vs Moltbook is cryptographically-backed trust. Reputation system must be provable, not gameable.
260
-
261
- **Delivers:**
262
- - Trust score API (reputation based on verified proof history)
263
- - Attestation system (multi-party validation, 3+ validators)
264
- - Proof badges (visual verification of agent authenticity)
265
- - Decision timeline (Git-like history of proven decisions)
266
- - Trust verification endpoints (verify AI output was proven, full chain to Bitcoin)
267
-
268
- **Addresses (from FEATURES.md):**
269
- - Reputation chain as differentiator
270
- - Attestation/verification system (Shipyard model)
271
- - Trust score (not gameable like Moltbook karma)
272
-
273
- **Implements (from ARCHITECTURE.md):**
274
- - Trust Verification API component
275
-
276
- **Avoids (from PITFALLS.md):**
277
- - Anti-feature: karma without proof (on-chain backing required)
278
-
279
- **Research Flag:** MODERATE RESEARCH — Reputation algorithms and sybil resistance need research
280
-
281
- ---
282
-
283
- ### Phase 8: Performance & Scale (M3 final)
284
- **Rationale:** As proof volume grows, per-proof verification becomes bottleneck. Batch verification with Merkle trees enables 12K TPS (vs hundreds without batching).
285
-
286
- **Delivers:**
287
- - Merkle tree batch verification
288
- - Proof mempool (collect proofs before batching)
289
- - Batch submission to Go Blockchain (1 TX for 1000 proofs)
290
- - Merkle proof storage for O(log n) verification
291
- - Database schema extensions (batch_id, merkle_index, merkle_proof)
292
- - Connection pooling and query optimization
293
-
294
- **Uses (from STACK.md):**
295
- - Custom Merkle tree implementation
296
- - PostgreSQL performance tuning
297
-
298
- **Implements (from ARCHITECTURE.md):**
299
- - Batch Verification System component
300
- - Async proof anchoring
301
-
302
- **Avoids (from PITFALLS.md):**
303
- - CP-4: Scalability afterthought (architecture handles high volume)
304
- - Architectural anti-pattern: synchronous chain verification
305
-
306
- **Research Flag:** LIGHT RESEARCH — Merkle trees are standard, batching logic may need research
307
-
308
- ---
309
-
310
- ### Phase Ordering Rationale
311
-
312
- **Security first, features second:** Phases 1-2 establish production security before any customer-facing features. This directly addresses Moltbook's failure mode (vibe-coded features without security foundation).
313
-
314
- **Enterprise before social:** Phases 3-4 enable first enterprise customer (M2) with SDK, webhooks, and compliance. This proves the trust value proposition with quantifiable ROI before investing in social scale (M3).
315
-
316
- **Real-time infrastructure before social features:** Phase 5 builds WebSocket architecture that Phases 6-7 consume. Avoids retrofitting real-time onto REST API.
317
-
318
- **Scale testing last, not scrambling:** Phase 8 addresses performance proactively based on load testing, not reactively when system is already slow. 87% cost reduction from batch verification justifies upfront investment.
319
-
320
- **EU AI Act as competitive advantage:** Phase 4 treats compliance as product feature (differentiator), not checkbox. August 2026 deadline creates urgency, but compliance-focused enterprises are high-value customers today.
321
-
322
- ### Research Flags
323
-
324
- **Phases needing deeper research during planning:**
325
- - **Phase 2:** OAuth2 for AI agents is emerging standard (2026), may need agent-specific patterns research
326
- - **Phase 3:** Webhook security patterns and enterprise SDK design conventions
327
- - **Phase 4:** EU AI Act Article 12/13/14 specific implementation requirements
328
- - **Phase 7:** Reputation algorithms and sybil resistance mechanisms
329
- - **Phase 8:** Merkle tree batching logic and proof mempool optimization
330
-
331
- **Phases with standard patterns (skip research-phase):**
332
- - **Phase 1:** Production deployment patterns are well-established
333
- - **Phase 5:** WebSocket + Redis Pub/Sub is proven pattern
334
- - **Phase 6:** Social features are table stakes, many references
335
-
336
- ## Confidence Assessment
337
-
338
- | Area | Confidence | Notes |
339
- |------|------------|-------|
340
- | Stack | HIGH | FIPS 204 compliance verified, production patterns well-documented |
341
- | Features | HIGH | Moltbook breach + W3C standards + enterprise surveys provide clear requirements |
342
- | Architecture | MEDIUM-HIGH | Dual-layer architecture is sound, Hub-specific integration needs validation during implementation |
343
- | Pitfalls | HIGH | Moltbook breach is thoroughly documented, EU AI Act requirements are clear, enterprise barriers quantified with surveys |
344
-
345
- **Overall confidence:** HIGH
346
-
347
- Research is based on multiple authoritative sources: Wiz Security's Moltbook breach analysis, official EU AI Act text, W3C DID/VC standards, NIST cryptography standards, and quantitative enterprise surveys (McKinsey, IBM, PwC, KPMG). Cryptographic foundation was audited by GPT-5.2.
348
-
349
- ### Gaps to Address
350
-
351
- **Enterprise integration specifics:** SDK design conventions, webhook retry logic, and rate limiting tiers depend on actual customer requirements. Phase 3 planning should validate integration patterns with target customers before implementation.
352
-
353
- **Hub UX patterns:** Real-time feed algorithms, notification priority, and thread depth limits need UX research during Phase 5-6 planning. Research focused on technical feasibility, not user experience design.
354
-
355
- **Reputation algorithm:** Phase 7 needs research on sybil resistance and reputation calculation. Multiple approaches exist (proof-of-stake, proof-of-humanity, attestation-based), choice depends on economic model.
356
-
357
- **Regulatory interpretation:** EU AI Act Articles are clear on requirements, but interpretation for specific use cases may require legal consultation during Phase 4 planning.
358
-
359
- **Performance benchmarks:** Phase 8 assumes batch verification achieves 12K TPS based on research, but actual performance depends on Go Blockchain configuration and network topology. Load testing required before optimization.
360
-
361
- ## Sources
362
-
363
- ### Primary (HIGH confidence)
364
- - **NIST FIPS 204 (ML-DSA)** — Post-quantum signature standard, Dilithium3 compliance verification
365
- - **Wiz Security: Moltbook Breach Analysis** — Root cause analysis, 1.5M exposed keys, security recommendations
366
- - **EU AI Act Official Text (Articles 12/13/14/73)** — Regulatory requirements, audit logging, human oversight, incident reporting
367
- - **W3C DID Core + Verifiable Credentials** — Identity and credential standards for AI agents
368
- - **Go 1.24 Cryptography Roadmap** — ML-KEM support, hybrid TLS, post-quantum readiness
369
-
370
- ### Secondary (MEDIUM confidence)
371
- - **IBM/KPMG Enterprise AI Surveys (2025-2026)** — Adoption barriers, ROI challenges, governance requirements
372
- - **FastAPI Production Deployment Guides** — Gunicorn/Uvicorn patterns, rate limiting, observability
373
- - **Kong/Traefik Multi-Tenancy Documentation** — API Gateway patterns, OAuth2 integration
374
- - **Microsoft/AWS AI Agent Auth Guides** — OAuth2 Client Credentials for M2M, agent identity patterns
375
- - **Veracode: AI-Generated Code Security (2025)** — 45% vulnerability rate, vibe coding risks
376
-
377
- ### Tertiary (LOW confidence - validate during implementation)
378
- - **Merkle tree performance benchmarks** — Various sources claim 12K TPS, need validation for PROOFNEST's specific use case
379
- - **Reputation algorithm research papers** — Multiple approaches, need selection based on economic model
380
- - **Hub UX patterns** — Social platform best practices, need adaptation for AI-Human context
381
-
382
- ---
383
- *Research completed: 2026-02-03*
384
- *Ready for roadmap: yes*
385
- *Next step: Define detailed requirements and create phase-by-phase roadmap*
AUDIT_GPT4o_2026-02-03.md DELETED
@@ -1,65 +0,0 @@
1
- # PROOFNEST CORE - GPT-4o Turvaaudit
2
-
3
- **Kuupäev:** 2026-02-03
4
- **Mudel:** GPT-4o (OpenAI API)
5
- **Kontekst:** 4170 rida Python SDK
6
-
7
- ---
8
-
9
- ## 1. Dilithium3 + SHAKE256 Valik
10
-
11
- **HINNANG: ✅ SOBIV**
12
-
13
- - **Dilithium3**: NISTi poolt soovitatud post-kvantum digitaalallkirja skeem, pakub tugevat turvalisust kvantarvutite vastu. Hea valik.
14
- - **SHAKE256**: Turvaline ja paindlik räsifunktsioon, NISTi poolt heaks kiidetud.
15
-
16
- **Soovitus:** Veendu, et implementatsioon vastab standarditele.
17
-
18
- ---
19
-
20
- ## 2. HotStuff-2 67% Quorum Rünnakuvektorid
21
-
22
- | Rünnak | Risk | Leevendus |
23
- |--------|------|-----------|
24
- | **Long-range attacks** | 🟡 KESKMINE | Regulaarne võtmete uuendamine, tugev võtmete haldamine |
25
- | **Nothing-at-stake** | 🟢 MADAL | Vähem probleemne BFT süsteemides, stiimulite mehhanismid vajalikud |
26
- | **Collusion** | 🔴 KÕRGE | <34% osalejate kokkumäng võib kompromiteerida. Vaja mitmekesisust ja hajutatust |
27
- | **Eclipse attacks** | 🟡 KESKMINE | Mitmekesised ühendused, tugev võrguarhitektuur |
28
-
29
- ---
30
-
31
- ## 3. DID Formaat `did:pn:{type}:{pubkey_hash}`
32
-
33
- **Probleemid:**
34
- 1. Kui hash-funktsioon on nõrk → turvaprobleemid
35
- 2. Kui tüübid pole selgelt määratletud → segadus
36
-
37
- **Soovitus:** Kasuta tugevat hash-funktsiooni (SHAKE256 on OK).
38
-
39
- ---
40
-
41
- ## 4. Kriitilised Puudused
42
-
43
- 1. **Konsensuse mehhanismi keerukus** - HotStuff-2 korrektne implementeerimine on kriitiline
44
- 2. **Võtmete haldamine** - Post-kvantum võtmete suurus ja haldamine keeruline
45
- 3. **Ankurdamise sõltuvus** - Ainult Bitcoin on riskantne
46
-
47
- ---
48
-
49
- ## 5. Soovitused Parandamiseks
50
-
51
- | # | Soovitus | Prioriteet |
52
- |---|----------|------------|
53
- | 1 | Uuri alternatiivseid konsensuse mehhanisme | MEDIUM |
54
- | 2 | Mitmekesista ankurdamist (mitu plokiahelat) | HIGH |
55
- | 3 | Rakenda võrgutaseme kaitse (eclipse attacks) | HIGH |
56
- | 4 | Korralda regulaarsed turvaauditid | ONGOING |
57
-
58
- ---
59
-
60
- ## Tegevuskava Vastuseks
61
-
62
- - [ ] Lisa key rotation mehhanism
63
- - [ ] Lisa mitmekordne ankurdamine (Bitcoin + Ethereum + custom chain)
64
- - [ ] Paranda P2P võrgu kaitse eclipse rünnakute vastu
65
- - [ ] Dokumenteeri konsensuse implementatsioon detailselt
AUDIT_GPT52_2026-02-03.md DELETED
@@ -1,137 +0,0 @@
1
- # PROOFNEST CORE - GPT-5.2 Turvaaudit
2
-
3
- **Kuupäev:** 2026-02-03
4
- **Mudel:** GPT-5.2 (OpenAI)
5
- **Staatus:** KRIITILINE - palju parandamist vaja
6
-
7
- ---
8
-
9
- ## 1. Dilithium3 + SHAKE256 (Post-Quantum)
10
-
11
- **HINNANG: 🟡 OK, aga probleemid:**
12
-
13
- - "50+ aastat quantum-proof" on lubadus mida ei saa anda
14
- - Dilithium3 = NIST Level 3 (~AES-192) - miks mitte Dilithium5 suurema marginaaliga?
15
- - SHAKE256 on OK, AGA vaja domain separation tags igal pool
16
- - Suurim risk on ENGINEERING, mitte matemaatika:
17
- - Dilithium allkirjad on SUURED → DoS vektor
18
- - Side-channel ja fault attacks on päris
19
-
20
- **SOOVITUS:**
21
- - Kasuta HYBRID allkirju (ML-DSA + Ed25519) üleminekuperioodil
22
- - Kaalu ML-DSA-65 vs -87 kompromisse
23
- - Lisa algorithm agility protokolli disaini
24
-
25
- ---
26
-
27
- ## 2. HotStuff-2 BFT 67% Quorum
28
-
29
- **RÜNNAKUVEKTORID (hästi rahastatud vastase vastu):**
30
-
31
- | # | Rünnak | Tõsidus |
32
- |---|--------|---------|
33
- | 1 | **Validator capture / cartel** | 🔴 KRIITILINE - osta/kompromiteeri 1/3 validaatoreid |
34
- | 2 | **Network-layer** | 🔴 Eclipse attacks, BGP hijacks, DDoS leaderi vastu |
35
- | 3 | **Time manipulation** | 🟡 Skewed clocks + delay → inconsistent ordering |
36
- | 4 | **State bloat** | 🟡 PQ allkirjad = odav luua, kallis verifitseerida |
37
- | 5 | **Long-range attacks** | 🔴 Kui vanad võtmed lekkivad |
38
- | 6 | **Client deception** | 🔴 Light clients on nõrk koht |
39
-
40
- **SOOVITUS:**
41
- - Defineeri validator admission ja stake mudel
42
- - Anti-DoS: signature batching, rate limits, fee model
43
- - Light-client story checkpointing'uga
44
-
45
- ---
46
-
47
- ## 3. DID System
48
-
49
- **PROBLEEMID:**
50
-
51
- - **Key rotation:** DID = pubkey hash → uus võti = UUS identiteet (!)
52
- - **Recovery:** Võti kaotsi = identiteet kaotsi (julmalt aus)
53
- - **Sybil:** ZERO Sybil resistance - igaüks saab luua lõpmata DID-e
54
- - **Truncation:** 40 hex = 160 bits - miks mitte 256?
55
-
56
- **SOOVITUS:**
57
- - Otsusta: kas DID on stabiilne identifier või key fingerprint?
58
- - Kui stabiilne: vaja DID registry + document update rules + recovery
59
- - Kui lihtne: kutsu seda "key ID", mitte DID
60
-
61
- ---
62
-
63
- ## 4. Puudu Productioni Jaoks
64
-
65
- | # | Puuduv | Prioriteet |
66
- |---|--------|------------|
67
- | 1 | **Formal spec** - "4170 rida Python" pole spec | 🔴 |
68
- | 2 | **Canonical encoding** - CBOR/Protobuf deterministic | 🔴 |
69
- | 3 | **Threat model** - kes on adversary, mis on trust anchor | 🔴 |
70
- | 4 | **Key management** - HSM tugi, constant-time crypto | 🟡 |
71
- | 5 | **Data availability** - kus evidence elab? | 🟡 |
72
- | 6 | **Light client** - verification path | 🔴 |
73
- | 7 | **Governance** - kuidas upgrade'id toimuvad | 🟡 |
74
-
75
- ---
76
-
77
- ## 5. Võrdlus Teiste Projektidega
78
-
79
- | Projekt | Sarnasus | Erinevus |
80
- |---------|----------|----------|
81
- | **W3C VCs/DIDs** | Data model | Nemad ei anna konsensust |
82
- | **Ceramic** | Anchored history | Nemad fokusseerivad dokument streams |
83
- | **EAS** | Attestations | Nemad kasutavad Ethereumi turvalisust |
84
-
85
- **Brutal bottom line:**
86
- - Kui eesmärk on "globally verifiable attestations" → EAS/VCs lahendavad 80%
87
- - Kui eesmärk on "existence proofs" → OpenTimestamps üksi on raske üle lüüa
88
- - UUS BFT layer on mõistlik AINULT kui vaja fast finality + richer semantics
89
-
90
- ---
91
-
92
- ## Küsimused Millele Peab Vastama
93
-
94
- 1. Mida "consensus" täpselt attesteerib? (ordering, validity, uniqueness, non-equivocation, time bounds?)
95
- 2. Kes on validators ja kuidas valitakse?
96
- 3. Mis on light-client verification path?
97
- 4. Mis on identity recovery story?
98
- 5. Mis on data availability model "evidence" jaoks?
99
- 6. Mis on täpsed cryptographic transcripts?
100
-
101
- ---
102
-
103
- ## Tegevuskava
104
-
105
- - [x] Lisa hybrid signatures (ML-DSA + Ed25519) ✅ **DONE 2026-02-03**
106
- - [ ] Defineeri validator admission model
107
- - [ ] Lisa formal spec (CBOR deterministic encoding)
108
- - [ ] Lisa light-client verification
109
- - [x] Lisa DID Document + registry key rotation jaoks ✅ **DONE 2026-02-03**
110
- - [ ] Lisa Sybil resistance (stake/bonding)
111
- - [ ] Dokumenteeri threat model
112
-
113
- ## Implementeeritud Lahendused
114
-
115
- ### 1. Hybrid Signatures (proof.py)
116
- ```python
117
- # Uus enum väärtus:
118
- SignatureAlgorithm.HYBRID_ML_DSA_ED25519
119
-
120
- # Kasutamine:
121
- identity, sk = Identity.generate("agent", SignatureAlgorithm.HYBRID_ML_DSA_ED25519)
122
- proof = Proof.create(ProofType.CLAIM, "...", identity, sk)
123
- # MÕLEMAD allkirjad peavad kehtima (AND, mitte OR)
124
- ```
125
-
126
- ### 2. DID Registry (did_registry.py)
127
- ```python
128
- # Key rotation:
129
- doc = DIDDocument.create(did, public_key, recovery_public_key=recovery_pk)
130
- doc.rotate_key(old_key_id, new_public_key, key_type)
131
-
132
- # Registry:
133
- registry = DIDRegistry()
134
- registry.register(doc)
135
- registry.update(doc)
136
- resolved = registry.resolve(did)
137
- ```