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

Error when signing a transaction without specifying allowedSignHash to signPsbt request method #174

Open
wolfpack94 opened this issue Sep 18, 2024 · 1 comment
Assignees

Comments

@wolfpack94
Copy link

wolfpack94 commented Sep 18, 2024

I am looking for some guidance here. I am trying to rely on the sig hash's specified in the inputs of a PSBT by not passing allowedSignHash into the signPsbt request method. When doing this, I am getting this error after Confirm in the wallet:

Screenshot 2024-09-18 at 4 05 21 PM

The docs for signPsbt allowedSignHash parameter:

a number representing the sigHash type to use for signing.
will default to the sighash type of the input if not provided.

The full set of parameters are:

{
  "broadcast": false,
  "psbt": "cHNidP8BAJoCAAAAAuYCeZMEme7DCP+M/kzDSjO+aTjpH1adSFnX4gM+cN3IAAAAAAD/////zP/hoEXZoV35MQYEq8y4dmjMWr+XjQHa+6eOd8KknVgAAAAAAP////8CAQAAAAAAAAAWABSDAMplKKzmqC3fqbv2MnZZu3CBUQEAAAAAAAAAFgAUgwDKZSis5qgt36m79jJ2WbtwgVEAAAAAAAEBKwEAAAAAAAAAIlEgzKfnj70ukeU4i0q6DEOJ3S6zPydXyGlyjZGRZ33thfMBAwQBAAAAARcgPcAfGktmVncnTqmhdMz/SuC+th6PgoS71xpyhHxA7mEAAQErAQAAAAAAAAAiUSDMp+ePvS6R5TiLSroMQ4ndLrM/J1fIaXKNkZFnfe2F8wEDBAMAAAABFyA9wB8aS2ZWdydOqaF0zP9K4L62Ho+ChLvXGnKEfEDuYQAAAA==",
  "signInputs": {
    "bc1pgeae0s2zkjvezffs9essn9azf67h29ceh8nd9548vcrcfmfxwajqnh9fkh": [
      0,
      1
    ]
  }
}

The sig hash types for the 2 inputs are:

input1 sighash type: 1
input2 sighash type: 3

What am I doing wrong?

@wolfpack94 wolfpack94 changed the title Error when submitting a transaction without specifying allowedSignHash to signPsbt request method Error when signing a transaction without specifying allowedSignHash to signPsbt request method Sep 18, 2024
@victorkirov
Copy link
Member

@wolfpack94 the documentation is actually incorrect; this is currently a required field. I think it should work for your transaction if you set it to the bitwise-and of all the sighashes you use (in your case, 3 should do it).

We'll be aligning the implementation with the documentation in the next 1 or 2 major releases.

@victorkirov victorkirov self-assigned this Sep 20, 2024
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

2 participants