Metadata-Version: 2.4
Name: sovereign-zk
Version: 0.2.1
Summary: A lightweight, privacy-preserving framework for cross-border GPU compute using Zero-Knowledge Proofs.
Home-page: https://github.com/93Chidiebere/ZKP-GPUcompute
Author: Chidiebere
Author-email: vincent.christopher.189736@unn.edu.ng
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: ezkl>=22.3.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: requests>=2.31.0
Requires-Dist: web3>=6.0.0
Requires-Dist: pycryptodome>=3.19.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Sovereign-ZK

A mathematically rigorous, privacy-preserving framework for cross-border GPU compute using Zero-Knowledge Verifiable Computation (ZK-VC) and Confidential Computing (CC). Developed by **Chidiebere V. Christopher**.

Sovereign-ZK allows institutions (e.g., Nigerian banks or hospitals) to securely offload heavy deep learning workloads to remote Confidential GPUs (e.g., NVIDIA H100s in Kenya) without exposing plain-text data to the host. 

**v0.2.0+ Architecture Revamp:** The framework has completely shifted from centralized HTTP servers to a trustless **Decentralized Web3 Settlement Layer**. Payments are escrowed in **USDC** (stablecoins) on-chain, and funds are only released when the remote node submits a mathematically valid EZKL Zero-Knowledge Proof.

## Installation / Upgrade

To upgrade to the Web3/USDC enabled version:
```bash
pip install --upgrade sovereign-zk
```

## Quick Start (Web3 Decentralized Architecture)

### 1. Setup the Smart Contract Escrow
Sovereign-ZK relies on the `SovereignEscrow.sol` smart contract to handle trustless USDC payouts.
First, run a local blockchain node and deploy the contracts (using Hardhat):

```bash
npx hardhat node
npx hardhat run scripts/deploy.js --network localhost
```

### 2. Start the Remote GPU Node (Kenya)
The node no longer runs a web server. Instead, it continuously polls the blockchain for new AI compute jobs.

```bash
python -m sovereign_zk.node
```
*(The node will listen for `JobCreated` events, verify the data commitment, generate a ZK proof, and submit it on-chain).*

### 3. Submit Data from the Local Client (Nigeria)
On your local machine, use the client SDK to encrypt your data, generate a cryptographic commitment, and escrow exactly $0.25 USDC on the blockchain.

```bash
python -m sovereign_zk.client
```

Under the hood, the client script does this:
```python
from web3 import Web3

# 1. Encrypt the data
encrypted_payload = encrypt_data(data, symmetric_key)

# 2. Generate a cryptographic commitment (so the node can't cheat)
input_commitment = w3.keccak(encrypted_payload)

# 3. Approve exactly 0.25 USDC (250,000 units) to the Escrow
usdc.functions.approve(escrow_address, 250000).transact({'from': client_account})

# 4. Create the Job On-Chain!
escrow.functions.createJob(input_commitment, 250000).transact({'from': client_account})
```

## Economics
Sovereign-ZK uses **USDC** for corporate budgeting stability. It allows African researchers to access high-end compute for micro-transactions (~$0.25) while guaranteeing the GPU provider an automated, trustless payout via the Zero-Knowledge verifier smart contract.

## Author

**Chidiebere V. Christopher**
* **LinkedIn**: [Chidiebere Christopher](https://www.linkedin.com/in/chidiebere-christopher/)
* **GitHub**: [93Chidiebere](https://github.com/93Chidiebere)
* **Email**: vchidiebere.vc@gmail.com
