Skip to main content

ARC privacy framework: PQ-encrypted, attested, validator-anchored data layer for any application.

Project description

arc-avs-sdk

Python SDK for the ARC Privacy AVS — a Sepolia-anchored validator network that proves applications process user data without retention. Same wire format as @arc-avs/sdk on npm; envelopes round-trip byte-exact between TS and Python.

pip install arc-avs-sdk
# adapters & router are optional extras
pip install "arc-avs-sdk[postgres,neo4j,chain]"

Quick start

import asyncio
from arc_avs_sdk import arc, init
from arc_avs_sdk.adapter.memory import MemoryAdapter

schema = arc.schema(
    app_id     = "your-app.com",
    compliance = ["GDPR", "CCPA"],
    classes    = {
        "User": arc.identity({
            "profile": arc.encrypted.struct({
                "name":  arc.encrypted.string(),
                "email": arc.encrypted.email(),
            }),
            "events": arc.collection(
                item_kind="event",
                query="indexed",
                index_fields=["kind"],
                retention="permanent",
            ),
        }),
    },
)

async def main() -> None:
    runtime = await init(schema, adapter=MemoryAdapter())
    user, _ = await runtime.create_user("User", {"name": "Alice", "email": "a@b.c"})
    ref, proof = await runtime.put_record(
        user, "User", "event", {"kind": "login"}, index_fields={"kind": "login"}
    )
    print(proof.input_hash)

asyncio.run(main())

What's shipped

  • Crypto layer — ML-KEM-768, ML-DSA-65, AES-256-GCM, secp256k1 ECDSA, keccak256
  • Schema DSL — domain-agnostic, byte-canonical, on-chain hash matches the TS canonicalization
  • Runtimecreate_user, put_record, read, list, process, purge_user, export_user
  • Adaptersmemory, postgres, mongo, redis, neo4j (graph-RAG / agent memory)
  • Processorsopenai, anthropic, mistral, kimi, nous
  • Validator routerweb3.py based EIP-712 attestation submission

Compatibility

The Python CipherEnvelope serializes to the same byte layout as the TypeScript SDK. A round-trip test in tests/test_envelope_compat.py proves that an envelope sealed in TS opens in Python and vice-versa.

Property TS Python
Schema canonical hash keccak256(canonicalize_schema(s)) keccak256(canonicalize_schema(s))
bind_aad(app_id, class, seq) byte-identical byte-identical
bind_digest(...) byte-identical byte-identical
proof_bind_digest(...) byte-identical byte-identical

This matters because the on-chain inputHash recorded by PrivacyTaskManager must agree across language stacks.

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

arc_avs_sdk-1.0.0a1.tar.gz (32.8 kB view details)

Uploaded Source

Built Distribution

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

arc_avs_sdk-1.0.0a1-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file arc_avs_sdk-1.0.0a1.tar.gz.

File metadata

  • Download URL: arc_avs_sdk-1.0.0a1.tar.gz
  • Upload date:
  • Size: 32.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for arc_avs_sdk-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 438396c2e2c9f55ceb7900d69e0c2b2305567ee5ef8390b7aa3a15e97a2719dc
MD5 bc490c7ca407a3bc0280e1c5cbfed365
BLAKE2b-256 bda7c2294f3ead8336ecee1f62b96147e4c8c835fd3d5076322ec9d1c151caaf

See more details on using hashes here.

File details

Details for the file arc_avs_sdk-1.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: arc_avs_sdk-1.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 43.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for arc_avs_sdk-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0e61e08724df8af872ed60407fd56baf596d8e14e8fdb64dbb5f3dc21ff1175
MD5 42a27979f7d1ba5920e60364c9c037c9
BLAKE2b-256 4e7779186a514abc5f7c258f761e9ced5020af3f7cc1fdf0a47a4c7697c48fd7

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