Encode and decode bech32 strings using the local bech32 CLI.
Use this skill to convert between hex/base58 inputs and bech32 strings, or to decode bech32 back to base16. The local bech32 binary reads data from standard input and writes to standard output.
bech32 [PREFIX] converts to/from bech32 stringsstdinstdout<<< or printf so the payload is explicitbech32 <prefix> <<< <hex-or-base58-input>
bech32 <<< <bech32-input>
Encode hex to bech32:
bech32 addr <<< 71ab222c7f223c4c0e297d11fbf6e6a082eb41db5e8539fcfb822c76c3
Expected output:
addr1wx4jytrlyg7ycr3f05glhahx5zpwkswmt6znnl8msgk8dsccv8766
Decode bech32 to hex:
bech32 <<< addr1wx4jytrlyg7ycr3f05glhahx5zpwkswmt6znnl8msgk8dsccv8766
Expected output:
71ab222c7f223c4c0e297d11fbf6e6a082eb41db5e8539fcfb822c76c3
Convert from base58 to bech32:
bech32 base58_ <<< Ae2tdPwUPEYy
Expected output:
base58_1p58rejhd9592uusa8pzj2
0x; the tool expects raw hex onlyUnable to detect input encoding usually means the input contains a prefix (0x) or non-hex characters0x prefix for hex.bech32 base16_ <<< 706174617465bech32 <<< base16_1wpshgct5v5r5mxh0bech32 --help