Metadata-Version: 2.4
Name: vauban-x402-stark-receipt
Version: 0.1.0
Summary: Python reference runner for JCS (RFC 8785) preimage discipline in x402 STARK Receipt Format Extension (draft-vauban-x402-stark-receipts).
Project-URL: Homepage, https://pay.vauban.tech
Project-URL: Repository, https://github.com/vauban-org/vauban-zkpay
Project-URL: Documentation, https://github.com/vauban-org/x402-stark-receipts-conformance
Project-URL: IETF Draft, https://datatracker.ietf.org/doc/draft-vauban-x402-stark-receipts/
Author-email: Vauban Research <research@vauban.tech>
License-Expression: Apache-2.0
Keywords: canonical,ietf,jcs,preimage,receipt,stark,x402
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Requires-Dist: rfc8785>=0.1.4
Description-Content-Type: text/markdown

# vauban-x402-stark-receipt

Python reference runner for JCS canonical preimage discipline in the x402 STARK Receipt Format
Extension ([draft-vauban-x402-stark-receipts](https://datatracker.ietf.org/doc/draft-vauban-x402-stark-receipts/)).

Mirrors the Rust crate [`vauban-x402-jcs-conformance`](https://crates.io/crates/vauban-x402-jcs-conformance)
v0.1.0 API shape. Pure Python ; no Rust toolchain required.

## Install

```
pip install vauban-x402-stark-receipt
```

## API

```python
from vauban_x402_stark_receipt import jcs_canonical_bytes, jcs_hash, jcs_sha256, validate_pair_invariant

# JCS-canonical UTF-8 bytes (RFC 8785)
raw = jcs_canonical_bytes({"b": 2, "a": 1})
# b'{"a":1,"b":2}'

# Canonical preimage + digest
b64, digest = jcs_hash({"amount": 100, "currency": "STRK"})
# ("eyJhbW91bnQ...", "sha256:abcdef...")

# Digest only
d = jcs_sha256({"amount": 100})
# "sha256:abcdef..."

# Pair invariant: left and right produce distinct digests
ok = validate_pair_invariant({"a": 1}, {"a": 2})
# True
```

## Provenance

- IETF I-D: `draft-vauban-x402-stark-receipts` ; JCS preimage discipline, Section 4.2
- Sister crate: `vauban-x402-jcs-conformance` on crates.io (Rust reference, Apache 2.0)
- JCS implementation: [`rfc8785`](https://pypi.org/project/rfc8785/) by Trail of Bits

## License

Apache 2.0 ; see LICENSE.
