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

refactor: use SIGHASH_ALL explicitly #840

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

djordon
Copy link
Contributor

@djordon djordon commented Nov 14, 2024

Description

This was discussed in #782, and came up as part of #798.

Changes

  • Explicitly use TapSighashType::All, which maps to SIGHASH_ALL. This makes the sighash type explicit, which appears to increase the transaction size by at least one byte.

Before we used TapSighashType::Default, which is TapSighashType::All already. But I have a preference for making the sighash type explicit, and unfortunately this preference has a cost of increasing the transaction size by one byte. Bitcoin usually doesn't change that much and changing the default here seems like a big change so maybe we can rely on the default behavior. If someone else has an opinion here, let me know.

Testing Information

This is just a refactor, if tests pass then we're good.

Checklist:

  • I have performed a self-review of my code

@djordon djordon added sbtc signer binary The sBTC Bootstrap Signer. deposit The deposit sBTC operation. labels Nov 14, 2024
@djordon djordon added this to the sBTC: Deposit ready milestone Nov 14, 2024
@djordon djordon self-assigned this Nov 14, 2024
Base automatically changed from refactor-can-accept-renaming to main November 14, 2024 14:45
Copy link
Member

@cylewitruk cylewitruk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine 👍

Copy link
Collaborator

@matteojug matteojug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, about whether we should make the change or not I am not sure: it is a relatively small increase in cost and we remove some potentially risky thing, but otoh I'm not sure what's the actual possibility of bitcoin lib changing this without a major release and big warnings all around.

@djordon
Copy link
Contributor Author

djordon commented Nov 18, 2024

Yeah, maybe we can have Asymmetric weigh in here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deposit The deposit sBTC operation. sbtc signer binary The sBTC Bootstrap Signer.
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

3 participants