how to convert hash160 to bitcoin address in python

+2 votes

I want to convert hash160 to bitcoin address in python wondering is it possible. please help me out with code.

this is Hash160 :- 

a054ae4797fbdb24cdbbc6dbb277f53f0165c13f 

convert it to bitcoin address. But how?

Jul 12, 2019 in Blockchain by Raj
• 180 points
3,691 views

1 answer to this question.

0 votes

Hey @Raj. I use the following script. Give it a try:

from bitcoin import *

hash160 = '010966776006953D5567439E5E39F86A0D273BEE'
addr = pubtoaddr(hash160.encode('utf-8'))
print (addr)
answered Jul 12, 2019 by Tanisha

I ran your code in but it gives this address - 1GQQiJZdMKg6C1XEgUwPcnjmddZC8ippC1

but it should be 16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM

this the link check for your hash160 string:-https://www.blockchain.com/btc/address/16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM

Please check and tell ,. Solution Please.

Related Questions In Blockchain

0 votes
1 answer

How to generate Bitcoin address in Ruby?

In your generate_address_from_public_key_hash method, the checksum should be over ...READ MORE

answered Aug 22, 2018 in Blockchain by slayer
• 29,370 points
2,629 views
+1 vote
1 answer
0 votes
1 answer

How to create Bitcoin Address in PHP?

You need to understand that Bitcoin address and ...READ MORE

answered Aug 28, 2018 in Blockchain by Perry
• 17,100 points
5,408 views
0 votes
0 answers

hd wallet bip44 in js - how to create an address for a chain other than bitcoin?

I have a small script basically taken ...READ MORE

Mar 2, 2022 in Blockchain by Aditya
• 7,680 points
975 views
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,385 views
0 votes
1 answer

Python: how to print long text on different lines?

replace with a newline char. file.write(response.read().decode('utf-8').replace(";","\n")) In [72]: ...READ MORE

answered Sep 5, 2018 in Python by slayer
• 29,370 points
1,458 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,901 views
+1 vote
2 answers

How to convert INT to STRING in Solidity?

Look at the following code : function uintToString(uint ...READ MORE

answered Jun 27, 2018 in Blockchain by Christine
• 15,790 points
12,385 views
0 votes
1 answer

How to get the number of tokens in the Bitcoin network?

This information can easily be calculated by ...READ MORE

answered Aug 31, 2018 in Blockchain by Christine
• 15,790 points
1,117 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP