MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / to_scriptPubKey

Method to_scriptPubKey

bitcoin/wallet.py:176–179  ·  view source on GitHub ↗

Convert an address to a scriptPubKey

(self)

Source from the content-addressed store, hash-verified

174 raise CBitcoinAddressError('not a P2SH scriptPubKey')
175
176 def to_scriptPubKey(self):
177 """Convert an address to a scriptPubKey"""
178 assert self.nVersion == bitcoin.params.BASE58_PREFIXES['SCRIPT_ADDR']
179 return script.CScript([script.OP_HASH160, self, script.OP_EQUAL])
180
181 def to_redeemScript(self):
182 return self.to_scriptPubKey()

Callers 8

to_redeemScriptMethod · 0.95
make_txoutFunction · 0.45
TMethod · 0.45
spend-p2wpkh.pyFile · 0.45
payment_requestFunction · 0.45

Calls

no outgoing calls

Tested by 1

TMethod · 0.36