Skip to main content

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 (from the repo)

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):

# after `pip install` (see above), either form works:
zerostyl-sdk-py generate --abi ../../examples/zk_private_demo/abi.json --out bindings.py
python -m zerostyl_sdk generate --abi ../../examples/zk_private_demo/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/u128int, boolbool, fp/bytes32/addressstr (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. The package is not yet published to PyPI.

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

zerostyl_sdk-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

zerostyl_sdk-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zerostyl_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for zerostyl_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41d4bd60c5385342e8754e7fb5d1c52395810849e411e55f5993be717c59f5bf
MD5 77bd7b98ef99df82c1b16338f2509cd3
BLAKE2b-256 17fc89baeeaa7a1914d5c96438e7fd80c1917627c0815b79617f13ff9b8d27fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zerostyl_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.15

File hashes

Hashes for zerostyl_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c00a321c8eeb31eb9cec9a733f66a0552e81782917f2b6d2d9236eb3ed89cab
MD5 337cc0d0aab0df089fc58ee843972181
BLAKE2b-256 0774349c80bae724bf82d95c92c1787a771795e0ec78ba92219d4241b3e55e79

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page