Skip to content

examples: standalone Python receipt verifier for ENTITY TEB v1 - #170

Open
eddyflores100-lang wants to merge 1 commit into
blackmore-technology-group:mainfrom
eddyflores100-lang:add-receipt-verifier
Open

eddyflores100-lang wants to merge 1 commit into
blackmore-technology-group:mainfrom
eddyflores100-lang:add-receipt-verifier

Conversation

@eddyflores100-lang

Copy link
Copy Markdown

Closes #105. Adds examples/verify_receipt.py (stdlib only) that verifies ENTITY Transaction Evidence Bundle v1 receipts: schema check, all required fields, transaction_root_sha256 hash verification, all 14 evidence sections, signature presence. Includes valid + tampered fixtures.

Closes blackmore-technology-group#105.

Adds examples/verify_receipt.py — a standalone Python script (standard library only) that verifies a published ENTITY Transaction Evidence Bundle (TEB) v1 receipt without requiring the full ENTITY runtime.

What it verifies:

- Valid JSON parsing

- Schema field matches entity-transaction-evidence-bundle-v1

- All 8 required top-level fields present (schema, transaction_id, issuer_entity_id, transaction_root_sha256, generated_at_ms, evidence, signature, evidence_boundary)

- transaction_root_sha256 matches SHA-256(canonical_json(evidence)) per §3

- All 14 required evidence sections present per §4

- Signature field is present and well-formed (algorithm, value, key_id, signed_at)

What it does NOT prove (documented in script output):

- The file hasn't been modified since issuance (needs independently trusted expected digest)

- Cryptographic signature validity (needs issuer public key)

- Trust anchor acceptance (deployment decision per §5)

- Factual truth of underlying assertions

Includes two fixtures:

- examples/valid_receipt.json: a synthetic valid receipt that passes all checks

- examples/tampered_receipt.json: same receipt with one field changed, fails hash verification

Usage:

  python3 examples/verify_receipt.py examples/valid_receipt.json   # passes

  python3 examples/verify_receipt.py examples/tampered_receipt.json # fails (hash mismatch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE][BUILD] Add a standalone Python receipt verifier example

1 participant