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,378 +0,0 @@
1
- # Technology Stack Research: PROOFNEST v1
2
-
3
- **Project:** PROOFNEST - AI Decisions You Can Prove
4
- **Researched:** 2026-02-03
5
- **Focus:** Stack GAPS for v1 milestones (brownfield analysis)
6
-
7
- ## Executive Summary
8
-
9
- PROOFNEST already has solid cryptographic foundations (Dilithium3, Ed25519, hybrid signatures, OpenTimestamps). The gaps for v1 are primarily in **enterprise integration**, **production hardening**, and **AI-Human Hub platform capabilities**.
10
-
11
- ## Current Stack (Already Implemented)
12
-
13
- | Component | Technology | Status | Notes |
14
- |-----------|------------|--------|-------|
15
- | Core API | Python 3.11 + FastAPI | Working | GPT-5.2 audited |
16
- | Blockchain | Go 1.21 | Testnet ready | 151K lines |
17
- | PQ Signatures | Dilithium3 (ML-DSA FIPS 204) | Working | cloudflare/circl in Go, dilithium_py in Python |
18
- | Classical Signatures | Ed25519 | Working | cryptography lib |
19
- | Hybrid Signatures | ML-DSA + Ed25519 | Working | GPT-5.2 recommendation |
20
- | Hash | SHAKE256, SHA3-256 | Working | Quantum-resistant |
21
- | Bitcoin Anchoring | OpenTimestamps | Working | Calendar servers integrated |
22
- | Consensus | HotStuff-2 BFT | Working | Python mock + Go real |
23
- | Identity | DID:PN | Working | Custom DID method |
24
- | Persistence | SQLite | Working | Full audit trail |
25
- | Authentication | API Key | Working | Basic, needs upgrade |
26
-
27
- **Confidence:** HIGH - verified via codebase analysis
28
-
29
- ---
30
-
31
- ## GAPS: What's Missing for v1
32
-
33
- ### M1: stellanium.io Operational
34
-
35
- #### Production Hardening
36
-
37
- | Gap | Recommended | Version | Why | Confidence |
38
- |-----|-------------|---------|-----|------------|
39
- | WSGI Server | Gunicorn + Uvicorn | 23.x / 0.30+ | Industry standard for FastAPI production | HIGH |
40
- | Rate Limiting | slowapi + Redis | 0.1.9+ / 7.2+ | Distributed rate limiting across instances | HIGH |
41
- | Observability | OpenTelemetry | 1.28+ | Distributed tracing, Prometheus metrics | HIGH |
42
- | Log Aggregation | Structured logging (structlog) | 25.x | JSON logs for observability stack | MEDIUM |
43
- | Health Checks | /health, /ready, /live | - | Kubernetes-ready probes | HIGH |
44
-
45
- **Source:** [FastAPI Production Deployment Guide](https://render.com/articles/fastapi-production-deployment-best-practices), [FastAPI Rate Limiting](https://www.techbuddies.io/2025/12/13/python-rate-limiting-for-apis-implementing-robust-throttling-in-fastapi/)
46
-
47
- #### Missing Infrastructure
48
-
49
- ```yaml
50
- # Required additions to deployment
51
- services:
52
- redis:
53
- image: redis:7.2-alpine
54
- # For rate limiting, session cache, pub/sub
55
-
56
- prometheus:
57
- image: prom/prometheus:latest
58
- # Metrics collection
59
-
60
- jaeger:
61
- image: jaegertracing/all-in-one:latest
62
- # Distributed tracing
63
- ```
64
-
65
- ---
66
-
67
- ### M2: First Enterprise Customer
68
-
69
- #### Enterprise Authentication (CRITICAL GAP)
70
-
71
- | Gap | Recommended | Why | Confidence |
72
- |-----|-------------|-----|------------|
73
- | OAuth 2.0 | authlib + python-jose | Industry standard, enterprise SSO | HIGH |
74
- | mTLS | Built-in TLS + cert validation | Zero-trust architecture | HIGH |
75
- | API Versioning | URL prefix (/v1/, /v2/) | Already using, expand | HIGH |
76
- | RBAC | Custom middleware | Role-based access control | MEDIUM |
77
-
78
- **Current state:** API key only. Enterprises need OAuth 2.0 client credentials, JWT validation.
79
-
80
- **Source:** [Enterprise API Security Architecture](https://www.informatica.com/resources/articles/enterprise-api-security-architecture.html)
81
-
82
- #### Enterprise SDK Requirements
83
-
84
- | Language | Priority | Recommended Approach |
85
- |----------|----------|---------------------|
86
- | TypeScript/Node | P0 | Official SDK with types |
87
- | Python | P0 | Already native (publish to PyPI) |
88
- | Go | P1 | Native client from existing code |
89
- | Java/Kotlin | P2 | For enterprise Android/backend |
90
-
91
- **SDK Features Needed:**
92
- - Automatic retry with exponential backoff
93
- - Webhook signature verification helpers
94
- - Proof creation/verification utilities
95
- - Async support (important for AI workloads)
96
-
97
- #### Webhook System (CRITICAL GAP)
98
-
99
- Current API is request-response only. Enterprises need event-driven integration.
100
-
101
- ```python
102
- # MISSING: Webhook callback system
103
- class WebhookEvent(BaseModel):
104
- event_type: str # proof.created, proof.anchored, consensus.reached
105
- proof_id: str
106
- timestamp: int
107
- payload: dict
108
- signature: str # HMAC-SHA256 for verification
109
- ```
110
-
111
- | Event Type | When | Enterprise Use Case |
112
- |------------|------|---------------------|
113
- | proof.created | New proof submitted | Audit logging |
114
- | proof.validated | Consensus reached | Workflow trigger |
115
- | proof.anchored | Bitcoin confirmation | Compliance record |
116
- | proof.expired | TTL reached | Cleanup, alerts |
117
-
118
- **Source:** [Webhook Testing for API Callbacks](https://www.gravitee.io/blog/webhook-testing-for-api-callbacks)
119
-
120
- #### SLA Monitoring Requirements
121
-
122
- | Metric | Target | How to Measure |
123
- |--------|--------|----------------|
124
- | API Latency (p99) | <500ms | OpenTelemetry |
125
- | Proof Creation | <2s | Custom metric |
126
- | Consensus Time | <10s | Event timestamps |
127
- | Anchor Confirmation | <24h (Bitcoin) | Background job |
128
- | Uptime | 99.9% | Health checks |
129
-
130
- ---
131
-
132
- ### M3: AI-Human Hub (Moltbook Competitor)
133
-
134
- #### Real-Time Capabilities (CRITICAL GAP)
135
-
136
- | Gap | Recommended | Why | Confidence |
137
- |-----|-------------|-----|------------|
138
- | WebSockets | FastAPI WebSocket + Redis Pub/Sub | Real-time AI decision feeds | HIGH |
139
- | Server-Sent Events | sse-starlette | Simpler alternative for one-way | MEDIUM |
140
- | Event Streaming | Redis Streams or Kafka | Scalable event backbone | MEDIUM |
141
-
142
- **Current:** REST API only. AI-Human Hub needs real-time.
143
-
144
- #### AI Decision Audit Trail (DIFFERENTIATOR)
145
-
146
- This is PROOFNEST's key value proposition for AI-Human Hub.
147
-
148
- ```python
149
- # Required: Cryptographic Audit Trail API
150
- class AIDecisionProof(BaseModel):
151
- """EU AI Act Article 12 compliant audit record"""
152
- model_id: str # e.g., "gpt-5.2", "claude-4"
153
- model_version: str
154
- input_hash: str # SHAKE256 of input
155
- output_hash: str # SHAKE256 of output
156
- reasoning_hash: str # Chain of Thought hash
157
- timestamp: int
158
- latency_ms: int
159
- confidence: float # Model's confidence if available
160
- human_verified: bool # Was this reviewed?
161
- verifier_did: Optional[str]
162
- ```
163
-
164
- **Source:** [Audit Trails for AI: How to Prove an Agent's Work](https://chatfin.ai/blog/audit-trails-for-ai-how-to-prove-an-agents-work-to-the-auditors/), [Using Blockchain Ledgers to Record AI Decisions](https://www.mdpi.com/2624-831X/6/3/37)
165
-
166
- **Regulatory Context:** By August 2, 2026, EU AI Act requires transparency and audit trails for high-risk AI systems. PROOFNEST can be THE compliance solution.
167
-
168
- **Source:** [AI Regulatory Compliance 2026](https://sombrainc.com/blog/ai-regulations-2026-eu-ai-act)
169
-
170
- #### Multi-Tenant Architecture
171
-
172
- | Component | Current | Needed |
173
- |-----------|---------|--------|
174
- | Database | Single SQLite | PostgreSQL with tenant isolation |
175
- | API Keys | Global | Per-tenant with scopes |
176
- | Identity | DID:PN only | Link to social (Twitter, GitHub) |
177
- | Rate Limits | None | Per-tenant tiers |
178
- | Storage | Local | S3-compatible with tenant buckets |
179
-
180
- #### Trust Verification API (Moltbook Differentiator)
181
-
182
- Moltbook leaked 1.5M API keys because of weak trust model. PROOFNEST's differentiator:
183
-
184
- ```python
185
- # Trust Verification Endpoints
186
- GET /v1/trust/{did}/score # Trust score based on proof history
187
- GET /v1/trust/{did}/attestations # Who attests to this identity
188
- POST /v1/trust/verify-ai-output # Verify AI output was proven
189
- GET /v1/trust/chain/{proof_id} # Full proof chain to Bitcoin
190
- ```
191
-
192
- ---
193
-
194
- ## Cryptography Stack: 2026 Standards
195
-
196
- ### FIPS Compliance Status
197
-
198
- | Standard | Algorithm | PROOFNEST Status | Notes |
199
- |----------|-----------|------------------|-------|
200
- | FIPS 204 | ML-DSA (Dilithium) | Implemented | Primary signatures |
201
- | FIPS 203 | ML-KEM | Not needed | Key exchange (TLS handles) |
202
- | FIPS 205 | SLH-DSA (SPHINCS+) | Not implemented | Alternative, larger signatures |
203
-
204
- **Recommendation:** Current Dilithium3 implementation is FIPS 204 compliant. No changes needed.
205
-
206
- **Source:** [NIST FIPS 204](https://csrc.nist.gov/pubs/fips/204/final), [NIST PQC Standards](https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards)
207
-
208
- ### Go Cryptography Status (Go 1.24+)
209
-
210
- | Feature | Status | Notes |
211
- |---------|--------|-------|
212
- | crypto/mlkem | Available | Hybrid X25519+ML-KEM-768 in crypto/tls |
213
- | ML-DSA | NOT in stdlib | Use cloudflare/circl (current approach is correct) |
214
- | Hybrid TLS | Default | Go 1.24 auto-negotiates |
215
-
216
- **Source:** [Post-Quantum Cryptography for Go](https://words.filippo.io/mlkem768/), [2025 Go Cryptography State](https://words.filippo.io/2025-state/)
217
-
218
- **Recommendation:** Keep using cloudflare/circl for Dilithium. Go stdlib covers TLS.
219
-
220
- ### Bitcoin Anchoring: OpenTimestamps
221
-
222
- Current implementation is correct. Enhancement opportunities:
223
-
224
- | Feature | Current | Enhancement |
225
- |---------|---------|-------------|
226
- | Calendar servers | 3 servers | Add redundancy with own calendar |
227
- | Verification | External | Add local Bitcoin Core verification |
228
- | Batching | Per-proof | Merkle tree batching (10K proofs/tx) |
229
-
230
- **Source:** [OpenTimestamps](https://opentimestamps.org/), [OpenTimestamps Guide](https://dgi.io/ots/)
231
-
232
- ---
233
-
234
- ## Recommended New Dependencies
235
-
236
- ### Python (Core API)
237
-
238
- ```toml
239
- # pyproject.toml additions
240
- [project.dependencies]
241
- # Production
242
- gunicorn = ">=23.0"
243
- slowapi = ">=0.1.9"
244
- redis = ">=5.0"
245
- structlog = ">=25.1"
246
-
247
- # Observability
248
- opentelemetry-api = ">=1.28"
249
- opentelemetry-sdk = ">=1.28"
250
- opentelemetry-instrumentation-fastapi = ">=0.49"
251
- prometheus-fastapi-instrumentator = ">=7.0"
252
-
253
- # Enterprise Auth
254
- authlib = ">=1.4"
255
- python-jose = ">=3.3"
256
-
257
- # Real-time
258
- websockets = ">=13.0"
259
- redis = ">=5.0" # For pub/sub
260
- ```
261
-
262
- ### Go (Blockchain)
263
-
264
- ```go
265
- // go.mod additions - mostly already present
266
- require (
267
- github.com/cloudflare/circl v1.5.0 // Already using
268
- github.com/prometheus/client_golang v1.20.0
269
- go.opentelemetry.io/otel v1.32.0
270
- )
271
- ```
272
-
273
- ### TypeScript (SDK - New)
274
-
275
- ```json
276
- {
277
- "name": "@proofnest/sdk",
278
- "dependencies": {
279
- "axios": "^1.7.0",
280
- "ws": "^8.18.0",
281
- "@noble/hashes": "^1.5.0"
282
- }
283
- }
284
- ```
285
-
286
- ---
287
-
288
- ## Architecture Implications
289
-
290
- ### Current Architecture
291
- ```
292
- Client -> FastAPI -> SQLite
293
- -> Bitcoin (OpenTimestamps)
294
- -> Go Chain (internal)
295
- ```
296
-
297
- ### v1 Architecture
298
- ```
299
- Client -> API Gateway (rate limiting, auth)
300
- -> FastAPI (Gunicorn+Uvicorn)
301
- -> PostgreSQL (multi-tenant)
302
- -> Redis (cache, pub/sub, rate limits)
303
- -> Go Chain (consensus, proofs)
304
- -> Bitcoin (OpenTimestamps)
305
- -> Webhooks (event callbacks)
306
- -> WebSocket Server (real-time)
307
- -> Prometheus/Jaeger (observability)
308
- ```
309
-
310
- ---
311
-
312
- ## Priority Matrix
313
-
314
- | Gap | Milestone | Priority | Effort | Risk if Skipped |
315
- |-----|-----------|----------|--------|-----------------|
316
- | Rate Limiting | M1 | P0 | Low | DoS vulnerability |
317
- | Observability | M1 | P0 | Medium | Blind to issues |
318
- | OAuth 2.0 | M2 | P0 | Medium | No enterprise sales |
319
- | Webhooks | M2 | P0 | Medium | Poor integration |
320
- | TypeScript SDK | M2 | P1 | Medium | Limited adoption |
321
- | WebSockets | M3 | P0 | Medium | No real-time |
322
- | AI Audit Trail API | M3 | P0 | Low | Miss EU AI Act opportunity |
323
- | PostgreSQL Migration | M3 | P1 | High | Scale ceiling |
324
-
325
- ---
326
-
327
- ## Alternatives Considered
328
-
329
- | Category | Recommended | Alternative | Why Not Alternative |
330
- |----------|-------------|-------------|---------------------|
331
- | Rate Limiting | slowapi + Redis | fastapi-limiter | slowapi more mature |
332
- | Observability | OpenTelemetry | Datadog SDK | Vendor lock-in |
333
- | Real-time | WebSocket + Redis | Kafka | Overkill for v1 scale |
334
- | Auth | authlib | Auth0 SDK | Keep control, reduce cost |
335
- | Database | PostgreSQL | CockroachDB | PostgreSQL sufficient for v1 |
336
-
337
- ---
338
-
339
- ## Confidence Assessment
340
-
341
- | Area | Level | Reason |
342
- |------|-------|--------|
343
- | Cryptography | HIGH | FIPS 204 verified, codebase reviewed |
344
- | Production Hardening | HIGH | Well-documented patterns |
345
- | Enterprise Integration | MEDIUM | Depends on customer requirements |
346
- | AI-Human Hub | MEDIUM | Emerging patterns, less proven |
347
- | Regulatory | HIGH | EU AI Act requirements clear |
348
-
349
- ---
350
-
351
- ## Sources
352
-
353
- ### Cryptography & Standards
354
- - [NIST FIPS 204 (ML-DSA)](https://csrc.nist.gov/pubs/fips/204/final) - HIGH confidence
355
- - [NIST PQC Announcement](https://www.nist.gov/news-events/news/2024/08/nist-releases-first-3-finalized-post-quantum-encryption-standards) - HIGH confidence
356
- - [Go Post-Quantum Roadmap](https://github.com/golang/go/issues/64537) - HIGH confidence
357
- - [Cloudflare CIRCL](https://blog.cloudflare.com/introducing-circl/) - HIGH confidence
358
-
359
- ### Bitcoin Anchoring
360
- - [OpenTimestamps](https://opentimestamps.org/) - HIGH confidence
361
- - [OpenTimestamps Tutorial](https://dgi.io/ots-tutorial/) - HIGH confidence
362
-
363
- ### Enterprise Integration
364
- - [Enterprise API Security](https://www.informatica.com/resources/articles/enterprise-api-security-architecture.html) - MEDIUM confidence
365
- - [Webhook Best Practices](https://www.gravitee.io/blog/webhook-testing-for-api-callbacks) - MEDIUM confidence
366
-
367
- ### AI Compliance
368
- - [EU AI Act Compliance 2026](https://sombrainc.com/blog/ai-regulations-2026-eu-ai-act) - HIGH confidence
369
- - [AI Audit Trails](https://chatfin.ai/blog/audit-trails-for-ai-how-to-prove-an-agents-work-to-the-auditors/) - MEDIUM confidence
370
- - [Blockchain for AI Decisions](https://www.mdpi.com/2624-831X/6/3/37) - MEDIUM confidence
371
-
372
- ### Production Deployment
373
- - [FastAPI Production Guide](https://render.com/articles/fastapi-production-deployment-best-practices) - HIGH confidence
374
- - [FastAPI Rate Limiting](https://www.techbuddies.io/2025/12/13/python-rate-limiting-for-apis-implementing-robust-throttling-in-fastapi/) - MEDIUM confidence
375
-
376
- ---
377
-
378
- *Research complete. This informs roadmap creation for v1 milestones.*