Metadata-Version: 2.4
Name: proofnest
Version: 1.6.4
Summary: ⚠️ DEPRECATED: Use proofnest>=2.0.0. This version is legacy - see https://proofnest.io/migration
Project-URL: Homepage, https://github.com/proofnest/proofnest
Project-URL: Documentation, https://github.com/proofnest/proofnest#readme
Project-URL: Repository, https://github.com/proofnest/proofnest.git
Project-URL: Issues, https://github.com/proofnest/proofnest/issues
Author-email: Stellanium Ltd <admin@stellanium.io>
Maintainer-email: Stellanium Ltd <admin@stellanium.io>
License: LicenseRef-Proprietary
License-File: LICENSE
Keywords: accountability,agents,ai,audit,bitcoin,coordination,crdt,cryptography,decision-logging,distributed,post-quantum,proof,transparency,trust,verification
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Requires-Dist: cryptography>=41.0.0
Requires-Dist: dilithium-py==1.4.0
Requires-Dist: jsonschema>=4.17.0
Requires-Dist: packaging>=21.0
Requires-Dist: pqcrypto>=0.3.0
Requires-Dist: pycryptodome>=3.19.0
Requires-Dist: pynacl>=1.5.0
Provides-Extra: bitcoin
Requires-Dist: bitcoinlib>=0.6.0; extra == 'bitcoin'
Provides-Extra: dev
Requires-Dist: black>=23.0; extra == 'dev'
Requires-Dist: cryptography>=41.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Provides-Extra: ed25519
Requires-Dist: cryptography>=41.0.0; extra == 'ed25519'
Provides-Extra: full
Requires-Dist: bitcoinlib>=0.6.0; extra == 'full'
Requires-Dist: cryptography>=41.0.0; extra == 'full'
Description-Content-Type: text/markdown

# PROOFNEST

> **⚠️ DEPRECATED: This is proofnest v1.x (legacy). Please upgrade to v2.0.0+**
>
> ```bash
> pip install proofnest>=2.0.0
> ```
>
> **What's new in v2.0:**
> - Go blockchain backend (10x faster, production-grade)
> - STRICT_CRYPTO mode (no silent fallbacks)
> - HYBRID signatures (ML-DSA + Ed25519)
> - AI inference receipts
> - GPT-5.2 security audit fixes
>
> **Migration guide:** https://proofnest.io/migration

---

**Proof, not promises.**

Quantum-proof Layer 1 blockchain with AI work verification. Every transaction cryptographically signed with post-quantum Dilithium3. Genesis anchored to Bitcoin via OpenTimestamps.

## v1.5.0 - Full Blockchain Implementation

This release includes the complete PROOFNEST blockchain node (14,800+ lines) with:

- **257 comprehensive tests** - Full coverage including security tests
- **Dilithium3 signatures** - NIST PQC Level 3 quantum-proof
- **SHAKE256 hashing** - Domain-separated, collision-resistant
- **TLS 1.3 P2P** - Encrypted peer communication with TOFU pinning
- **LMD-GHOST fork choice** - Proper fork handling
- **AI Work Validator** - TF-IDF + entropy verification with slashing
- **Staking system** - 50 PROOF minimum, 21-day unbonding
- **EIP-1559 gas model** - Base fee burning mechanism

## Architecture

```
PROOFNEST L1
├── Cryptography
│   ├── Dilithium3 (NIST ML-DSA-65) - Quantum-proof signatures
│   ├── SHAKE256 - Hashing with domain separation
│   └── TLS 1.3 - P2P encryption
├── Consensus
│   ├── PoW → BFT-ready architecture
│   ├── LMD-GHOST fork choice
│   └── 21-day unbonding period
├── Economics
│   ├── 70M PROOF genesis supply
│   ├── 10 PROOF block reward
│   ├── EIP-1559 fee burning
│   └── AI work slashing (up to 10%)
└── Verification
    ├── AI Work Validator (TF-IDF + entropy)
    ├── Bitcoin anchoring (OpenTimestamps)
    └── Chain integrity verification
```

## Genesis Allocations

