Skip to main content

ProofCarryingThought-SDK

CI PyPI version Python versions License: Apache-2.0

Minimal Proof-Carrying Thought (PCT) SDK: canonical bytes, Merkle, local CAS, optional Ed25519 signing, policy gates, and chain-of-custody.

Install

  • From PyPI:

    pip install proofcarryingthought-sdk

  • Optional extras (combine as needed):

    pip install "proofcarryingthought-sdk[crypto]" # PyNaCl for Ed25519 pip install "proofcarryingthought-sdk[dcbor]" # cbor2 for canonical CBOR

  • From source (editable):

  • Base:

    • pip install -e .
  • Optional extras:

    • pip install -e .[crypto] # PyNaCl for Ed25519
    • pip install -e .[dcbor] # cbor2 for canonical CBOR

Canonicalization

  • Modes: auto (default, prefers dCBOR if installed), json (strict JSON), dcbor (requires cbor2)
  • Programmatic: from pct_sdk import set_canonical_mode; set_canonical_mode("auto"|"json"|"dcbor")
  • Env: set PCT_CANON_MODE=auto|json|dcbor

Quick start

from pct_sdk import pct_wrap, verify

evidence = {"units_ok": True, "ocap_list": ["sandbox"]} res = pct_wrap(lambda ev: {"result": "ok"}, include=["units_ok", "ocap_list"]) # noqa: E501 assert verify(res["pct_proof"], evidence)

With crypto:

from pct_sdk.sign import gen_keypair, sign, verify as sig_verify sk_hex, vk_hex = gen_keypair() sig_hex = sign(sk_hex, b"msg") assert sig_verify(vk_hex, b"msg", sig_hex)

CAS usage

from pct_sdk import cas hid = cas.put({"hello": "world"}) obj = cas.get(hid)

Tests

pytest

Changelog

See CHANGELOG.md for release notes.

Metadata

Release files for proofcarryingthought-sdk 0.1.0

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

Source distribution (sdist)

Source distribution for proofcarryingthought-sdk 0.1.0
File Size Uploaded
proofcarryingthought_sdk-0.1.0.tar.gz 10.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for proofcarryingthought-sdk 0.1.0
File Interpreter ABI Platform
proofcarryingthought_sdk-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / proofcarryingthought_sdk-0.1.0.tar.gz

Download URL proofcarryingthought_sdk-0.1.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f12bd2accc739d799bfe4aa6acbc032fd3b88ae9c6826f845643a7a2c4f8d39
BLAKE2b-256 checksum
How to use checksums
1e3be47cc9545d3ee784b7144faa7593aab93978b9a6001164af85962abf7178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / proofcarryingthought_sdk-0.1.0-py3-none-any.whl

Download URL proofcarryingthought_sdk-0.1.0-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15ba6854f3672a51e2ea5f6bea6102b7c406407bb064cc9dd9eb600c15337999
BLAKE2b-256 checksum
How to use checksums
7138f99b16d9283e3121419a11f1ac1aa57fc6ec1d758735aa45139800102972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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