This document provides details on how to use Hashmal. Particularly, it contains details about Hashmal’s more complex tools.
The script editor is the primary tool that Hashmal uses. Unlike other tools, it can’t be closed. This document assumes that one is using the default format, "Human," for the script editor. The other format, "Hex," is more intuitive due to its limited nature.
To enter hex data into the editor, prefix the data with 0x
. If 0x
is not present, Hashmal
may interpret the data as hex anyway, but this behavior shouldn’t be relied on.
To enter ASCII data into the editor, surround the data with quotation marks. For example, this human-readable script:
OP_RETURN "a b c"
is equivalent to the following hex-encoded script:
6a056120622063
The Stack Evaluator is a tool that one can use to step through transaction scripts, or evaluate them in full.
It’s possible to specify a transaction being spent by the script via checking the 'Specify transaction being spent' checkbox and entering the raw transaction into the widget that appears. If a spending transaction is specified, you can also select the input which you want to be put onto the stack before executing the script.
The "Stack" area provides a visual representation of the stack during script execution. The "Stack log" area provides a log of script operations with context about them.
Clicking "Step" will advance the script execution by one operation. Clicking "Reset" will reset the steps that have been executed. Clicking "Evaluate" will execute the entire script at once, logging the results as if the "Step" button had been clicked for each operation.
The Variables tool allows one to store arbitrary values.
The Variables tool can interact with the script editor. If the variable "abc" has the stored value "0x05", then the following script:
$abc OP_DUP
is equivalent to:
0x05 OP_DUP
As the above example illustrates, variables can be inserted into a script by entering the variable named prefixed with '$'.
The rule about quotation marks also works for variables. If the variable "def" has the stored value "Hello World", then the following two scripts are equivalent:
$def
"Hello World"