Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $outpoint = new OutPoint(Buffer::hex('76a914b5a8a683e0f4f92fa2dc611b6d789cab964a104f88ac'), 0);
- $txOut = new TransactionOutput(95590000, $scriptPubKey);
- $unsigned = (new TxBuilder())
- ->spendOutPoint($outpoint)
- ->output(95580000, $scriptPubKey)
- ->get();
- $signData = (new SignData())->p2sh($p2shMultisig);
- ----
- First step when creating the transaction:
- // $pubKeyFactory = new PublicKeyFactory();
- // $publicKey2 = $pubKeyFactory->fromHex('025cfdfdcf545ecc7925770caa91bc66a9d7b2c9e94ca174b3b3b4ac69e509396a');
- // $redeemScript = new P2shScript(
- // ScriptFactory::scriptPubKey()->multisig(2, [$publicKey1, $publicKey2])
- // );
- // $pushedScript = ScriptFactory::create()->data($redeemScript->getBuffer())->getScript();
- // // The witnessScript needs to be known when spending
- // $redeemScript = new P2shScript(
- // ScriptFactory::scriptPubKey()->multisig(2, [$publicKey1, $publicKey2])
- // );
- // $spendFromAddress = $redeemScript->getAddress();
- // $builder = TransactionFactory::build();
- // $randomOutputScript = new Script(Buffer::hex("76a914b5a8a683e0f4f92fa2dc611b6d789cab964a104f88ac"));
- // $rawTransaction = $builder->input('cb2eb6ce5079f59824259ae91fc758b3fb39d2178a892e35749f36daaf59bb80', 1, $redeemScript)->output(1000, $randomOutputScript)->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement