Metadata-Version: 2.4
Name: arc-avs-sdk
Version: 1.0.0a1
Summary: ARC privacy framework: PQ-encrypted, attested, validator-anchored data layer for any application.
Project-URL: Homepage, https://arc-avs.com
Project-URL: Documentation, https://arc-avs.com/sdk
Project-URL: Repository, https://github.com/arc-avs/sdk
Author: ARC AVS
License: Apache-2.0
Keywords: agent-memory,ai,encryption,ethereum,ml-dsa,ml-kem,post-quantum,privacy,rag,validator
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: coincurve>=20.0
Requires-Dist: cryptography>=42.0
Requires-Dist: dilithium-py>=1.0
Requires-Dist: eth-hash[pycryptodome]>=0.7
Requires-Dist: httpx>=0.27
Requires-Dist: kyber-py>=1.0
Requires-Dist: pydantic>=2.6
Provides-Extra: all
Requires-Dist: asyncpg>=0.29; extra == 'all'
Requires-Dist: motor>=3.4; extra == 'all'
Requires-Dist: neo4j>=5.20; extra == 'all'
Requires-Dist: redis>=5.0; extra == 'all'
Requires-Dist: web3>=7.0; extra == 'all'
Provides-Extra: chain
Requires-Dist: web3>=7.0; extra == 'chain'
Provides-Extra: dev
Requires-Dist: asyncpg>=0.29; extra == 'dev'
Requires-Dist: motor>=3.4; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: neo4j>=5.20; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: redis>=5.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: web3>=7.0; extra == 'dev'
Provides-Extra: mongo
Requires-Dist: motor>=3.4; extra == 'mongo'
Provides-Extra: neo4j
Requires-Dist: neo4j>=5.20; extra == 'neo4j'
Provides-Extra: postgres
Requires-Dist: asyncpg>=0.29; extra == 'postgres'
Provides-Extra: redis
Requires-Dist: redis>=5.0; extra == 'redis'
Description-Content-Type: text/markdown

# 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.

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

## Quick start

```python
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
- **Runtime** — `create_user`, `put_record`, `read`, `list`, `process`, `purge_user`, `export_user`
- **Adapters** — `memory`, `postgres`, `mongo`, `redis`, `neo4j` (graph-RAG / agent memory)
- **Processors** — `openai`, `anthropic`, `mistral`, `kimi`, `nous`
- **Validator router** — `web3.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.
