zanii-chain
Python client SDK for the Zanii L1 blockchain (RPC at
https://blockchain.zanii.agency): keys, canonical signing, transactions,
session keys, payment streams, and the AgentWallet adapter for AI agents.
Not the identity SDK. The
zaniipackage on PyPI is the Zanii agent-identity and proof-of-action product (did:key, delegation certs, receipts,ledger.zanii.agency). This package,zanii-chain, is the blockchain client. They are designed to work together.
Install
pip install zanii-chain
Python 3.10+. Depends on PyNaCl, blake3, bech32, and msgpack.
Use
from zanii_chain import Wallet, ZaniiClient, ZAN
client = ZaniiClient("https://blockchain.zanii.agency")
wallet = Wallet.generate() # or Wallet.from_seed_hex(hex)
client.faucet(wallet.address) # devnet
client.transfer(wallet, "zan1...", 1 * ZAN)
# agent-native: authorize a scoped session key, then open a payment stream
import time
client.session_authorize(wallet, agent_pubkey,
int(time.time()*1000) + 7*86_400_000, 5 * ZAN)
client.stream_open(wallet, "zan1payee...", rate_zi_per_s=1000, deposit_zi=1 * ZAN)
Give an AI agent a wallet
from zanii_chain import AgentWallet
# the owner authorized this agent's session key with a 5 ZAN cap
agent = AgentWallet("https://blockchain.zanii.agency", AGENT_SEED, OWNER_ADDRESS)
agent.pay("zan1provider...", amount_zan=0.25)
agent.open_stream("zan1api...", rate_zan_per_second=0.001, deposit_zan=2.0)
tools = agent.openai_tools() # JSON tool schemas for any LLM
result = agent.call_tool("balance", "{}") # dispatch a tool call, get a string
AgentWallet methods return plain strings for the LLM, and call_tool never
raises into the agent loop. LangChain and CrewAI can consume the bound methods
(agent.pay, agent.open_stream, ...) as plain-function tools.
Guarantees
Encodings and signatures are byte-identical to the Zanii reference node: a
transaction built here validates and executes on-chain unchanged, and matches
the JavaScript SDK (@zanii/chain) byte-for-byte. Amounts are zi
(1 ZAN = 10^9 zi), integers only, never floats.
Apache 2.0 · info@zanii.agency · https://blockchain.zanii.agency
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zanii_chain-0.1.0.tar.gz.
File metadata
- Download URL: zanii_chain-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a9cc55e039d42ce9de39072a91455c8fc23aeb83ba014a5a2b87eae24e4643c
|
|
| MD5 |
7d34c8cb5c1596d773cdc679b9cc9357
|
|
| BLAKE2b-256 |
6ce45b1aa575a1567af868da2bc922f4595e469b67135d9d15ef934ed87fc6ad
|
File details
Details for the file zanii_chain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zanii_chain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab941e423396a08020f7cce0f5ba7cd596c862a331020ab0d2bf3803433ed2ea
|
|
| MD5 |
dd1ecf260e23acd2dd8b59aa5f28b40e
|
|
| BLAKE2b-256 |
ac2df64c15d269a2998c98b2c9596acb0dec1d06ddceb52559a8d841f556d2eb
|