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

Support exotic sighashes #623

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft

Support exotic sighashes #623

wants to merge 1 commit into from

Conversation

1ma
Copy link
Contributor

@1ma 1ma commented Nov 6, 2024

Description

Solves issue #545

The gist of the issue is that if the sighash argument of psbt.sign_with is not explitictly set to None, embit doesn't take the sighash in the psbt into account. With sighash=None, embit signs each input in the manner that it's psbt data specified.

This has been tested in native segwit and taproot. However, taproot transactions with an exotic sighashes are not signed correctly. I suspect this could be an issue with embit, not seedsigner.

I'm not sure how to write a test for this change, feedback appreciated.

Testing approach

  1. Set up the Seedsigner emulator and configure it in testnet mode.
  2. Loaded a dummy seed into the seedsigner (e.g. aim 12 times).
  3. Created a cold wallet in Sparrow using the xpub of that seed.
  4. Send some sats to this new wallet.
  5. Create a transaction from Sparrow's cold wallet. In the second menu, you can choose which sighash to use.
  6. Scan the unsigned transaction QR with seedsigner and sign it.
  7. Scan the signed transaction from Sparrow and broadcast it.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I’ve run pytest and made sure all unit tests pass before sumbitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:

Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

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

Successfully merging this pull request may close these issues.

1 participant