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

Always use tweaked keys with taproot #17

Merged
merged 5 commits into from
Sep 5, 2023
Merged

Conversation

xoloki
Copy link
Collaborator

@xoloki xoloki commented Aug 15, 2023

When doing taproot signatures with distributed keys, it is necessary to always use tweaked keys even when there is no script spend path. This is because a malicious DKG actor can insert a hidden script spend if the key is not tweaked.

So for all taproot sign functions, the merkle root should be optional, but tweaking the keys is not. If there is no merkle root, then the tweak is the hash of the public key only.

@xoloki xoloki requested a review from jferrant August 15, 2023 17:11
src/v1.rs Outdated Show resolved Hide resolved
src/v1.rs Outdated Show resolved Hide resolved
src/taproot.rs Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

Merging #17 (37c2a78) into main (9f004bc) will decrease coverage by 1.69%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
- Coverage   79.83%   78.14%   -1.69%     
==========================================
  Files          10       10              
  Lines         709      691      -18     
==========================================
- Hits          566      540      -26     
- Misses        143      151       +8     
Files Changed Coverage Δ
src/compute.rs 100.00% <100.00%> (ø)
src/taproot.rs 85.71% <100.00%> (ø)
src/v1.rs 81.18% <100.00%> (-3.72%) ⬇️
src/v2.rs 86.08% <100.00%> (-1.23%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@jferrant jferrant left a comment

Choose a reason for hiding this comment

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

LGTM

@xoloki
Copy link
Collaborator Author

xoloki commented Sep 5, 2023

codecov is failing with a config issue:

[2023-09-05T17:09:04.026Z] ['error'] There was an error running the uploader: Error uploading to https://codecov.io: Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

All other tests are passing so I'll go ahead and merge to unblock external users.

@xoloki xoloki merged commit 9b940a4 into main Sep 5, 2023
5 of 6 checks passed
@xoloki xoloki deleted the taproot-optional-merkle-root branch September 5, 2023 17:13
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.

3 participants