| Allocation | Amount | Purpose |
|------------|--------|---------|
| Team | 10,000,000 PROOF | Core development |
| Community | 30,000,000 PROOF | Ecosystem growth |
| Ecosystem | 20,000,000 PROOF | Partnerships |
| Treasury | 10,000,000 PROOF | Operations |
| **Total** | **70,000,000 PROOF** | |

## Quick Start

### Run a Node

```python
from proofnest.node import P2PNode

# Genesis node (creates new chain)
node = P2PNode(
    name="genesis-node",
    host="127.0.0.1",
    port=9001,
    is_genesis=True
)
node.start()

# Validator node (joins existing chain)
validator = P2PNode(
    name="validator-1",
    host="127.0.0.1",
    port=9002,
    peers=["127.0.0.1:9001"]
)
validator.start()
```

### Multi-Node Testnet

```bash
# Set data directory per node
export HONEST_CHAIN_DIR=/path/to/node1/data

# Optional: Disable TLS for testing
export PROOFNEST_NO_TLS=1

# Run testnet launcher
python run_testnet.py
```

### AI Work Submission

```python
from proofnest.node import AIWorkValidator

validator = AIWorkValidator()

# Submit AI work for verification
result = validator.verify_work(
    input_data="Analyze quarterly financial report",
    output_data="Revenue increased 15% YoY...",
    task_type="analysis",
    compute_time=45.2,
    stake=1000  # PROOF tokens at stake
)

# Slashing for poor quality work
if result["quality_score"] < 0.5:
    slash_amount = result["slash_amount"]  # Up to 10% of stake
```

### Decision Logging (SDK)

```python
from proofnest import ProofNest, RiskLevel

pn = ProofNest(agent_id="my-agent")
print(pn.did)  # did:pn:a1b2c3...

pn.decide(
    action="Approved transaction",
    reasoning="All checks passed",
    risk_level=RiskLevel.HIGH  # Auto-anchored to Bitcoin
)

assert pn.verify()
```

## Security

### Quantum-Proof Cryptography

- **Dilithium3** - NIST ML-DSA-65, Level 3 security
- **1952-byte public keys** - Larger but quantum-safe
- **SHAKE256** - Extensible output function

### Anti-Replay Protection

```python
# Every transaction includes:
{
    "nonce": 42,           # Sequential per-sender
    "chain_id": "proofnest-mainnet",
    "expires_at": 1735900000  # 1 hour default
}
```

### Fork Handling

- LMD-GHOST fork choice rule
- Automatic chain reorganization
- Persistent storage survives restarts

## Testing

```bash
# Run all 257 tests
python -m pytest tests/ -v

# Security tests only
python -m pytest tests/ -k "security" -v

# With coverage
python -m pytest tests/ --cov=proofnest --cov-report=html
```

## Components

| Component | Description | Status |
|-----------|-------------|--------|
| `QuantumCrypto` | Dilithium3 + SHAKE256 | Production |
| `QuantumWallet` | Persistent key management | Production |
| `Blockchain` | Fork handling, validation | Production |
| `P2PNode` | TLS 1.3 networking | Production |
| `AIWorkValidator` | TF-IDF + entropy scoring | Production |
| `ChainStorage` | JSON persistence | Production |
| `BitcoinAnchor` | OpenTimestamps integration | Production |
| `Transaction` | Nonce + chain_id + expiry | Production |

## Configuration

### Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `HONEST_CHAIN_DIR` | Data directory | `~/.honest_chain` |
| `PROOFNEST_NO_TLS` | Disable TLS (testing) | Not set |

### Staking Parameters

```python
MIN_STAKE = 50 * 10**18        # 50 PROOF minimum
UNBONDING_PERIOD = 21 * 86400  # 21 days
MAX_SLASH_PERCENT = 10         # 10% max slashing
```

## Roadmap

- [x] Quantum-proof signatures (Dilithium3)
- [x] TLS 1.3 P2P encryption
- [x] AI work verification with slashing
- [x] Multi-node testnet support
- [x] 257 comprehensive tests
- [ ] BFT consensus upgrade
- [ ] Bridge light client
- [ ] Mainnet launch

## License

Proprietary. Copyright (c) 2025-2026 Stellanium Ltd. All rights reserved.

PROOFNEST is a trademark of Stellanium Ltd.
