Skip to main content

Python client for the TinyZKP proving API — generate and verify ZK-STARK proofs

Project description

tinyzkp

Python client for the TinyZKP proving API — generate and verify ZK-STARK proofs.

Install

pip install tinyzkp

Quick Start

import asyncio
from tinyzkp import TinyZKP

async def main():
    async with TinyZKP("https://api.tinyzkp.com", api_key="tzk_...") as client:
        # Prove a secret is in range [0, 100] — without revealing it
        job_id = await client.prove_template("range_proof", params={
            "min": 0, "max": 100, "witness_steps": [42, 44],
        })

        # Wait for the proof (polls automatically, typically 1-5 seconds)
        proof = await client.wait_for_proof(job_id)

        # Verify it (always free)
        result = await client.verify(proof)
        assert result.ok  # True — verified without learning the secret

asyncio.run(main())

What are witness_steps?

The witness_steps encode your secret value as internal computation steps. They are never revealed to the verifier — only the proof (which vouches for them) is shared.

API

  • TinyZKP(base_url, *, api_key=None, timeout=30.0) — Create a client
  • prove_template(template_id, params={...}) — Submit a proof via template (recommended)
  • prove(program=..., initial_acc=0, final_acc=0, **params) — Submit via raw program
  • prove_status(job_id) — Check job status
  • wait_for_proof(job_id, poll_interval=1.0, timeout=300.0) — Poll until proof is ready
  • verify(proof) — Verify a proof (free)
  • healthz() — Check server health

Templates

Six built-in templates — no cryptography knowledge needed:

Template Proves Example
range_proof A secret is in [min, max] Age verification, credit scores
hash_preimage You know a secret matching a hash Password proofs
computation_attestation f(secret) = public output ML inference proofs
accumulator_step Additive chain is correct Balance updates
policy_compliance Actions within a limit Budget enforcement
data_integrity Data sums to checksum Audit trails

Supports both aiohttp (default) and httpx backends.

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

tinyzkp-0.1.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

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

tinyzkp-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file tinyzkp-0.1.1.tar.gz.

File metadata

  • Download URL: tinyzkp-0.1.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tinyzkp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d1ab2eb07a55a7af916c31b4b9a93ca7557d5d8f5fc5e51054f386f31235c857
MD5 5a45902dddc01d8b4213e2434a61dfd1
BLAKE2b-256 78cb678861ff23aa8d87eeca8d64aa35578eb4987266cab4e3d91edb8b6e3eb7

See more details on using hashes here.

File details

Details for the file tinyzkp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinyzkp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for tinyzkp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 956570678876a4f6b45de53fea959b189e9e3f8e1fcd6a603928f2b25424b3eb
MD5 0023c00e8bb8d84b81efe144804fe802
BLAKE2b-256 8556658d2d092ba85fcfe7918e39785c961b2599dde9e5ac9624c43c98c689df

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