Create account

1EQQoLW7fMu4QqJ4
1596d · hmwyda
hmwyda - how much would you donate anonymously

how to create ownerless BTC/BCH/BSV address with special meaning

amnesia@amnesia:~$
amnesia@amnesia:~$ wget --quiet https://github.com/libbitcoin/libbitcoin-explorer/releases/download/v3.2.0/bx-linux-x64-qrcode
amnesia@amnesia:~$ wget --quiet https://github.com/sipa/bech32/raw/master/ref/python/segwit_addr.py
amnesia@amnesia:~$ wget --quiet https://github.com/oskyk/cashaddress/archive/1.0.5.tar.gz
amnesia@amnesia:~$ ls -l bx-linux-x64-qrcode segwit_addr.py 1.0.5.tar.gz
-rw-r--r-- 1 amnesia amnesia 6494 Aug 12 14:14 1.0.5.tar.gz
-rw-r--r-- 1 amnesia amnesia 5037768 May 26 2017 bx-linux-x64-qrcode
-rw-r--r-- 1 amnesia amnesia 4376 Aug 12 14:13 segwit_addr.py
amnesia@amnesia:~$ tar xf 1.0.5.tar.gz
amnesia@amnesia:~$ chmod +x bx-linux-x64-qrcode
amnesia@amnesia:~$ alias bx=/home/amnesia/bx-linux-x64-qrcode
amnesia@amnesia:~$

1) Base58 address is valid for all BTC/BCH/BSV

1.1) base58 address from text
amnesia@amnesia:~$
amnesia@amnesia:~$ bx base16-encode "send 1% of how much you'd donate for publishing in blockchain diy manual for building smart rocket" | bx ripemd160 | bx address-encode
1JYmhqs4812R5Me7fHUNo8dfczZwjy8H2d
amnesia@amnesia:~$

1.2) base58 address with text
base58 alphabet = digits excluding "0" + lowercase letters excluding "l" + uppercase letters excluding "I", "O"
string of 33 letters, starts with "1", last 6 or 7 will be changed, 25 or 26 remain for text
amnesia@amnesia:~$
amnesia@amnesia:~$ bx base58-decode 1PrcntHmwydaForKiLLBadGuyxxxxxxxx
00045291c56c3df0faa7d508d17660766187ba423f148ff711
amnesia@amnesia:~$
remove 2 first and 8 last and
amnesia@amnesia:~$
amnesia@amnesia:~$ bx address-encode 045291c56c3df0faa7d508d17660766187ba423f
1PrcntHmwydaForKiLLBadGuyxxys6ULy
amnesia@amnesia:~$

2) BTC SegWit address (bech32)

2.1) segwit address from text
amnesia@amnesia:~$
amnesia@amnesia:~$ bx base16-encode '0.001 hmwyda for publishing private information about bad guy' | bx ripemd160
f7ba9ada06c834560e439cfb3b5c054db132914d
amnesia@amnesia:~$
amnesia@amnesia:~$ python3
>>>
>>> from segwit_addr import encode
>>>
>>> print(encode('bc', 0, bytearray.fromhex('f7ba9ada06c834560e439cfb3b5c054db132914d')))
bc1q77af4ksxeq69vrjrnnankhq9fkcn9y2d7h0q3z
>>>

2.2) segwit address with text
bech32 alphabet = digits excluding "1" + lowercase letters excluding "b", "i", "o"
string of 32 or 51 letters
>>>
>>> from segwit_addr import CHARSET, convertbits, encode
>>>
>>> array = [CHARSET.find(x) for x in 'permylhmwydasenddr0nemsgt06adguy']
>>> print(encode('bc', 0, convertbits(array, 5, 8)))
bc1qpermylhmwydasenddr0nemsgt06adguyrff2yz
>>>
>>> array = [CHARSET.find(x) for x in '0nepercnthmwydaf0rd0xyngwh0w0rkshelpspr0tects6adguy']
>>> print(encode('bc', 0, convertbits(array, 5, 8)))
bc1q0nepercnthmwydaf0rd0xyngwh0w0rkshelpspr0tects6adguyqc5xscz
>>>
>>> exit()
amnesia@amnesia:~$

3) BCH new address format (also bech32)

3.1) BCH address from text - convert from 1.1
amnesia@amnesia:~$
amnesia@amnesia:~$ cd cashaddress-1.0.5/
amnesia@amnesia:~/cashaddress-1.0.5$
amnesia@amnesia:~/cashaddress-1.0.5$ python3
>>>
>>> from cashaddress.convert import to_cash_address
>>>
>>> print(to_cash_address('1JYmhqs4812R5Me7fHUNo8dfczZwjy8H2d'))
bitcoincash:qrq8ckdda6rthkx5xf9am2qczf7avyfgfgjj6he024
>>>

3.2) BCH address with text
bech32 alphabet see 2.2
string of 34 letters, starts with "qq", ends with "q", 31 remain for text
>>>
>>> from cashaddress.crypto import b32decode, b32encode, calculate_checksum
>>>
>>> prefix = 'bitcoincash'
>>> array = b32decode('qqpermylhmwydaf0r6urn6adguysh0useq')
>>> checksum = calculate_checksum(prefix, array)
>>> print(prefix + ':' + b32encode(array + checksum))
bitcoincash:qqpermylhmwydaf0r6urn6adguysh0useqlcxzn0q7
>>>
>>> exit()
amnesia@amnesia:~/cashaddress-1.0.5$
replied 1458d
Brilliant work!
14pdFnc5tQ4ghUqo
replied 1591d
Hi there, can we have a private chat regarding BCH, you mined
14pdFnc5tQ4ghUqo
replied 1388d
Do you need any details regarding those transaction?
1DKyXez3bMb7eX9Z
replied 1471d
Hey there
14pdFnc5tQ4ghUqo
replied 1410d
I believe you mistakenly received 350 BCH I have sent occasionally to your address, appreciate much you will send them back