Returns whether this follows the OP_DUP OP_HASH160 <20 byte hash> OP_EQUALVERIFY OP_CHECKSIG pattern.
(self)
| 244 | return True |
| 245 | |
| 246 | def is_p2pkh_script_pubkey(self): |
| 247 | '''Returns whether this follows the |
| 248 | OP_DUP OP_HASH160 <20 byte hash> OP_EQUALVERIFY OP_CHECKSIG pattern.''' |
| 249 | # there should be exactly 5 cmds |
| 250 | # OP_DUP (0x76), OP_HASH160 (0xa9), 20-byte hash, OP_EQUALVERIFY (0x88), |
| 251 | # OP_CHECKSIG (0xac) |
| 252 | return len(self.cmds) == 5 and self.cmds[0] == 0x76 \ |
| 253 | and self.cmds[1] == 0xa9 \ |
| 254 | and type(self.cmds[2]) == bytes and len(self.cmds[2]) == 20 \ |
| 255 | and self.cmds[3] == 0x88 and self.cmds[4] == 0xac |
| 256 | |
| 257 | def is_p2sh_script_pubkey(self): |
| 258 | '''Returns whether this follows the |