Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
<!doctype html>
<html lang="en">
<head>
<script>/* three.ws theme boot — no-flash */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
<meta charset="utf-8">
<title data-i18n="vanity_verify_index.meta_title">Verify a vanity receipt · three.ws</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Independently verify a three.ws provably-fair vanity wallet receipt: entirely in your browser. Prove the key was generated fresh under a committed seed and the operator never kept a copy." data-i18n-attr="content:vanity_verify_index.meta_description">
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" href="/footer.css">
<link rel="stylesheet" href="/nav.css">
<link rel="stylesheet" href="/fonts/fonts.css" />
<script defer src="/footer-newsletter.js"></script>
<meta property="og:title" content="Verify a provably-fair vanity wallet · three.ws" data-i18n-attr="content:vanity_verify_index.meta_og_title">
<meta property="og:description" content="Prove your three.ws vanity key was generated fresh and never kept: verification runs entirely in your browser." data-i18n-attr="content:vanity_verify_index.meta_og_description">
<meta name="twitter:card" content="summary_large_image">
<style>
* { box-sizing: border-box; }
:root {
color-scheme: dark;
--fg: #f0f0f0; --muted: #888; --border: rgba(255,255,255,0.08); --bg: #111;
--accent: #fff; --accent-fg: #000;
--ok-bg: rgba(74,222,128,0.10); --ok-fg: #4ade80;
--warn-bg: rgba(251,191,36,0.1); --warn-fg: #fbbf24;
--bad-bg: rgba(239,68,68,0.1); --bad-fg: #f87171;
--card-bg: #0f0f0f;
--font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
--radius-md: 8px;
}
body { font: 15px/1.5 'Inter', system-ui, -apple-system, sans-serif; background:#000; color:var(--fg); margin:0; min-height:100vh; display:flex; flex-direction:column; }
main { flex:1; max-width:720px; width:100%; margin:0 auto; padding:2.5rem 1rem 3rem; }
h1 { font-size:1.6rem; margin:0 0 .35rem; font-family:var(--font-display); letter-spacing:-0.02em; }
.lede { color:var(--muted); margin:0 0 1.5rem; max-width:60ch; }
.card { border:1px solid var(--border); border-radius:var(--radius-md); padding:1.15rem 1.25rem; background:var(--card-bg); margin-bottom:1.1rem; }
label { display:block; font-size:.78rem; color:var(--muted); margin:0 0 .4rem; text-transform:uppercase; letter-spacing:.04em; }
textarea, input[type=text] { font-family:ui-monospace,'SF Mono',monospace; font-size:.82rem; width:100%; border:1px solid rgba(255,255,255,0.12); border-radius:6px; background:#161616; color:var(--fg); padding:.6rem .7rem; resize:vertical; }
textarea:focus, input[type=text]:focus { outline:none; border-color:rgba(255,255,255,0.32); }
textarea { min-height:9rem; }
.optional-row { margin-top:.9rem; }
details { margin-top:.5rem; }
summary { cursor:pointer; color:var(--muted); font-size:.85rem; user-select:none; }
summary:hover { color:#ccc; }
.btn-row { display:flex; gap:.6rem; flex-wrap:wrap; margin-top:1rem; align-items:center; }
button.primary { font:inherit; font-weight:600; background:var(--accent); color:var(--accent-fg); border:none; border-radius:7px; padding:.6rem 1.2rem; cursor:pointer; transition:transform var(--duration-fast), opacity var(--duration-fast); }
button.primary:hover { transform:translateY(-1px); }
button.primary:active { transform:translateY(0); }
button.primary:disabled { opacity:.5; cursor:default; transform:none; }
button.ghost { font:inherit; background:transparent; color:var(--muted); border:1px solid var(--border); border-radius:7px; padding:.6rem 1rem; cursor:pointer; }
button.ghost:hover { color:#ccc; border-color:rgba(255,255,255,0.25); }
.muted-note { color:#666; font-size:.74rem; margin-top:.55rem; line-height:1.5; }
.muted-note strong { color:#999; }
/* verdict banner */
.verdict { display:none; align-items:center; gap:.8rem; border-radius:var(--radius-md); padding:1rem 1.2rem; margin-bottom:1.1rem; font-weight:600; }
.verdict.show { display:flex; }
.verdict.ok { background:var(--ok-bg); color:var(--ok-fg); border:1px solid rgba(74,222,128,0.3); }
.verdict.partial { background:var(--warn-bg); color:var(--warn-fg); border:1px solid rgba(251,191,36,0.3); }
.verdict.bad { background:var(--bad-bg); color:var(--bad-fg); border:1px solid rgba(239,68,68,0.3); }
.verdict .vmark { font-size:1.4rem; line-height:1; }
.verdict .vtext small { display:block; font-weight:400; opacity:.85; font-size:.78rem; margin-top:.15rem; }
/* checks list */
.checks { display:none; }
.checks.show { display:block; }
.check { display:flex; gap:.7rem; padding:.7rem 0; border-bottom:1px solid var(--border); }
.check:last-child { border-bottom:none; }
.check .mark { font-size:1rem; flex:0 0 1.2rem; text-align:center; margin-top:.05rem; }
.check.pass .mark { color:var(--ok-fg); }
.check.fail .mark { color:var(--bad-fg); }
.check .body { flex:1; min-width:0; }
.check .label { font-weight:600; font-size:.9rem; }
.check.fail .label { color:var(--bad-fg); }
.check .detail { color:var(--muted); font-size:.78rem; margin-top:.2rem; word-break:break-word; font-family:ui-monospace,monospace; }
.skeleton { height:1.1rem; background:linear-gradient(90deg,#1a1a1a,#222,#1a1a1a); background-size:200% 100%; animation:sk 1.2s infinite; border-radius:4px; margin:.6rem 0; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.meta-grid { display:grid; grid-template-columns:auto 1fr; gap:.35rem .9rem; font-size:.82rem; margin-top:.4rem; }
.meta-grid dt { color:var(--muted); }
.meta-grid dd { margin:0; font-family:ui-monospace,monospace; word-break:break-all; }
.error-box { display:none; background:var(--bad-bg); border:1px solid rgba(239,68,68,0.3); color:var(--bad-fg); border-radius:6px; padding:.7rem .85rem; font-size:.84rem; margin-top:.8rem; }
.error-box.show { display:block; }
.pin-line { font-size:.74rem; color:#666; margin-top:.7rem; }
.pin-line .key { font-family:ui-monospace,monospace; color:#999; }
.pin-line.pinned { color:var(--ok-fg); }
.explainer { border:1px solid var(--border); border-radius:var(--radius-md); background:#0c0c0c; padding:1.1rem 1.25rem; }
.explainer h2 { font-size:1rem; margin:0 0 .6rem; font-family:var(--font-display); }
.explainer ol { margin:0; padding-left:1.2rem; color:var(--muted); font-size:.86rem; }
.explainer li { margin:.4rem 0; }
.explainer code { background:#1a1a1a; padding:1px 5px; border-radius:4px; font-size:.8em; color:#bbb; }
.share-row { display:none; margin-top:1rem; gap:.6rem; flex-wrap:wrap; }
.share-row.show { display:flex; }
.badge { display:inline-flex; align-items:center; gap:.45rem; background:var(--ok-bg); border:1px solid rgba(74,222,128,0.35); color:var(--ok-fg); border-radius:999px; padding:.35rem .85rem; font-size:.78rem; font-weight:600; }
a.link { color:#ffd54f; text-decoration:none; border-bottom:1px solid rgba(255,213,79,.4); }
a.link:hover { border-bottom-color:#ffd54f; }
/* Keyboard focus. The inputs suppress the UA outline for a calmer mouse
focus, so give every interactive element an explicit, high-contrast
ring for keyboard users. Declared last so it wins over the :focus rule
above at equal specificity. */
a:focus-visible, button:focus-visible, summary:focus-visible,
textarea:focus-visible, input[type=text]:focus-visible {
outline:2px solid var(--accent); outline-offset:2px; border-radius:4px;
}
</style>
<link rel="canonical" href="https://three.ws/vanity/verify">
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
<meta property="og:type" content="website">
<meta property="og:site_name" content="three.ws">
<meta property="og:locale" content="en_US">
<meta property="og:url" content="https://three.ws/vanity/verify">
<meta property="og:image" content="https://three.ws/api/page-og?s=crypto&t=Verify+a+Vanity+Receipt&d=Independently+verify+a+three.ws+provably-fair+vanity+wallet+receipt%3A+entirely+in+your+browser.+Prove+the+key+was+generated+fresh+under+a+committed+seed+and+the&p=%2Fvanity%2Fverify">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:type" content="image/png">
<meta property="og:image:alt" content="Verify a Vanity Receipt — three.ws">
<meta name="twitter:site" content="@trythreews">
<meta name="twitter:title" content="Verify a Vanity Receipt · three.ws" data-i18n-attr="content:vanity_verify_index.meta_twitter_title">
<meta name="twitter:description" content="Independently verify a three.ws provably-fair vanity wallet receipt: entirely in your browser. Prove the key was generated fresh under a committed seed and the operator never kept a copy." data-i18n-attr="content:vanity_verify_index.meta_twitter_description">
<meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&t=Verify+a+Vanity+Receipt&d=Independently+verify+a+three.ws+provably-fair+vanity+wallet+receipt%3A+entirely+in+your+browser.+Prove+the+key+was+generated+fresh+under+a+committed+seed+and+the&p=%2Fvanity%2Fverify">
<script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Verify a Vanity Receipt","description":"Independently verify a three.ws provably-fair vanity wallet receipt — entirely in your browser. Prove the key was generated fresh under a committed seed and the operator never kept a copy.","url":"https://three.ws/vanity/verify","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=crypto&t=Verify+a+Vanity+Receipt&d=Independently+verify+a+three.ws+provably-fair+vanity+wallet+receipt+%E2%80%94+entirely+in+your+browser.+Prove+the+key+was+generated+fresh+under+a+committed+seed+and+the&p=%2Fvanity%2Fverify"},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://three.ws/"},{"@type":"ListItem","position":2,"name":"Vanity","item":"https://three.ws/vanity"},{"@type":"ListItem","position":3,"name":"Verify","item":"https://three.ws/vanity/verify"}]}]}</script>
<!-- Resolve the bare specifiers that verifiable-grind.js / sealed-envelope.js import, without a bundler
(those files are served verbatim from dist/src/ by the copy-src-to-dist Vite plugin). esm.sh ships each
package's ESM build; versions pinned to package.json's installed resolutions. -->
<script type="importmap">
{
"imports": {
"bs58": "https://esm.sh/[email protected]",
"@noble/curves/ed25519.js": "https://esm.sh/@noble/[email protected]/ed25519.js",
"@noble/hashes/sha256": "https://esm.sh/@noble/[email protected]/sha256",
"@noble/hashes/hmac": "https://esm.sh/@noble/[email protected]/hmac",
"@noble/hashes/hkdf": "https://esm.sh/@noble/[email protected]/hkdf",
"@noble/hashes/utils": "https://esm.sh/@noble/[email protected]/utils"
}
}
</script>
</head>
<body>
<a href="#main-content" class="skip-link" data-i18n="vanity_verify_index.skip_to_main_content">Skip to main content</a>
<header><div id="nav-container"></div></header>
<script src="/nav.js"></script>
<main id="main-content">
<h1 data-i18n="vanity_verify_index.verify_a_vanity_receipt">Verify a vanity receipt</h1>
<p class="lede" data-i18n-html="vanity_verify_index.paste_the_receipt_from_a_three_ws">
Paste the receipt from a <a class="link" href="/vanity-wallet">three.ws provably-fair vanity wallet</a> and prove,
from first principles, that the key was generated <strong>fresh</strong> under a seed the server committed to
<em>before</em> grinding — and that the operator could never have kept a copy.
<strong>Everything runs in your browser.</strong> Your X25519 private key and the recovered secret never leave this page.
</p>
<div class="verdict" id="verdict" role="status" aria-live="polite">
<span class="vmark" id="vmark"></span>
<span class="vtext"><span id="vtext-main"></span><small id="vtext-sub"></small></span>
</div>
<div class="card">
<label for="receipt" data-i18n="vanity_verify_index.receipt_json">Receipt JSON</label>
<textarea id="receipt" placeholder='Paste the full receipt object you received from /api/x402/vanity-verifiable…' spellcheck="false" autocomplete="off"></textarea>
<details class="optional-row">
<summary data-i18n="vanity_verify_index.optional_prove_you_hold_the_key_open">Optional: prove you hold the key (open the sealed envelope locally)</summary>
<div style="margin-top:.8rem">
<label for="x25519" data-i18n-html="vanity_verify_index.your_x25519_private_key_base58_or_hex">Your X25519 private key <span style="text-transform:none;color:#555">(Base58 or hex — used only in your browser)</span></label>
<input id="x25519" type="text" placeholder="The secret key matching the sealTo you sent" spellcheck="false" autocomplete="off" />
<p class="muted-note" data-i18n-html="vanity_verify_index.private_this_key_is_used_only_to"><strong>Private.</strong> This key is used only to decrypt the sealed secret right here in your browser, then verify that the key you recover is exactly the one the receipt describes. It is never sent anywhere.</p>
</div>
</details>
<div class="error-box" id="error"></div>
<div class="btn-row">
<button class="primary" id="verify-btn" data-i18n="vanity_verify_index.verify_receipt">Verify receipt</button>
<button class="ghost" id="clear-btn" data-i18n="vanity_verify_index.clear">Clear</button>
<a class="link" href="/vanity-wallet" style="margin-left:auto;font-size:.85rem" data-i18n="vanity_verify_index.need_a_receipt_grind_a_wallet">Need a receipt? Grind a wallet →</a>
</div>
<div class="pin-line" id="pin-line">Pinning against the live service key from <code>/.well-known/three-vanity.json</code>…</div>
</div>
<div class="card" id="results-card" style="display:none">
<div class="checks" id="checks"></div>
<div id="meta" style="margin-top:1rem"></div>
<div class="share-row" id="share-row">
<span class="badge" data-i18n="vanity_verify_index.verified_trustless_three_ws">✓ Verified trustless · three.ws</span>
<button class="ghost" id="copy-badge" data-i18n="vanity_verify_index.copy_verified_badge">Copy verified badge</button>
<a class="link" id="publish-link" href="/vanity/gallery#tab=publish" style="align-self:center;font-size:.85rem" data-i18n="vanity_verify_index.publish_to_the_rarity_gallery">Publish to the rarity gallery →</a>
</div>
</div>
<div class="explainer">
<h2 data-i18n="vanity_verify_index.what_does_this_prove">What does this prove?</h2>
<ol>
<li data-i18n-html="vanity_verify_index.the_commitment_opens_equals_the_value_the"><strong>The commitment opens.</strong> <code>SHA-256(serverSeed)</code> equals the value the server published before grinding — so it couldn't grind thousands of candidates and hand you the one whose key it kept.</li>
<li data-i18n-html="vanity_verify_index.neither_side_controlled_the_result_your_was"><strong>Neither side controlled the result.</strong> Your <code>clientSeed</code> was mixed into the seed, so the server couldn't have predicted the address at commit time.</li>
<li data-i18n-html="vanity_verify_index.the_address_really_derives_from_that_seed"><strong>The address really derives from that seed</strong> at the claimed index — re-derived here with the same HMAC-SHA256 → Ed25519 derivation.</li>
<li data-i18n-html="vanity_verify_index.it_matches_your_pattern_and_the_difficulty"><strong>It matches your pattern</strong> and the difficulty claim is the honest <code>58ⁿ</code> model.</li>
<li data-i18n-html="vanity_verify_index.three_ws_signed_it_the_ed25519_signature"><strong>three.ws signed it.</strong> The Ed25519 signature verifies against the service key pinned from the well-known document — not an impostor.</li>
<li data-i18n-html="vanity_verify_index.if_you_open_the_seal_the_key"><strong>(If you open the seal)</strong> the key you decrypt is byte-for-byte the key the receipt describes — you, and only you, hold it.</li>
</ol>
<p class="muted-note" style="margin-top:.9rem" data-i18n-html="vanity_verify_index.protocol_verify_offline_with_the_open_source">Protocol <code>three-vanity/v1</code> · verify offline with the open-source CLI <code>scripts/verify-vanity-receipt.mjs</code> or the <code>@three-ws/solana-agent</code> SDK's <code>verifyVanityReceipt()</code>. <a class="link" href="/.well-known/three-vanity.json">View the service key →</a></p>
</div>
</main>
<footer class="h-footer-horizon"><div class="h-footer-inner" style="text-align:center;padding:2rem 1rem;color:#555;font-size:.8rem">three.ws — provably-fair vanity grinding</div></footer>
<script type="module">
const $ = (id) => document.getElementById(id);
const receiptEl = $('receipt');
const x25519El = $('x25519');
const verifyBtn = $('verify-btn');
const errorEl = $('error');
const pinLineEl = $('pin-line');
let pinnedKey = null;
// The verifier and the envelope opener load on demand instead of as
// top-level imports. A static import that fails (module CDN blocked, a
// captive portal, offline) aborts this entire script, which would leave
// every control on the page bound to nothing and clicking Verify would
// do nothing at all. Loading them lazily keeps the UI wired and turns a
// module outage into a designed, retryable error.
const VERIFIER_OFFLINE =
'The in-browser verifier could not load, so nothing was checked. Your network or an extension is likely blocking the cryptography modules. ' +
'Press "Verify receipt" to retry, or verify offline with the open-source CLI: node scripts/verify-vanity-receipt.mjs receipt.json';
let verifierPromise = null;
function loadVerifier() {
if (!verifierPromise) {
verifierPromise = Promise.all([
import('/src/solana/vanity/verifiable-grind.js'),
import('/src/solana/vanity/sealed-envelope.js'),
])
.then(([grind, envelope]) => ({
verifyVanityReceipt: grind.verifyVanityReceipt,
openSealedText: envelope.openSealedText,
}))
.catch(() => {
verifierPromise = null; // so the next click genuinely retries
throw new Error(VERIFIER_OFFLINE);
});
}
return verifierPromise;
}
// Warm the modules immediately so the first verification is instant, and
// tell the reader up front if they will not load at all.
loadVerifier().catch((e) => showError(e.message));
// Pin the live service key from the well-known document so an impostor
// receipt (self-signed under a different key) is caught.
(async () => {
try {
const res = await fetch('/.well-known/three-vanity.json', { headers: { accept: 'application/json' } });
if (!res.ok) throw new Error(res.status);
const doc = await res.json();
pinnedKey = doc?.serviceKey?.publicKeyBase58;
if (pinnedKey) {
pinLineEl.classList.add('pinned');
pinLineEl.innerHTML = 'Pinned to the live three.ws service key <span class="key">' + pinnedKey.slice(0, 8) + '…' + pinnedKey.slice(-6) + '</span>';
} else throw new Error('missing key');
} catch (e) {
pinLineEl.innerHTML = '<span style="color:var(--warn-fg)">Could not fetch the live service key — verifying against the receipt’s own key (unpinned). The signature still checks out, but pin against <code>/.well-known/three-vanity.json</code> to prove the signer is three.ws.</span>';
}
})();
function showError(msg) { errorEl.textContent = msg; errorEl.classList.add('show'); }
function clearError() { errorEl.classList.remove('show'); }
function escapeHtml(s) { return String(s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c])); }
function renderSkeleton() {
const card = $('results-card');
card.style.display = 'block';
$('checks').classList.add('show');
$('checks').innerHTML = '<div class="skeleton" style="width:90%"></div><div class="skeleton" style="width:75%"></div><div class="skeleton" style="width:85%"></div><div class="skeleton" style="width:60%"></div>';
$('meta').innerHTML = '';
$('share-row').classList.remove('show');
$('verdict').classList.remove('show');
}
function renderResult(result, receipt, { pinned } = { pinned: true }) {
const checksEl = $('checks');
checksEl.innerHTML = result.checks.map((c) =>
'<div class="check ' + (c.pass ? 'pass' : 'fail') + '">' +
'<span class="mark">' + (c.pass ? '✓' : '✗') + '</span>' +
'<span class="body"><span class="label">' + escapeHtml(c.label) + '</span>' +
'<span class="detail">' + escapeHtml(c.detail) + '</span></span>' +
'</div>'
).join('');
// Full "provably fair" only when every check passed AND we pinned the
// signer against the independent well-known key. Internally-valid but
// unpinned → a deliberately cautious "partial" state, not a green pass.
const fullyTrustless = result.valid && pinned;
const verdict = $('verdict');
verdict.className = 'verdict show ' + (result.valid ? (fullyTrustless ? 'ok' : 'partial') : 'bad');
$('vmark').textContent = result.valid ? (fullyTrustless ? '✓' : '!') : '✗';
$('vtext-main').textContent = !result.valid
? 'Verification failed — do not trust this receipt.'
: fullyTrustless
? 'Verified — this receipt is provably fair.'
: 'Receipt is self-consistent, but the signer is unpinned.';
$('vtext-sub').textContent = !result.valid
? 'One or more protocol checks did not pass. The key/receipt may have been tampered with.'
: fullyTrustless
? 'The key was generated fresh under the committed seed; the operator could not have kept a copy.'
: 'Every protocol check passed against the receipt’s own key, but we could not reach /.well-known/three-vanity.json to confirm three.ws (not an impostor) signed it. Re-run when online to fully pin.';
const m = $('meta');
m.innerHTML = '<dl class="meta-grid">' +
'<dt>Address</dt><dd>' + escapeHtml(receipt.address || '') + '</dd>' +
'<dt>Pattern</dt><dd>' + escapeHtml([receipt.pattern?.prefix && 'prefix ' + receipt.pattern.prefix, receipt.pattern?.suffix && 'suffix ' + receipt.pattern.suffix].filter(Boolean).join(' + ') || '—') + '</dd>' +
(receipt.winningIndex != null ? '<dt>Winning index</dt><dd>' + escapeHtml(receipt.winningIndex) + ' (of ' + escapeHtml(receipt.attempts ?? '?') + ' tried)</dd>' : '') +
(receipt.ts ? '<dt>Issued</dt><dd>' + escapeHtml(receipt.ts) + '</dd>' : '') +
'<dt>Signed by</dt><dd>' + escapeHtml(receipt.servicePublicKey || '') + '</dd>' +
'</dl>' +
(receipt.address ? '<p style="margin-top:.7rem"><a class="link" href="https://solscan.io/account/' + encodeURIComponent(receipt.address) + '" target="_blank" rel="noopener">View on Solscan →</a></p>' : '');
$('share-row').classList.toggle('show', fullyTrustless);
}
async function verify() {
clearError();
const raw = receiptEl.value.trim();
if (!raw) { showError('Paste a receipt JSON first.'); return; }
let receipt;
try { receipt = JSON.parse(raw); }
catch (e) { showError('That is not valid JSON: ' + e.message); return; }
verifyBtn.disabled = true;
renderSkeleton();
try {
const { verifyVanityReceipt, openSealedText } = await loadVerifier();
// Prove custody when the secret is recoverable. Two delivery
// shapes exist: a sealed envelope (needs the buyer's X25519 key,
// opened here and only here) and an unsealed receipt, which
// carries the seed in the clear and therefore needs no key at all.
let openedSecretSeed;
const x25519 = x25519El.value.trim();
if (receipt.sealedSecret) {
if (x25519) {
let bundleText;
try { bundleText = await openSealedText(receipt.sealedSecret, x25519); }
catch (e) {
const why = e?.message || 'it did not decrypt this envelope';
const to = receipt.sealedRecipient ? ' (sealedRecipient ' + String(receipt.sealedRecipient).slice(0, 8) + '…)' : '';
throw new Error('Could not open the sealed envelope with that X25519 key: ' + why + '. Paste the secret half of the key you sent as sealTo' + to + ', in Base58 or hex.');
}
let bundle; try { bundle = JSON.parse(bundleText); } catch { throw new Error('Sealed payload was not valid JSON.'); }
openedSecretSeed = bundle.seed || (Array.isArray(bundle.secretKey) ? Uint8Array.from(bundle.secretKey).slice(0, 32) : undefined);
}
} else if (x25519) {
throw new Error('You supplied an X25519 key, but this receipt carries no sealed envelope (no sealedSecret field) to open. Clear the key to verify the receipt on its own, or paste the receipt exactly as the API returned it.');
} else if (receipt.seed || Array.isArray(receipt.secretKey)) {
openedSecretSeed = receipt.seed || Uint8Array.from(receipt.secretKey).slice(0, 32);
}
// Pin to the live well-known key when we have it. If we couldn't fetch
// it, verify against the receipt's own key but DOWNGRADE the verdict:
// without an independent pin we can confirm the receipt is internally
// consistent and self-signed, but not that three.ws (vs an impostor)
// signed it — so we never show the full "provably fair" green banner.
const result = verifyVanityReceipt(receipt, { servicePublicKey: pinnedKey || receipt.servicePublicKey, openedSecretSeed });
renderResult(result, receipt, { pinned: !!pinnedKey });
} catch (e) {
$('results-card').style.display = 'none';
showError(e.message || String(e));
} finally {
verifyBtn.disabled = false;
}
}
verifyBtn.addEventListener('click', verify);
receiptEl.addEventListener('keydown', (e) => { if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') verify(); });
$('clear-btn').addEventListener('click', () => {
receiptEl.value = ''; x25519El.value = ''; clearError();
$('results-card').style.display = 'none'; $('verdict').classList.remove('show');
receiptEl.focus();
});
$('copy-badge').addEventListener('click', async () => {
const addr = (() => { try { return JSON.parse(receiptEl.value).address; } catch { return ''; } })();
const md = '[](https://three.ws/vanity/verify)' + (addr ? '\n<!-- verified address: ' + addr + ' -->' : '');
try { await navigator.clipboard.writeText(md); $('copy-badge').textContent = 'Copied!'; setTimeout(() => $('copy-badge').textContent = 'Copy verified badge', 1500); }
catch { showError('Clipboard unavailable — copy manually: ' + md); }
});
// Deep-link support: /vanity/verify#receipt=<base64url JSON> prefills and
// auto-verifies, so a receipt can be shared as a single link.
(function loadFromHash() {
const m = /[#&]receipt=([^&]+)/.exec(location.hash || '');
if (!m) return;
let json;
try {
const bin = atob(m[1].replace(/-/g, '+').replace(/_/g, '/'));
json = new TextDecoder().decode(Uint8Array.from(bin, (c) => c.charCodeAt(0)));
JSON.parse(json); // validate before it reaches the textarea
} catch {
// A truncated or re-encoded share link would otherwise land the
// reader on an empty form with no idea why nothing happened.
showError('This share link carries a receipt payload this page could not read: it looks truncated or re-encoded in transit. Ask the sender for the link again, or paste the receipt JSON above.');
receiptEl.focus();
return;
}
receiptEl.value = json;
verify();
})();
</script>
<!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
<script type="module" src="/i18n.js"></script>
</body>
</html>