Skip to main content

aimarket-zk

Documentation

Document Description
User guide Install, configure, verify plugin is loaded
User cases Personas and cross-plugin workflows
SDK integration Code examples and hook behavior

Zero-knowledge proofs for private AI capability invocation. Consumer proves "I sent valid input matching the schema" without revealing the input. Provider proves "I executed correctly" without revealing model weights or computation trace. Neither party sees the other's private data.

When to Use

  • Consumer sends proprietary business data — wants proof it was processed correctly, but doesn't want provider to see it
  • Provider runs proprietary model — wants to prove correct execution without revealing weights
  • Regulatory compliance — prove invocation happened correctly without disclosing contents
  • Double-spend protection — ZK nullifiers prevent replay attacks on paid invocations

Installation

pip install aimarket-zk

Or from a checkout of the monorepo:

pip install -e plugins/aimarket-zk

Proving backend: the plugin loads and registers its routes with no backend configured, and the /zk/* endpoints then refuse with an explanation rather than the plugin vanishing from the catalogue. Set AIMARKET_ZK_SIMULATED=1 for the development simulation — it is not real zero-knowledge and the hub says so at every call.

Example

from aimarket_hub.signing import Signer
from aimarket_zk.zk_proofs import ZKProver

signer = Signer()
prover = ZKProver(signer)

schema = {"type": "object", "properties": {"text": {"type": "string"}}}
secret_input = {"text": "confidential merger terms between CorpA and CorpB"}

# Consumer: prove input is valid without revealing it
input_proof = prover.prove_input("legal.review@v1", schema, secret_input)
print(f"Input commitment: {input_proof.input_commitment[:16]}...")
# Provider sees only the hash — not "confidential merger terms"

# Provider: verify input proof → execute → prove output
import hashlib, json
schema_hash = hashlib.sha256(json.dumps(schema, sort_keys=True).encode()).hexdigest()
verification = prover.verify_input_proof(input_proof, schema_hash, "legal.review@v1",
                                         signer.public_key_b64)
print(f"Input proof valid: {verification['valid']}")  # True
print(f"Privacy: {verification['reason']}")  # "input is valid without being revealed"

# Full private invoke cycle (input + output proofs)
def executor(pid, cid, inp):
    return {"risk_assessment": "low", "issues_found": 0}

result = prover.private_invoke_flow(
    "legal.review@v1", "prod-legal",
    schema, secret_input, executor
)
print(f"Success: {result['success']}")
print(f"Privacy: {result['privacy_guarantees']}")
# {"input_hidden": true, "execution_trace_hidden": true,
#  "double_spend_protected": true, "zk_scheme": "Groth16 (simulated)"}

ZK Scheme

Reference implementation uses simulated Groth16 for development. Production: circom circuits compiled to bn254 curve via bellman/gnark. The interface is identical — swap the prover backend and proofs become cryptographically sound.

License

MIT · Maintained by AI-Factory

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aimarket_zk-2.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

aimarket_zk-2.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file aimarket_zk-2.1.0.tar.gz.

File metadata

  • Download URL: aimarket_zk-2.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for aimarket_zk-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f35671375c8cbb2cfd14c47dc614bc08c84d925a1525b986312db23b231cc116
MD5 eee4ae5e8eb6d094c01aefec6305884b
BLAKE2b-256 00adb3178cc77c48e96d06300ffa9ac779777b0c186a72a89956bb50a3e6449c

See more details on using hashes here.

File details

Details for the file aimarket_zk-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: aimarket_zk-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for aimarket_zk-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fb2ace861c179a454fb2b89f28620cc482dde0ab2028bc96986c3b326f49ca5
MD5 e9d81d52f5413c7f7cb1a1a5b1744bb9
BLAKE2b-256 5aefcd9e608f1d29c3af79ea9711376d056734003ca789b06299edeb79ab28af

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page