OCG Verify Badge: embed demo & fixtures

An embeddable, self-contained badge that lets a third party publish an OCG receipt on their own page and let a reader verify it there. Ships as a single JS file: /chaingraph/ocg-verify-badge.js.

đź”’ Everything on this page runs locally in your browser. No data is transmitted. The receipts below are synthetic fixtures. Do not paste real receipts containing production data into a page you do not control.

Embed

<script src="https://ainumbers.co/chaingraph/ocg-verify-badge.js" defer></script>
<div data-ocg-verify data-ocg-receipt-ref="my-receipt"></div>
<script type="application/json" id="my-receipt">
  ...the OCG receipt JSON...
</script>

The badge starts in an UNVERIFIED state and does nothing until clicked (or activated with Enter/Space). Clicking it runs the verify entirely in-page. The receipt bytes are already sitting in the host page's DOM, so no request ever leaves the browser. A "Full report" link then deep-links to the site's own OCG Receipt Verifier for the full multi-check UI, passing the receipt in the URL fragment (never a query string) using the fragment convention (#in=<base64url-json>&run=1) already shipped on every tool page's AIN Bridge block.

Zero-egress

The badge script makes no network call of any kind: no phone-home, no usage counter, no remote font or icon fetch (inline SVG glyphs, system font stack). Open this page's Network panel and click either badge below. No request fires. The only network-adjacent action is the "Full report" link, which is a normal user-initiated top-level navigation, not a background fetch.

CSP note

The badge has no external script/style/font URLs, so it satisfies a strict host CSP (script-src 'self') once self-hosted. This page's own CSP header above is one example.

Live fixtures

Golden receipt (expect: PASS)
Tampered receipt (expect: FAIL, output_payload mutated after signing)

Automated self-test

Runs both fixtures through the badge on load, and checks that the "Full report" deep-link fragment decodes (with this site's existing b64uDec convention) back to the exact receipt JSON that was verified, with run=1 set.

Running…