Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. $outpoint = new OutPoint(Buffer::hex('76a914b5a8a683e0f4f92fa2dc611b6d789cab964a104f88ac'), 0);
  2. $txOut = new TransactionOutput(95590000, $scriptPubKey);
  3.  
  4. $unsigned = (new TxBuilder())
  5. ->spendOutPoint($outpoint)
  6. ->output(95580000, $scriptPubKey)
  7. ->get();
  8. $signData = (new SignData())->p2sh($p2shMultisig);
  9.  
  10.  
  11. ----
  12.  
  13. First step when creating the transaction:
  14.  
  15. // $pubKeyFactory = new PublicKeyFactory();
  16. // $publicKey2 = $pubKeyFactory->fromHex('025cfdfdcf545ecc7925770caa91bc66a9d7b2c9e94ca174b3b3b4ac69e509396a');
  17.  
  18. // $redeemScript = new P2shScript(
  19. // ScriptFactory::scriptPubKey()->multisig(2, [$publicKey1, $publicKey2])
  20. // );
  21.  
  22. // $pushedScript = ScriptFactory::create()->data($redeemScript->getBuffer())->getScript();
  23.  
  24. // // The witnessScript needs to be known when spending
  25. // $redeemScript = new P2shScript(
  26. // ScriptFactory::scriptPubKey()->multisig(2, [$publicKey1, $publicKey2])
  27. // );
  28.  
  29. // $spendFromAddress = $redeemScript->getAddress();
  30. // $builder = TransactionFactory::build();
  31.  
  32. // $randomOutputScript = new Script(Buffer::hex("76a914b5a8a683e0f4f92fa2dc611b6d789cab964a104f88ac"));
  33.  
  34. // $rawTransaction = $builder->input('cb2eb6ce5079f59824259ae91fc758b3fb39d2178a892e35749f36daaf59bb80', 1, $redeemScript)->output(1000, $randomOutputScript)->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement