zerostyl-sdk (Python)
Python SDK for the ZeroStyl zk toolkit on
Arbitrum Stylus. Parses the exporter's abi.json documents into typed dataclasses and
generates typed Python bindings — the same scope as @zerostyl/sdk-ts, in Python.
Pure Python, zero runtime dependencies, Python ≥ 3.10.
Install
pip install zerostyl-sdk
Or from a clone of the repository, for development:
cd packages/sdk-py
python -m pip install ".[dev]"
Usage
from pathlib import Path
from zerostyl_sdk import parse_abi_schema, generate_bindings
abi = parse_abi_schema(Path("abi.json").read_text())
print(abi.circuit.name, abi.circuit.num_public_inputs)
bindings = generate_bindings(abi) # a Python module as a string
Path("deposit_bindings.py").write_text(bindings)
CLI (equivalent of the TS SDK's zerostyl-sdk generate):
zerostyl-sdk-py generate --abi abi.json --out bindings.py
python -m zerostyl_sdk generate --abi abi.json
Generated output for the demo circuit:
DEPOSIT_CIRCUIT: Final = {
"name": "deposit",
...
}
@dataclass(frozen=True)
class DepositWitness:
collateral: str
collateral_nonce: str
threshold: str
@dataclass(frozen=True)
class DepositPublicInputs:
collateral_commitment: str
Type mapping: u64/u128 → int, bool → bool, fp/bytes32/address → str
(0x-prefixed hex), arrays → tuple[..., ...].
Tests
python -m pytest
ruff check src tests
The snapshot test locks the generated bindings for
examples/zk_private_demo/abi.json; regenerate with
REGEN_SDK_PY_SNAPSHOTS=1 python -m pytest.
Scope and future work
Codegen only — proof generation from Python (bindings to the Rust prover) and on-chain submission helpers are future work, mirroring the TypeScript SDK's roadmap.
License
MIT — see the repository's LICENSE.
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 zerostyl_sdk-0.1.1.tar.gz.
File metadata
- Download URL: zerostyl_sdk-0.1.1.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbbd54068c25d24054466c78906a9a709187730df53e157bba25dbf76b93634b
|
|
| MD5 |
875f0903747b41a0cea8a597240886d7
|
|
| BLAKE2b-256 |
574bc1165ba569533b61166f50f563a4a78a6c7b618bf8324243953569cc8626
|
File details
Details for the file zerostyl_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: zerostyl_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5117eff5fa27c18cad03e3147e897ca59a592a43845a4696e7287b60352d396
|
|
| MD5 |
f759e9fa5fe6ce5edc57c4c657747631
|
|
| BLAKE2b-256 |
57aa95eb0298bd0a519bb2a487cd21fdbb472b900560f354ef3c1d8976da86d0
|