Closed ongrid closed 3 months ago
The hash of the script is probably used in Electrumx to uniquely identify (for indexing purposes) the script.
Afaik it is not used in the Bitcoin protocol and thus the library does not support it. The way you calculate it above seems OK to me. Just send that to electrumx.
Does your library provide native conversion from p2tr address to its scripthash? I need this for querying Electrumx indexer to discover unspent UTXOs belonging to P2TR address but didn't find more elegant way to do this than using custom hashlib-based function: