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

Transaction Builder Example #54

Open
i5hi opened this issue Apr 28, 2021 · 0 comments
Open

Transaction Builder Example #54

i5hi opened this issue Apr 28, 2021 · 0 comments

Comments

@i5hi
Copy link

i5hi commented Apr 28, 2021

The following example:

      txb.addInput(
          '53676626f5042d42e15313492ab7e708b87559dc0a8c74b7140057af51a2ed5b',
          0,
          null,
          p2wpkh
              .output); // Alice's previous transaction output, has 200000 satoshis
      txb.addOutput('tb1qchsmnkk5c8wsjg8vxecmsntynpmkxme0yvh2yt', 1000000);
      txb.addOutput('tb1qn40fftdp6z2lvzmsz4s0gyks3gq86y2e8svgap', 8995000);

      txb.sign(vin: 0, keyPair: alice, witnessValue: 10000000);

the comment says Alice is prev output is 200_000 and the outputs are 1_000_000 and 8_995_000 and witnessValue is 10_000_000.

This does not seem right.

As I understand, 1. witnessValue = total amount inputs and 2. inputs >outputs. In this example both cases fail.

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