How can testnet CashAddr addresses be converted back to the old format?

0

I noticed on the new update of the Bitcoin Cash wallet (BitcoinABC) (for testnet and not sure for mainnet) that it has a weird beginning and address (e.g. bchtest:qrz89sz3r47ndj60xq68xeus0hx9qwlpkuw5pw01de). Is there any way to convert it back to the old format as there are some places that don't support this format yet (like one of the BCH testnet faucets)?

zhiyan114

Posted 2018-01-29T13:22:37.130

Reputation: 528

Answers

0

New bitcoin-cash ABC support cashAddrss

You can convert an address to new-old format using this website:

bitcoincash.org

You can't convert testnet address using that website but you can using the following PHP library CashAddressPHP

Example of usage:

P2PK:
old2new('1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'): 'bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy'

new2old('bitcoincash:qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy'): '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa'
P2PKH:
old2new('12higDjoCCNXSA95xZMWUdPvXNmkAduhWv'): 'bitcoincash:qqf2hrw93r9f64u8mhn7k22knknrcw3r3s0mkt0zxa'

new2old('bitcoincash:qqf2hrw93r9f64u8mhn7k22knknrcw3r3s0mkt0zxa'): '12higDjoCCNXSA95xZMWUdPvXNmkAduhWv'
P2SH:
old2new('342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey'): 'bitcoincash:pqv60krfqv3k3lglrcnwtee6ftgwgaykpccr8hujjz'

new2old('bitcoincash:pqv60krfqv3k3lglrcnwtee6ftgwgaykpccr8hujjz'): '342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey'

Also, you can convert legacy Bitcoin-cash address to cashAddr format using this website

Adam

Posted 2018-01-29T13:22:37.130

Reputation: 3 215

Sorry i haven't have time to test it out anyway, the api above is bit complicated and does not have a well documentation for it so i cant use it and the website works just the address is consider invalidatedzhiyan114 2018-02-03T22:22:54.423

0

CashAddress.Github.io supports converting testnet addresses.

(I had no other option than suggesting my own website. It's the only that can convert Testnet addresses.)

Or, you can use "usecashaddr=0" on your node.

MCCCS

Posted 2018-01-29T13:22:37.130

Reputation: 5 827