Skip to content

bx script to address

Eric Voskuil edited this page Jul 27, 2015 · 8 revisions

Create a BIP16 pay-to-script-hash address from a script.

$ bx script-to-address --help
Usage: bx script-to-address [-h] [--config VALUE] [SCRIPT]               

Info: Create a BIP16 pay-to-script-hash address from a script.           

Options (named):

-c [--config]        The path to the configuration settings file.        
-h [--help]          Get a description and instructions for this command.
-v [--version]       The desired Bitcoin address version.                

Arguments (positional):

SCRIPT               The script to use in the address. Multiple tokens   
                     must be quoted. If not specified the script is read 
                     from STDIN.

Example 1

$ bx script-to-address "dup hash160 [ 89abcdefabbaabbaabbaabbaabbaabbaabbaabba ] equalverify checksig"
3F6i6kwkevjR7AsAd4te2YB2zZyASEm1HM

Example 2

--version 42

$ bx script-to-address -v 42 "dup hash160 [ 89abcdefabbaabbaabbaabbaabbaabbaabbaabba ] equalverify checksig"
J8c2XmyQvbsqND2NXbDRyBF9HEW4oJ1AY8

Example 3

piped commands

$ bx script-decode 76a91489abcdefabbaabbaabbaabbaabbaabbaabbaabba88ac | bx script-to-address
dup hash160 [ 89abcdefabbaabbaabbaabbaabbaabbaabbaabba ] equalverify checksig
3F6i6kwkevjR7AsAd4te2YB2zZyASEm1HM

BX Menu

Clone this wiki locally