Bitcoin-Crypto

 view release on metacpan or  search on metacpan

ex/tx/multisig_redeem.pl  view on Meta::CPAN

# signatures), the transaction is ready

$tx->verify;
say $tx->dump;
say to_format [hex => $tx->to_serialized];

__END__

=head1 P2MS redeem transaction example

This transaction redeems coins locked in P2WSH output produced in
C<tx/multisig_create.pl> example. The exact redeem script must be provided and
two out of three private keys must be used to sign.

Signing requires providing C<redeem_script> argument with the script object, as
well as C<multisig> argument in format C<[$this_signature, $total_signatures]>.
Both private keys are used to sign the same C<signing_index>, but with
different C<multisig> argument.

This code was used to produce testnet transaction:
L<https://mempool.space/testnet/tx/8077dbb8ee049a5a754ad5e681310c1ee192e9be44a3b76d1182b41f1d39c2f5>



( run in 0.231 second using v1.01-cache-2.11-cpan-55f5a4728d2 )