VerdifaX

client.attest()

The headline call. Runs a payload through the orchestrator's nine stages and returns a sealed receipt containing the manifest hash.

Signature

client.attest(
    payload: str | bytes,
    program_id: str,
    route_id: str,
    registry_record_hash: str,
) -> AttestationReceipt
ArgumentTypeNotes
payloadstr or bytesUTF-8 strings sent as payload_text; bytes decoded as UTF-8 if possible, otherwise base64
program_idstr64-char lowercase hex
route_idstrNon-empty
registry_record_hashstr64-char lowercase hex

Return value

AttestationReceipt. See AttestationReceipt for full field reference. Most callers just want receipt.manifest_hash.

Raises

ExceptionWhen
ValidationErrorClient-side validation failed (bad hex, empty route, wrong type)
StageErrorA specific pipeline stage rejected the run; check .stage
APIErrorAPI returned a non-2xx response that wasn't a stage error
ConnectionErrorCouldn't reach the API

All four inherit from VerdifaxError for single-except handling.

Example

from verdifax import VerdifaxClient

with VerdifaxClient() as client:
    receipt = client.attest(
        payload="hello verdifax",
        program_id="a" * 64,
        route_id="route-test",
        registry_record_hash="b" * 64,
    )
    print(receipt.manifest_hash)

Determinism

Identical inputs produce identical receipts. The SDK enforces this by canonicalizing the request body — payload_text always wins over payload when the input is a UTF-8 string.

Module-level shortcut

For one-shot scripts, verdifax.attest(...) is a convenience that constructs a client from env vars, runs the call, and closes the client:

import verdifax
receipt = verdifax.attest(
    payload="hi", program_id="a"*64, route_id="r", registry_record_hash="b"*64,
)

For high-throughput use, instantiate VerdifaxClient yourself and reuse.

Continue