Metadata-Version: 2.4
Name: zizhou-chain
Version: 0.1.0
Summary: Zizhou Chain Python SDK - AI Product Security Infrastructure
License: MIT
Project-URL: Homepage, https://z-zbc.com
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0

# Zizhou Chain Python SDK

> 人工智能是造梦的笔，子舟链是梦想实现的舞台

3行代码接入子舟链区块链存证：

```python
from zizhou_chain import ZizhouClient

client = ZizhouClient(base_url="https://art.z-zbc.com")
result = client.create_proof(file_path="artwork.jpg", title="洛神赋图")

print(f"Proof ID: {result.proof_id}")
print(f"TX Hash: {result.tx_hash}")
print(f"Certificate: {result.certificate_id}")
```

## Installation

```bash
pip install zizhou-chain
```

## Quick Start

### 创建存证

```python
result = client.create_proof(
    file_path="my_artwork.png",
    title="溪山行旅图",
    author="范宽",
    category="painting",
    description="北宋山水画",
    is_public=True
)
```

### 验证存证

```python
verify = client.verify_proof("c7967ea3")
if verify.is_on_chain:
    print(f"✅ {verify.title} 已上链验证通过")
```

### 查询链上统计

```python
stats = client.get_chain_stats()
print(f"区块高度: {stats.block_number}")
print(f"总用户: {stats.total_users}")
print(f"链上存证: {stats.on_chain_proofs}")
```

### 本地计算哈希

```python
hash_value = ZizhouClient.compute_hash("myfile.pdf")
print(f"SHA-256: {hash_value}")
```

## API Reference

| Method | Description |
|--------|-------------|
| `create_proof()` | 创建区块链存证 |
| `verify_proof()` | 验证存证真伪 |
| `get_gallery()` | 获取公开作品列表 |
| `get_chain_stats()` | 获取链上统计 |
| `get_health()` | 检查API健康状态 |
| `compute_hash()` | 本地计算SHA-256 |

## Features

- 🔗 区块链存证：文件哈希上链，不可篡改
- 📜 证书生成：自动生成链上证书编号
- 🔍 真伪验证：通过TX Hash验证存证真实性
- 🏛️ 公开画廊：浏览已公开的数字藏品
- 🔐 双哈希：SHA-256 + SM3国密哈希
