btcs.1 (2110B)
1 .de dT 2 .ds Dt \\$2 3 .. 4 .dT Time-stamp: "2019-06-13" 5 .TH BTCS 1 \*(Dt "btcs" "User Commands" 6 .SH NAME 7 btcs \- A Bitcoin script compiler, evaluator and decompiler 8 .SH SYNOPSIS 9 .B btcs 10 [\fI\,OPTION\/\fR]... -d <HEXSCRIPT> or [\fI\,EXPRS\/\fR]... 11 12 .SH DESCRIPTION 13 btcs accepts bitcoin script over stdin or as arguments 14 15 .SH DECOMPILER OPTIONS 16 17 .TP 18 .BR \-d ", " \-\^\-decompile 19 Decompile a hex string representing bitcoin script 20 21 .TP 22 .BR \-a ", " \-\^\-abbreviate-data 23 Abbreviate data pushes when printing script data. 24 .br 25 For example, hashes would appear as 26 .B data(20) 27 and 28 .B data(32) 29 30 .SH COMPILER OPTIONS 31 32 .TP 33 .BR {-,+}l ", " \-\^\-{hide,show}-labels 34 Hide or show labels such as "script" and "script_hex". 35 .br 36 This will default to 37 .B hide 38 when there is only one printed output 39 40 .TP 41 .BR \-s ", " \-\^\-script 42 Print the interpreted script 43 44 .TP 45 .BR \-s ", " \-\^\-script-hex 46 Print the hex form of the script 47 48 .TP 49 .BR \-t ", " \-\^\-stack 50 Print the stack output 51 52 .TP 53 .BR \-th ", " \-\^\-stack-hex 54 Print the stack output as hex 55 56 .TP 57 .BR \-r ", " \-\^\-result 58 Print the evaluation result 59 60 61 .SH EXPRS 62 63 .SS @<HEX> 64 .br 65 Prepends a minimal PUSHDATA op with the length of the hex string, and then pushes the hex data 66 .br 67 eg: @ffabcd 68 69 .SS OPCODE 70 .br 71 A bitcoin opcode in the form OP_<NAME> or <NAME> 72 73 .SS SCRIPTNUM 74 .br 75 Literal integers, which get converted to script nums (bitcoin script's number format) 76 .br 77 eg: 1 2 3 -1 2147483648 78 79 .SS RAW BYTES 80 .br 81 Literal raw bytes, which may or may not be valid script. 82 .br 83 eg: pushdata1 0x02 0x0102 84 .br 85 You could use this for manual or non-minimal pushdata 86 87 .SH EXAMPLES 88 89 .SS 90 Basic example 91 .br 92 $ btcs 1 2 add 93 .br 94 script 1 2 OP_ADD 95 .br 96 script_hex 515293 97 .br 98 stack 3 99 .br 100 stack_hex 03 101 .br 102 results success 103 104 .SS 105 Just compile 106 .br 107 $ btcs -sh hash160 @b472a266d0bd89c13706a4132ccfb16f7c3b9fcb equalverify 108 .br 109 a914b472a266d0bd89c13706a4132ccfb16f7c3b9fcb88 110 111 112 .SH BUGS 113 The evaluator isn't consensus-critical. Please test your scripts on testnet before use. 114 115 .SH AUTHOR 116 117 William Casarin <jb55@jb55.com> 118 .br 119 Support my Bitcoin projects: bc1qthsruffh3qcn69hux2tcq87x95x8rmu4fdu9sm