P2SH redeem Script decoder plugin for Electron-Cash (AutoCove)

I’ve released a new EC plugin which could help researchers visualize bytecode for redeem Scripts. It’s also got a full list of OpCodes. It’s on GitHub, here. Here’s a screenshot GIF showing an example:
v1.0.9

It takes TX, TXID or redeem Script (hex) input. It also generates the hex & address for whatever Script users type or copy in. Starting Electron-Cash --testnet4 makes it tBCH compatible. When decoding, it comments each line with change in stack depth (Δ) & op & B counts. It has optional colors with black or white background. It can switch btwn hex & asm, as well as OP_CODES & CODES, etc. It comes with a list of examples. One neat trick is scrolling through all 121 2of3 sigscripts in this txn.

A future update might allow drag & drop for .txn files. The light-blue on black could be lighter. Maybe it should also get the BCH amount of each input. It can’t currently handle decimals. The plugin comes with an example covenant, with vanity address preturn…, which returns whatever BCH is sent to it (as long sending txn meets certain criteria). I’m hoping for a new SHA-Gate example with Native Introspection.

3 Likes

With v1.1.1 there’s now Save as .html. In the future, a CLI (Command Line Interface) could be developed whereby a server permanently running a watching-only EC wallet can quickly produce HTML decodes whenever someone enters in a TXID or redeem Script at a website. I’ve discovered that compressed HTML inside an xztar (or xz) archive is actually smaller than the plain-text viewed in the HTML!

Another feature is drag & drop decoding for .artifact files, compiled by CashScript. I’ve been spotting ΔDEPTH bugs for some CashScripts. Another new button is to condense any Script to 1-line (without comments etc), and now can also decode to <±dec>, <±0b...>, <±0o...>, <±0x...>. I’ve also figured out that a CODESEPARATOR should be placed in btwn CHECKDATASIG & CHECKSIG, so they’re a triple. Inputs like <32+4> etc also evaluate using Python.

Edit: There’s 2 ways to get the CLI. I’ll go with the option where the server admin has to run a GUI wallet, & then the terminal command is Electron-Cash daemon AutoCove Input FileName where Input could be a TXID & FileName could be C:/index.html etc. The GUI does all the work, like a bot’s controlling it! It could be a bit slow, though, since it’s a remote-control GUI.