Skip to main content

Zizhou Chain Python SDK - AI Product Security Infrastructure

Project description

Zizhou Chain Python SDK

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

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

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

pip install zizhou-chain

Quick Start

创建存证

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

验证存证

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

查询链上统计

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

本地计算哈希

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国密哈希

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zizhou_chain-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zizhou_chain-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file zizhou_chain-0.1.0.tar.gz.

File metadata

  • Download URL: zizhou_chain-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for zizhou_chain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d058d9533d802defb91b7fd0efd856a1cb1ec0a4078f8cccb3eb4a8acef08cbf
MD5 689ce4be915733b0c4aa2155c96e851d
BLAKE2b-256 3e54981c7e2f14a9ed7446b40da6d58dd8e633349d1f5fcaf84dfce37ff38ed4

See more details on using hashes here.

File details

Details for the file zizhou_chain-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zizhou_chain-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for zizhou_chain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edf9f120ed92dba8d44471b5b7437ab99c70956708987c6dcf8e286486551458
MD5 b95e56454314146dc3fc34c9038e4ff9
BLAKE2b-256 246f57f2cf6f371a18317cbbaae7ebc5f9c4827785e5bdbaf7be8b1bb0fb8d0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page