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

Revisit signing flow and UX in the presence of sighash flags #124

Open
bigspider opened this issue Feb 27, 2023 · 1 comment
Open

Revisit signing flow and UX in the presence of sighash flags #124

bigspider opened this issue Feb 27, 2023 · 1 comment
Labels
bug Something isn't working ux

Comments

@bigspider
Copy link
Collaborator

bigspider commented Feb 27, 2023

Currently, if any input is not signed with SIGHASH_ALL/SIGHASH_DEFAULT, we show a generic warning.
There are potentially several aspects that might be changed:

  • we currently check that SUM(output_amounts) ≤ SUM(input_amounts); that check is too restrictive if inputs don't commit to the entire transaction (e.g.: SIGHASH_SINGLE; related issue Mark input as external PSBT Partial sign #123)
  • How should the UX reflect and handle those advanced use cases?

One way could be to have an "advanced" transaction validation mode, where all inputs (and their SIGHASH_FLAG if appropriate) and all outputs are shown on-screen.

@kewde
Copy link
Contributor

kewde commented Feb 12, 2024

To add a bit more context, all the browser extensions that I have interacted with circumvent this check completely by adding external dummy inputs if all the inputs their sighashes permit it. One typical use-case is listing an Ordinal NFT for sale.

if (st->inputs_total_amount < st->outputs.total_amount) {
PRINTF("Negative fee is invalid\n");
// negative fee transaction is invalid
SEND_SW(dc, SW_INCORRECT_DATA);
return false;
}

While it certainly doesn't answer the questions you posed w.r.t UX, one quick win could be changing the non negative fee check to only run if all inputs use a default sighash (SIGHASH_ALL/SIGHASH_DEFAULT).

@bigspider bigspider modified the milestones: 2.2.0, 2.3.0 Feb 13, 2024
@bigspider bigspider removed this from the 2.4.0 milestone Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ux
Projects
None yet
Development

No branches or pull requests

2 participants