scripthash to address
Closed this issue · 2 comments
I try to convert scripthash to address, is there a similar method in electrumx?
No, the conversion is one-way, it is not possible.
address <-> scriptPubKey -> scripthash
You can freely convert between address and scriptPubKey, but scripthash=sha256(scriptPubKey)
, so you can only go in one direction.
To go the other direction, you will need to store a mapping; the specifics will depend on exactly what you need.
@SomberNight Thank you very much for your reply. Maybe I don’t have a special understanding of the principles of Bitcoin, but I’m working hard to learn. I currently read the electrumx rosksdb directly. It seems that electrumx stores scripthash, but I want to get all the wallet addresses, a lot of BTC explorer How did they get the wallet address? electrumx's database does not store scriptPubKey