Author

Topic: Python Bitcoin Address to Hash 160 Hex - file (Read 1570 times)

member
Activity: 119
Merit: 100
www.thecryptobot.com
October 04, 2015, 09:46:32 PM
#4
Thanks knightdk - done and done !
sr. member
Activity: 412
Merit: 266
A general 'base58_decode` function should give you the hash.

If you use base58_decode, take [2:-8] (Assuming it outputs hex) which I believe should give you the value between the first hex byte, and the last 4 (the checksum). This value is the hash160.

For regular addresses, the first hex byte is '00'. For P2SH, it's '05'.
staff
Activity: 3374
Merit: 6530
Just writing some code
Hi everybody !

Does anyone know of a python script (or some other script) to transform a large file with BTC addresses to Hash 160 ?

I found pycoin .. it has a function that does that [address to hash], but I need a small script to convert about 10.000 addresses on the spot ..

Any lead on the subject would be great !
You can write a shell script that iterates through each line (each address should be on its own line) and then uses pycoin to convert the address and prints it to the console.
member
Activity: 119
Merit: 100
www.thecryptobot.com
Hi everybody !

Does anyone know of a python script (or some other script) to transform a large file with BTC addresses to Hash 160 ?

I found pycoin .. it has a function that does that [address to hash], but I need a small script to convert about 10.000 addresses on the spot ..

Any lead on the subject would be great !
Jump to: