Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to spend a coinbase output? #58

Open
CharikovAI opened this issue Jun 21, 2021 · 0 comments
Open

Is it possible to spend a coinbase output? #58

CharikovAI opened this issue Jun 21, 2021 · 0 comments

Comments

@CharikovAI
Copy link

CharikovAI commented Jun 21, 2021

I'm trying to spend a generated UTXO in this way:

final keyPair = ECPair.fromWIF(wif, network: regtest);
 var p2pk = new P2PK(
                        data: new PaymentData(pubkey: keyPair.publicKey),
                        network: regtest)
                    .data;
final txb = new TransactionBuilder(network: regtest);
txb.setVersion(1);
txb.addInput(
                        input.id,
                        input.outputIndex,
                        null,
                        p2pk.output
                      );
// ..... addOutput and sign

After broadcasting I'm getting an error mandatory-script-verify-flag-failed (Signature is found in scriptCode) (code 16)
If it is possible can you provide an example how to do this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant