How to check that I control an address
I recently created a bunch of bitcoin addresses (public starting with 1, PK starting with 5) from a paper wallet, that I downloaded from their github (https://github.com/walletgeneratornet/WalletGenerator.net) and ran offline.
I imported the first PK in my full node, it translated to the pub address I expected and I control this address.
I don't feel comfortable sending coins to addresses I don't know for sure I control. How can I check securely and "easily" that I control them ? Adding all of those PK in Bitcoin core is long and decreases security.
Top Answer/Comment:
- Test the windows python code below with the private/public key generated from
website. Just to verify the correctness. If correct proceed.
- Throw coin 256x get your private key.
- Throw dice whatever, until you get 256 bits.
- enter the private key in the code below.
- you should get your bitcoin address.
Code:
# COMMENTS
import bitcoin
import binascii
PrivKey1 = 'e8ee7398abbbdc8920f53c8fd454e86eab74beae2a9c42d28bf86402f3d87fcb'
PrivKey1Type = bitcoin.get_privkey_format(PrivKey1)
print("Private Key types")
G = bitcoin.encode_privkey(PrivKey1, 'hex',0)
print("Type: hex", G)
G = bitcoin.encode_privkey(PrivKey1, 'hex_compressed',0)
print("Type: hex_compressed",G)
G = bitcoin.encode_privkey(PrivKey1, 'wif',0)
print("Type: wif",G)
G = bitcoin.encode_privkey(PrivKey1, 'wif_compressed',0)
print("Type: wif_compressed",G)
PubKey1 = bitcoin.privkey_to_pubkey(PrivKey1)
PubKey1type = bitcoin.get_pubkey_format(PubKey1)
H1 = bitcoin.encode_pubkey(PubKey1, 'bin')
print("Public Key")
print("Bin format", H1)
H2 = bitcoin.encode_pubkey(PubKey1, 'bin_compressed')
print("Bin Compressed format", H2)
H3 = bitcoin.encode_pubkey(PubKey1, 'hex')
print("hex format", H3)
H4 = bitcoin.encode_pubkey(PubKey1, 'hex_compressed')
print("Hex Compressed format", H4)
K1 = bitcoin.decode_pubkey(H4)
print("decoded format", K1)
Hash1 = bitcoin.bin_hash160((H1))
print("PubKey Hash from Uncompressed PubKey", binascii.b2a_hex(Hash1))
Hash2 = bitcoin.bin_hash160((H2))
print("PubKey Hash from compressed PubKey", binascii.b2a_hex(Hash2))
BTCaddress = bitcoin.pubkey_to_address(PubKey1, 0)
print("Bitcoin Address", BTCaddress)
상단 광고의 [X] 버튼을 누르면 내용이 보입니다