Does any one have or know a python script that convert Hex private key to all Bitcoin addresses (...)
Yup, I wrote something like that late last year; here's the post (copy/paste the code from there):
Generating addresses from scratch (Python 3.6+).
It doesn't cover all of the address types you're after, but I think you'll still find it useful [1] (it'll show compressed-P2PKH and P2WPKH addresses by default, but you can get it to show uncompressed-P2PKH addresses too by going to the top of the script and changing
show_p2pkh_uncompressed to
True).
Here's how you would invoke it (with your example private key):
$ python3 make_address.py 0x3902e4f09664bc177fe4e090dcd9906b432b50f15fb6151984475c1c75c35b6
And here's the output (after having adjusted
show_p2pkh_uncompressed, as described above):
+------+----------------------+
| Type | Legacy, Uncompressed |
+--+------+----------------------+-------------+
| Address | 1Bu6YxH64nfvhdDsYNEP8PftoBMqgusdPS |
+---+---------+------------------------------------+----------------+
| Private Key | 5HqrbgkWPqBy6dvCE7FoUiMuiCfFPRdtRsyi6NuCM2np8qBZxq5 |
+-------------+-----------------------------------------------------+
+------+--------------------+
| Type | Legacy, Compressed |
+--+------+--------------------+---------------+
| Address | 18i5PtPisxbGiGGEviW7HPcnfNPmcsscwH |
+---+---------+------------------------------------+-----------------------+
| Private Key | p2pkh:KwLdv6T2jmhQbswnYrcL9KZHerTpVyjozp1JNjfP5QuD3GchCwCc |
+-------------+------------------------------------------------------------+
+------+---------------+
| Type | Native SegWit |
+--+------+---------------+----------------------------+
| Address | bc1q2jxe5azr6zmhk3258av7ul6cqtu4eu4mps8f4p |
+---+---------+--------------------------------------------+----------------+
| Private Key | p2wpkh:KwLdv6T2jmhQbswnYrcL9KZHerTpVyjozp1JNjfP5QuD3GchCwCc |
+-------------+-------------------------------------------------------------+[1] I mean, you'd probably find it
more useful if it already did every address type you're after, but because the code is self-contained and doesn't just pass the problem off to a dependency, you should be able to extend it yourself if you're willing/determined enough.