snapchore-core
Cryptographic integrity for stateful events — hash, chain, verify.
SnapChore Core is the local hashing library for the SmartBlocks protocol. It provides deterministic, content-addressed block creation with zero network dependencies.
Install
pip install snapchore-core
Optional extras:
pip install snapchore-core[image] # Pillow for image metadata extraction
pip install snapchore-core[device] # Device capture utilities
pip install snapchore-core[moment-auth] # Ed25519 trusted-runtime provenance
Quick start
from snapchore import SmartBlock, SnapChoreChain
# Seal a single event
block = SmartBlock(domain="ai.inference", payload={"tokens": 1500})
block.seal()
assert block.verify()
# Chain multiple events into a tamper-evident ledger
chain = SnapChoreChain()
chain.append(block)
block2 = SmartBlock(domain="ai.inference", payload={"tokens": 2300})
block2.seal()
chain.append(block2)
assert chain.verify()
Lower-level API
from snapchore import snapchore_capture, snapchore_verify
data = {"model": "gpt-4", "tokens": 1500}
h = snapchore_capture(data)
assert snapchore_verify(data, h)
What it does
- Canonical serialization — deterministic JSON surface with float quantization and stable timestamps
- SmartBlock — content-addressed container with domain tagging and metadata
- SnapChoreChain — linked hash ledger for tamper-evident event sequences
- Capture / Verify — convenience functions for one-shot hashing and verification
- Moment Auth v2 — exact device derivation, freshness, replay consumption, a signed seal-subject commitment, and a hash-bound privacy-bounded claim
Moment Auth reports one of two assurance classes. LOCAL_SOFTWARE_CONTEXT
means locally collected software context; TRUSTED_RUNTIME_SIGNED_CONTEXT
means a configured trusted Ed25519 runtime key signed the capture claim. The
latter does not claim TPM, secure-GPS, or trusted-clock attestation. Production
and staging sealing require the trusted-runtime class and a durable replay
store. Development defaults to a process-local guard. Configure the built-in
local-host SQLite ledger before secure sealing:
SNAPCHORE_MOMENT_REPLAY_DB=.snapchore/moment-replay.sqlite3
The SQLite guard is atomic across local worker processes and durable across
restarts. It does not claim distributed replay protection across hosts; a
future runtime may inject another implementation of MomentReplayStore for
that wider scope.
SnapChore Core remains an embeddable proof library. An agent harness should be a separate package that depends on this library and owns its runtime custody directory, process topology, and policy configuration.
Relationship to sbn-sdk
snapchore-core handles local computation (hashing, chaining, verification) with no network calls. To submit blocks to the SmartBlocks Network, use the sbn-sdk which includes a SnapChoreClient for server-side sealing, discovery, and chain management.
License
Apache-2.0
Metadata
Release files for snapchore-core 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| snapchore_core-0.2.0.tar.gz | 61.6 kB | Without provenance | Details for snapchore_core-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| snapchore_core-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for snapchore_core-0.2.0-py3-none-any.whl |
Total release size: 118.7 kB
Release files / snapchore_core-0.2.0.tar.gz
| Download URL | snapchore_core-0.2.0.tar.gz |
|---|---|
| Size | 61.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83866955c164cc5e7c5b769fd0ce71d41aa58c86d39bc41e038aed6fb5f450d2
|
|
BLAKE2b-256 checksum How to use checksums |
97cb8261042916b888549680eeb8139bb2cc1f466cb58b4ca91c860f3a929389
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / snapchore_core-0.2.0-py3-none-any.whl
| Download URL | snapchore_core-0.2.0-py3-none-any.whl |
|---|---|
| Size | 57.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ae4227f977011e50a2bce4a9cd36b8e4e50ee1506baef8666e86204c8f7b6780
|
|
BLAKE2b-256 checksum How to use checksums |
9de72eec829e879f680a383d88c388e69e533b3cdb21fbc5083ac2470c8ce0d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for snapchore-core 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.