Quickstart, Python
The fastest path to a sealed Verdifax artifact. You'll have a real manifest hash printed in your terminal in under five minutes.
Prerequisites
- Python 3.9 or newer
- A running Verdifax orchestrator (default
http://localhost:9090). If you don't have one yet, follow Quickstart, Docker first.
1. Install
pip install verdifax
2. Three lines
import verdifax
receipt = verdifax.attest(
payload="hello verdifax",
program_id="a" * 64,
route_id="route-test",
registry_record_hash="b" * 64,
)
print(receipt.manifest_hash)
That's it. receipt.manifest_hash is your sealed proof artifact.
3. Verify
The whole point of the manifest hash is that anyone can re-derive it. Run the same inputs again, the hash is identical, byte-for-byte:
ok = verdifax.verify(
manifest_hash=receipt.manifest_hash,
payload="hello verdifax",
program_id="a" * 64,
route_id="route-test",
registry_record_hash="b" * 64,
)
assert ok is True
If you change any input, even a single character of the payload, the
hash will be different and verify() returns False.
Configuration
By default the SDK talks to http://localhost:9090. Override with an
environment variable:
export VERDIFAX_API_URL=https://api.verdifax.example.com
export VERDIFAX_API_KEY=vfx_your_key_here
Or pass them explicitly:
from verdifax import VerdifaxClient
client = VerdifaxClient(
base_url="https://api.verdifax.example.com",
api_key="vfx_...",
)
receipt = client.attest(
payload="...",
program_id="...",
route_id="...",
registry_record_hash="...",
)
Async
For high-throughput inference servers, use AsyncVerdifaxClient:
import asyncio
from verdifax import AsyncVerdifaxClient
async def main():
async with AsyncVerdifaxClient() as client:
receipt = await client.attest(
payload="hello verdifax",
program_id="a" * 64,
route_id="route-test",
registry_record_hash="b" * 64,
)
print(receipt.manifest_hash)
asyncio.run(main())
Payload canonicalization
When you call verdifax.attest(payload="hello verdifax", ...), the SDK sends the payload as the HTTP request field payload_text, which is the plaintext form. The orchestrator canonicalizes it with the payload prefix payload.v1 before hashing.
The canonical bytes the orchestrator hashes look like:
payload.v1
hello verdifax
For byte payloads, the SDK encodes UTF-8 strings directly and base64-encodes non-UTF-8 bytes. The canonical form is always the same: a plaintext envelope with the payload inside.
Helpers for popular AI providers
For attesting Anthropic Claude / OpenAI prompt-response pairs in one call, use the provider-specific helpers:
import verdifax
receipt = verdifax.attest_claude_response(
prompt="What is the boiling point of water?",
response="100 °C at sea level.",
program_id="a" * 64,
route_id="claude-route",
registry_record_hash="b" * 64,
)
verdifax.attest_openai_response(...) has the same signature. Important: These helpers are helper-specific and canonicalize the prompt + response with a provider-specific prefix. The Claude helper produces:
verdifax.helper.claude.v1
verdifax.helper.prompt.v1
What is the boiling point of water?
verdifax.helper.response.v1
100 °C at sea level.
This means identical text under different providers (attest_claude_response() vs. attest_openai_response()) produces different manifest hashes, which is intentional. The same prompt + response from Claude and from GPT-4 are meaningfully different evidence.
If you don't want provider-specific canonicalization, build the payload yourself and call verdifax.attest() directly with your own formatting.
