/** * @param PublicKeyInterface $publicKey * @return bool */ public function checkInvolvesKey(PublicKeyInterface $publicKey) { return $publicKey->getPubKeyHash()->getBinary() === $this->hash->getBinary(); }
/** * Create a P2PKH output script * * @param PublicKeyInterface $public_key * @return ScriptInterface */ public function payToPubKeyHash(PublicKeyInterface $public_key) { return ScriptFactory::create()->op('OP_DUP')->op('OP_HASH160')->push($public_key->getPubKeyHash())->op('OP_EQUALVERIFY')->op('OP_CHECKSIG')->getScript(); }