Skip to main content

chain-receipt-core (Python)

Reference implementation of the Chain-Receipt v1.0.0 spec (../SCHEMA.md). Provides:

  • Pydantic v2 models (Receipt, Interaction, Chain, Stability, Signature)
  • RFC 8785–compatible canonical JSON
  • SHA-256 hash helpers (receipt_hash, compute_tool_calls_hash, compute_text_hash)
  • Ed25519 sign / verify
  • ReceiptBuilder for emitter-side use
  • verify_receipt, verify_chain
from chain_receipt_core import (
    ClientInfo, Interaction, ReceiptBuilder, generate_keypair, verify_chain,
    compute_text_hash, compute_tool_calls_hash,
)

sk, pub_b64 = generate_keypair()
client = ClientInfo(
    name="chain-receipt-langchain-sdk",
    version="0.1.0",
    platform="python-3.12",
    emitter_pubkey=f"ed25519:{pub_b64}",
)
b = ReceiptBuilder(client=client, private_key=sk,
                   verifier_url="https://chain-determinism.org",
                   chain_seed=pub_b64.encode())

inter = Interaction(
    vendor="anthropic", model="claude-sonnet-4-5", temperature=0.0,
    system_prompt_hash=compute_text_hash("you are helpful"),
    prompt_hash=compute_text_hash("hello"),
    response_hash=compute_text_hash("hi"),
    tool_calls_hash=compute_tool_calls_hash([]),
    n_tool_calls=0, latency_ms=120,
)
r = b.build(interaction=inter)
assert verify_chain([r]).ok

Cross-language conformance vectors live in ../conformance/vectors/.

Metadata

Release files for chain-receipt-core 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chain-receipt-core 0.1.4
File Size Uploaded
chain_receipt_core-0.1.4.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chain-receipt-core 0.1.4
File Interpreter ABI Platform
chain_receipt_core-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / chain_receipt_core-0.1.4.tar.gz

Download URL chain_receipt_core-0.1.4.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
536d72e2b3b45dea325942f6d2eb29b374106484a2bc6edcd56dab3b2d933cc1
BLAKE2b-256 checksum
How to use checksums
62731656cfdef7b706c8a7a5d5ba796d6358490681aa7243bdf91272c543b2be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Release files / chain_receipt_core-0.1.4-py3-none-any.whl

Download URL chain_receipt_core-0.1.4-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d9263c0e3c8b6f467131d2f36599d91ed126ebbae38e25f9584f84d267094be
BLAKE2b-256 checksum
How to use checksums
a5be5c92d60c5e409ca88a879d495b851f60b4f624079a3d39313cd197202d33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page