Hi all,
I have been recently working on making a payment processor for myself. I found this script, that seemed to generate all of the basic types of Bitcoin addresses. I tested it, and I was able to use the legacy addresses just fine, so I kept going with it.
Some time into testing, I started generating addresses, including the bech and segwith accesses (bc and 3 prefixes), and sent some transactions to those addresses. I noticed that the bech address was invalid, and realized that I may have made a mistake. I tried importing the private keys I had generated to see if I can access the bech and segwith addresses, and to my horror the addresses are different to what the script generated.
Here is the repo:
https://github.com/BRO200BS/Bitcoin-Address-GeneratorFor example, here is a key I just generated:
'private_key': '188ffa83fc4f665b4fb24460d560540e635ea824ad1576e27644f7835600c85b'
'WIF': '5J16zh1Mktz1iWEavJFT8nVRBscDCLQDzChYTeYxU33cQDRnty5'
'p2pkh_address': '1EcW6UVqRCpsww7RA8moBjx6RypYnnraDA'
'compressed_p2pkh_address': '16cSkuPktoD5u9aN3ttnNf9YYb1jvK4Sjw'
'p2sh_address': '3JKyqNxb5Wb9uh5NUX4S5PhMZTddEiY92n'
'bech32_address': 'bc1qq2tvlagcm8zdwf9h0mjhzu9m6s3q84w8kpsj83wvj'
As you can see, the bech address is starting with "bc1qq" which doesnt seem to be valid. I also had no luck in getting my private key to resolve to the p2sh address.
I tried using this service to see what the output would be:
https://secretscan.org/PrivateKeySegwitInserting the private key above to the site above yields the following address: 32kecU8BJMWCiDbCxCR4EaYc3fZx5bDPpy, likewise when I import the compressed WIF to my Electrum, it results in this address not the one generated by my script.
I had already sent some coins to my seemingly invalid p2sh/segwit addresses - are these coins now entirely lost?
Thanks to anyone who might be able to assist me!