Skip to main content

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-conformance on crates.io (Rust reference, Apache 2.0)
  • JCS implementation: rfc8785 by Trail of Bits

License

Apache 2.0 ; see LICENSE.

Download files

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

Source Distribution

vauban_x402_stark_receipt-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file vauban_x402_stark_receipt-0.1.0.tar.gz.

File metadata

File hashes

Hashes for vauban_x402_stark_receipt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e6aeb1a228e98e1720011bff92995c49945aeb0550ecab7a462cd8a9b8c480be
MD5 7258de438f5062dffdbfce09b13bca5c
BLAKE2b-256 2ea5ff3c012d77cf9b5cfd32a1e25184f225a73d7585447ba23de4a8e6853e20

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 file

Supported by

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