mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-11-15 18:02:49 +00:00
13 lines
299 B
Python
13 lines
299 B
Python
|
#!/usr/bin/env python3
|
||
|
from bitcointx.wallet import *
|
||
|
import hashlib
|
||
|
import sys
|
||
|
|
||
|
if len(sys.argv) != 2:
|
||
|
print("Usage: get_scripthash.py <addr>")
|
||
|
exit(1)
|
||
|
|
||
|
addr = CBitcoinAddress( sys.argv[1] )
|
||
|
script = addr.to_scriptPubKey()
|
||
|
script_hash = hashlib.sha256(script).hexdigest()
|
||
|
print(script_hash)
|