Is there a way to generate a bitcoin address from public key with openssl command line ?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
Which kind of address do you want?
Assuming that you have compressed public key(
compressed_public_key.txt), to generate
P2PKH you can use these commands (hash160 and encoding with base58)
ADDR_RIPEMD160=$(printf $(cat compressed_public_key.txt | xxd -r -p | openssl sha256| sed 's/^.* //') |xxd -r -p | openssl ripemd160 | sed 's/^.* //') ADDR=`printf $VERSION_PREFIX_ADDRESS$ADDR_RIPEMD160 | xxd -p -r | base58 -c` echo $ADDR
$VERSION_PREFIX_ADDRESS for P2PKH addresss are
0x00 for mainnet or
0x6F for testnet (https://en.bitcoin.it/wiki/List_of_address_prefixes)