Freehold Specification
S-PAL schema, protocol specifications, and documentation for Personal Context Infrastructure.
Overview
This repository contains the core specifications for Freehold:
- S-PAL (Sovereign Privacy & Access Language) - Machine-readable privacy policies with cryptographic enforcement
- Protocol definitions - Negotiation and federation protocols
- API specifications - OpenAPI specs for Freehold components
Structure
schemas/
├── spal/
│ └── v1.0/
│ ├── schema.json # JSON Schema for S-PAL policies
│ └── examples/ # Example policies
└── encoding/
└── v1.0/
└── test-vectors.json # Canonical preimage encoding test vectors
protocols/
├── negotiation.md # S-PAL negotiation protocol
├── federation.md # Community federation protocol
└── preimage-encoding.md # Canonical injective, domain-separated encoding
api/
└── openapi/
└── agent-api.yaml # Personal Agent API spec
docs/
└── architecture.md # High-level architecture overview
S-PAL Quick Reference
S-PAL policies define:
context_scope- Which data subset to accessidentity_linkage- Ephemeral DID requirementsproof_requirement- Zero-knowledge proof claimsderivative_use- Training/aggregation permissionsdata_retention- Cryptographic deletion timingpayment_protocol- x402 micropayment requirements
Canonical Preimage Encoding
Every signed or committed multi-field preimage in Freehold — S-PAL commitments, ZK
public inputs, DID-signed request envelopes — uses a single injective,
domain-separated encoding so that distinct field tuples can never collide to the
same bytes. The rule, the domain-separator registry, the per-structure field
lists, and adversarial test vectors are in
protocols/preimage-encoding.md. Downstream
repositories implement against it.
A dependency-free Python reference implementation lives in
src/freehold_preimage: the canonical encoder, a round-trip
decoder that re-derives the field tuple for every vector, and the generator
that produces
schemas/encoding/v1.0/test-vectors.json
— so the vectors are reproducible rather than trusted. Run the conformance
suite with uv run pytest; regenerate the vectors with
uv run python -m freehold_preimage.generate_vectors.
Related Repositories
- pci-context-store - Layer 1: Encrypted vault
- freehold-agent - Layer 2: Local AI agent
- pci-contracts - Layer 3: Smart contracts
- pci-zkp - Layer 4: Zero-knowledge proofs
License
Apache 2.0
Metadata
Release files for freehold-preimage 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 | |
|---|---|---|---|
| freehold_preimage-0.2.0.tar.gz | 10.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| freehold_preimage-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.7 kB
Release files / freehold_preimage-0.2.0.tar.gz
| Download URL | freehold_preimage-0.2.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02fa2deef02fe270a09327bf5c9935e341b61a549357e8864331203feee02c32
|
|
BLAKE2b-256 checksum How to use checksums |
158d001000572dcecedae670c9be52a3cf52c34e3c6d95d43538260a2d080635
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency logRelease files / freehold_preimage-0.2.0-py3-none-any.whl
| Download URL | freehold_preimage-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f0e9ee2bf9434662c2bda5adaa9923e243889c8e01a2330569dedec91aaab11
|
|
BLAKE2b-256 checksum How to use checksums |
cc751d1b881dcfe5b6b28c954e2980ee075698b2fb5f6297e41e7d84095942fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.
Transparency log