示例#1
0
 /**
  * @param PublicKeyInterface $publicKey
  * @param int|string $integer
  * @return \BitWasp\Bitcoin\Key\PublicKey
  * @throws \Exception
  */
 public function publicKeyMul(PublicKeyInterface $publicKey, $integer)
 {
     $pubKey = $publicKey->getBuffer()->getBinary();
     $ret = (bool) \secp256k1_ec_pubkey_tweak_mul($pubKey, $this->getBinaryScalar($integer));
     if ($ret === false) {
         throw new \Exception('Secp256k1 pubkey tweak mul: failed');
     }
     return $this->getRelatedPublicKey($publicKey, $pubKey);
 }
 /**
  * @param \BitWasp\Bitcoin\Signature\TransactionSignature $signature
  * @param PublicKeyInterface $publicKey
  * @return Script
  */
 public function payToPubKeyHash(TransactionSignature $signature, PublicKeyInterface $publicKey)
 {
     return ScriptFactory::create()->push($signature->getBuffer())->push($publicKey->getBuffer());
 }
 /**
  * Create a Pay to pubkey output
  *
  * @param PublicKeyInterface  $public_key
  * @return Script
  */
 public function payToPubKey(PublicKeyInterface $public_key)
 {
     return ScriptFactory::create()->push($public_key->getBuffer())->op('OP_CHECKSIG');
 }