Repository navigation
examples: standalone Python receipt verifier for ENTITY TEB v1 - #170
Open
eddyflores100-lang wants to merge 1 commit into
Open
eddyflores100-lang wants to merge 1 commit into
eddyflores100-lang wants to merge 1 commit into
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.