Post
Topic
Board Development & Technical Discussion
Re: bech32(1) for encoding/decoding of Bech32 strings & “Bravo Charlie” Addresses
by
denifednu
on 22/12/2018, 23:55:15 UTC
Thanks very much for this!

fyi, I'm using it to generate BIP84/P2WPKH addresses from privatekeys for bitcoin, e.g.:
Code:
$ KEY="L2QQ7BHxpTwvi68BS9BcARM3W6UUbiJcLeUVnCcJ2wNLebGBwgHB"
$ bech32 2>&- -s 0 `echo ${KEY} | bx wif-to-public | bx bitcoin160`
bc1qnlj5pe9yzngat378vcezjc2c07r02k2rthqqyu
It would be cool if instead of passing hexdata as an argument it could be passed as stdin (possibly with hexdata arg specified as a hyphen, -, to indicate such), and to remove the 'data_len' output going to stderr.  Then I could use:
Code:
$ echo ${KEY} | bx wif-to-public | bx bitcoin160 | bech32 -s 0 -