Exemplo n.º 1
0
 /**
  * @param PublicKeyInterface $publicKey
  * @return bool
  */
 public function checkInvolvesKey(PublicKeyInterface $publicKey)
 {
     return $publicKey->getPubKeyHash()->getBinary() === $this->hash->getBinary();
 }
Exemplo n.º 2
0
 /**
  * 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();
 }