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 in Blockchain by Raj
• 180 points
98 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 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,170 points
878 views
0 votes
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 27, 2018 in Blockchain by Perry
• 17,020 points
501 views
0 votes
1 answer

How i can use nodejs to watch transactions in bitcoin network?

you can use  const Socket = require('blockchain.info/Socket'); const mySocket ...READ MORE

answered Jul 9, 2018 in Blockchain by digger
• 26,550 points
50 views
0 votes
1 answer

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

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
80 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,170 points
39 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
155 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
1,054 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
30 views