BScriptView
Every byte of a Bitcoin transaction, explained and editable.
Product screens
Overview
I built BScriptView, a Bitcoin transaction viewer and editor that splits a raw transaction into its fields and scripts, marks where each one sits in the hex and lets you edit either side. It began in 2019 as the transaction builder of my Blockchain Debugger; I rebuilt it in Rust as a free macOS app that also runs in the browser through WebAssembly.
Problem statement
Debugging a node means reading transactions byte by byte: which bytes are a script length, where the witness starts, why a node rejects a crafted input. Block explorers show the decoded result and hide the bytes, and the libraries that parse transactions rightly refuse the malformed ones a protocol engineer needs to build and inspect.
Solution
I wanted the tool I needed while chasing consensus failures: every byte belongs to a field, every field can be changed, and a malformed transaction is shown rather than refused.
A parser that keeps going.
I ported my 2019 C# parser to rcoin, a Rust library that records the byte range of every field, reads broken and half-typed transactions as far as they go, and reports what Bitcoin Core would reject instead of stopping at the first error.
Two-way editing.
Fields decode from the hex and encode back into it byte for byte, so changing one field changes only its bytes. Scripts read one operation per line with every signature, key and control block explained, and clicking a byte opens the field and script line it came from.
Brought up to current standards.
An audit of the 2019 parser found it hard-wired to Stratis' layout, without SegWit, computing transaction ids with a single hash and mis-stepping over PUSHDATA opcodes. The rebuild adds SegWit, Taproot, version 3 (TRUC) transactions, pay-to-anchor outputs, bech32m addresses and the relay policy of Bitcoin Core 30.
Checked against two references.
Every sample transaction is compared with mempool.space and rust-bitcoin for ids, weight, scripts, witnesses and addresses, decoding then encoding must return the same bytes, and truncated and fuzzed input must never crash the parser.
One engine for desktop and browser.
The same Rust engine runs behind Tauri commands in the macOS app and as a WebAssembly module on the product site, through one JSON API, so the browser version is the full tool in under 600 KB and decodes without sending anything to a server.
Crafting what a node should refuse.
Counts and script lengths can be overridden, as in the original, to build transactions with lengths that do not match their content. Every result is parsed again, so the tool shows exactly where a node would stop reading.
Outcome
I designed and built BScriptView end to end, from the parser and its compatibility audit to the desktop app, the browser build and its product site. Version 0.1.0 is released as freeware for Macs with Apple silicon and runs in any current browser.
Visit bscriptview.zorbion.comTechnologies used
Data volumes & scale
- 13 sample transactions checked against mempool.space and rust-bitcoin
- 5 networks
- 39 engine tests
- ~370 KB WebAssembly engine
- ~4,400 lines of Rust
- ~2,800 lines of TypeScript and Svelte
