You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2951661
Browse filesBrowse the repository at this point in the historyBrowse files
random.html: real per-tx script+signature verification with the engine
Clicking a transaction now also fetches its raw hex (one more fetch, still
only-on-click), decodes it with the engine, and runs every input through
be.interpreter.verifyInput using the prevout scriptPubKey+value that esplora
already inlines. Shows a green 'N / N inputs verified' banner with the
in-browser timing, plus a per-input ✓/✗/○ tick. Coinbase and unconfirmed
handled. This is real phase-2 consensus verification, one tx at a time.
Also refresh engine/codec to the fixed schema trunk (#60/#61/#62/#63/#67) so
verification is correct on inscriptions and large taproot spends, not just
standard scripts.
Copy file name to clipboardExpand all lines: random.html
+43-6Lines changed: 43 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ <h1>Verify a Bitcoin block.</h1>
108
108
</div>
109
109
<pid="err"></p>
110
110
<divid="card"></div>
111
-
<pclass="note"><b>Phase 1:</b> proof of work, merkle root, witness commitment and block structure all live inside the block itself, so they verify with no extra data. Script execution and signature checks need the spending history (the prevouts), which is phase 2. A pass here means structurally sound, not that every signature was checked.</p>
111
+
<pclass="note"><b>Two layers.</b>A block's proof of work, merkle root, witness commitment and structure all live inside the block itself, so they verify with no extra data. Scripts and signatures need the spending history (the prevouts), which isn't in the block — so <b>click any transaction</b> to fetch it and run its scripts and signatures through the engine for real, right here in your browser. That is the full check, one transaction at a time.</p>
112
112
</div>
113
113
114
114
<footer>An independent JavaScript implementation. Block data from <spanid="prov">mempool.space</span>. <ahref="./index.html">bitcoin-kernel</a></footer>
@@ -297,7 +297,7 @@ <h1>Verify a Bitcoin block.</h1>
<div class="pct">${ver.allOk ? 'scripts & signatures checked' : 'verification failed'}<span class="t"> · in <b style="color:var(--good);font-weight:800">${ver.ms.toFixed(1)} ms</b> by the engine, in your browser</span></div>
360
+
</div>`;
361
+
}elseif(ver&&ver.error){
362
+
vhero=`<div class="note" style="margin:0;border-radius:0;border-left:0;border-right:0;border-top:0">Could not run verification (${esc(ver.error)}); detail shown from the explorer.</div>`;
363
+
}elseif(ver&&ver.total===0){
364
+
vhero=`<div class="note" style="margin:0;border-radius:0;border-left:0;border-right:0;border-top:0">Coinbase transaction — newly issued coins, no inputs to verify.</div>`;
365
+
}
331
366
$('card').innerHTML=`
332
367
<div class="backlink">${st.block_height!=null ? `← <a href="?height=${st.block_height}" data-h="${st.block_height}">Block ${fmt(st.block_height)}</a>` : 'unconfirmed (in the mempool)'}</div>
0 commit comments