Python reference runner for JCS (RFC 8785) preimage discipline in x402 STARK Receipt Format Extension (draft-vauban-x402-stark-receipts).
Project description
vauban-x402-stark-receipt
Python reference runner for JCS canonical preimage discipline in the x402 STARK Receipt Format Extension (draft-vauban-x402-stark-receipts).
Mirrors the Rust crate vauban-x402-jcs-conformance
v0.1.0 API shape. Pure Python ; no Rust toolchain required.
Install
pip install vauban-x402-stark-receipt
API
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-conformanceon crates.io (Rust reference, Apache 2.0) - JCS implementation:
rfc8785by Trail of Bits
License
Apache 2.0 ; see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file vauban_x402_stark_receipt-0.1.0.tar.gz.
File metadata
- Download URL: vauban_x402_stark_receipt-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6aeb1a228e98e1720011bff92995c49945aeb0550ecab7a462cd8a9b8c480be
|
|
| MD5 |
7258de438f5062dffdbfce09b13bca5c
|
|
| BLAKE2b-256 |
2ea5ff3c012d77cf9b5cfd32a1e25184f225a73d7585447ba23de4a8e6853e20
|