Standalone offline verifier for TWZRD AO-Receipt V5 (Ed25519-signed keccak256 leaf). No trust in TWZRD servers or code.
Project description
TWZRD Receipt Verifier (standalone)
Verify a TWZRD AO-Receipt V5 offline, trusting nothing from TWZRD's servers or codebase - only the receipt, TWZRD's published public key, and two widely-audited crypto libraries.
A TWZRD trust receipt has two layers:
- Tamper-evidence - a
keccak256leaf over the receipt's preimage fields. - Authenticity - an Ed25519 signature over the leaf bytes, made with TWZRD's dedicated receipt-signing key.
This tool recomputes the leaf and checks the signature against the published
key. If it says VALID, the receipt was authored by TWZRD and was not altered.
Unsigned, wrong-key, or tampered receipts fail.
The published signing key
| field | value |
|---|---|
| algorithm | ed25519 |
| key_id | twzrd-receipt-ed25519-v1 |
| public key (base58) | 9V6Pn19kiUA5Rn6JpQfNduanvGt2aXGwsarosNfa2Ldf |
Also published, machine-readable, at:
https://intel.twzrd.xyz/.well-known/x402→receipt.signature.public_keyhttps://intel.twzrd.xyz/openapi.json→x402.receipt.signature.public_key- the MCP card
agent-intel-mcp-card.json→receipt_signing.public_key
Most paranoid mode: pin the key out-of-band with
--pubkeyinstead of fetching it, so you never trust the live endpoint to tell you which key to trust.
Get a receipt to verify
Any TWZRD V5 receipt works. To mint a fresh one, pay the trust endpoint (x402, 0.05 USDC on Solana mainnet) - e.g. via AgentCash:
npx agentcash@latest fetch https://intel.twzrd.xyz/v1/intel/trust/<PUBKEY> > resp.json
# the receipt is the `twzrd_receipt` object in the response
The receipt object looks like:
{
"version": "v5",
"leaf": "0x...",
"preimage": { "domain": "TWZRD:AO_REPUTATION_RECEIPT_V5", "agent_id": "...", "score": 15, "...": "..." },
"signature": "base58 ed25519 sig",
"signing_pubkey": "9V6Pn19kiUA5Rn6JpQfNduanvGt2aXGwsarosNfa2Ldf",
"key_id": "twzrd-receipt-ed25519-v1",
"signing_alg": "ed25519"
}
Python
pip install pynacl pycryptodome # libsodium Ed25519 + original Keccak-256
# fetch the published key and verify:
python verify_twzrd_receipt.py receipt.json
# pin the key out-of-band (recommended):
python verify_twzrd_receipt.py receipt.json --pubkey 9V6Pn19kiUA5Rn6JpQfNduanvGt2aXGwsarosNfa2Ldf
# also confirm a tampered copy FAILS:
python verify_twzrd_receipt.py receipt.json --self-test
# from stdin:
cat receipt.json | python verify_twzrd_receipt.py -
Node
npm install # tweetnacl + js-sha3 + bs58
node verify_twzrd_receipt.js receipt.json
node verify_twzrd_receipt.js receipt.json --pubkey 9V6Pn19kiUA5Rn6JpQfNduanvGt2aXGwsarosNfa2Ldf --self-test
cat receipt.json | node verify_twzrd_receipt.js -
Both exit 0 on VALID, 1 on INVALID.
What it checks (and the exact layout)
The keccak256 leaf preimage is a strict little-endian, length-prefixed concat (reproducible in any language):
domain = "TWZRD:AO_REPUTATION_RECEIPT_V5" (or ...ATTENTION... for attention receipts)
agent_id = u16_le(len(utf8)) || utf8 bytes
score = u16_le
confidence_bps = u16_le
timestamp_unix = u64_le
payer = 32 bytes (base58-decoded pubkey, or sha256(marker) for synthetic payers)
settlement_anchor = 32 bytes (last 32 bytes of the utf-8 settlement_tx string, or 32 zero bytes)
leaf = keccak256(domain || agent_id || score || confidence_bps || timestamp_unix || payer || settlement_anchor)
signature = Ed25519_sign(receipt_signing_key, leaf_bytes)
The verifier:
- recomputes
leaffrom the preimage and compares it toreceipt.leaf, - confirms
receipt.signing_pubkey(if present) equals the trusted key, - verifies the Ed25519
signatureover the 32 leaf bytes against the trusted key.
VALID requires all three. The settlement_tx in the preimage is an on-chain
Solana signature you can independently check for ground truth.
Trust assumptions
You trust: the receipt you were given, the published public key (ideally pinned),
and the crypto libraries (PyNaCl/libsodium, pycryptodome; tweetnacl,
js-sha3). You do not trust TWZRD's API, database, or this repository's other
code. Swap the libraries for your own if you prefer - the byte layout above is the
whole spec.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twzrd_receipt_verifier-1.0.0.tar.gz.
File metadata
- Download URL: twzrd_receipt_verifier-1.0.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733d8e9b9adaf75373d57f84389ed7797313018cb6330dcabb6c5dfa09c80862
|
|
| MD5 |
213b8c121720519425ddfb5a382756ab
|
|
| BLAKE2b-256 |
2227c94111492e8916c55995fa8c7399d184da8486fce1cf0d44b23bae6bcfba
|
File details
Details for the file twzrd_receipt_verifier-1.0.0-py3-none-any.whl.
File metadata
- Download URL: twzrd_receipt_verifier-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60cc26c71c9eca656f6f76494afc1c9db194dc5d93043fa7faabd801d1564225
|
|
| MD5 |
767ea5088344086b568d250517d793e7
|
|
| BLAKE2b-256 |
7143451969a5ed5f36d8176f1b046828d8ac25f8030c9676504fa13a5cb69128
|