Skip to main content

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.

Metadata

Release files for tinyzkp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tinyzkp 0.1.1
File Size Uploaded
tinyzkp-0.1.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tinyzkp 0.1.1
File Interpreter ABI Platform
tinyzkp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / tinyzkp-0.1.1.tar.gz

Download URL tinyzkp-0.1.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d1ab2eb07a55a7af916c31b4b9a93ca7557d5d8f5fc5e51054f386f31235c857
BLAKE2b-256 checksum
How to use checksums
78cb678861ff23aa8d87eeca8d64aa35578eb4987266cab4e3d91edb8b6e3eb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / tinyzkp-0.1.1-py3-none-any.whl

Download URL tinyzkp-0.1.1-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
956570678876a4f6b45de53fea959b189e9e3f8e1fcd6a603928f2b25424b3eb
BLAKE2b-256 checksum
How to use checksums
8556658d2d092ba85fcfe7918e39785c961b2599dde9e5ac9624c43c98c689df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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