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

[poc] add missing rsv functions #1269

Merged
merged 1 commit into from
May 25, 2022
Merged

Conversation

janniks
Copy link
Collaborator

@janniks janniks commented May 23, 2022

scope

  • adds previously missing signing functions in RSV format (Clarity compatible)

references (important for history/context)

usage

The original functions are marked as deprecated and the correct format methods introduced use a suffix of Rsv e.g. verifyMessageSignatureRsv(...)

I would propose this deprecating path forward and let stacks-wallet-web switch to signMessageHashRsv. The suffix highlights explicitness. I also added MessageHash to the function name to further make it clear that a typical use works on a hash (compared to a message/plain-text) and the sign function does not do any previous message hashing here.

If folks are against the suffix, I'm also not opposed to signMessageHash or a consumer-facing signMessage, which would internally use more explicit methods.

In a planned overhaul (and major version bump) of the available crypto-helper methods of stacks.js, we will probably refactor this again and remove deprecated functions. Ideally, I would want to see stacks.js only export Clarity-compatible methods (to not confuse developers).

@vercel
Copy link

vercel bot commented May 23, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
stacks-js ✅ Ready (Inspect) Visit Preview May 25, 2022 at 1:23PM (UTC)

@janniks
Copy link
Collaborator Author

janniks commented May 23, 2022

@pradel does this make sense?

@codecov-commenter
Copy link

codecov-commenter commented May 23, 2022

Codecov Report

Merging #1269 (d55c046) into master (60a2643) will increase coverage by 0.74%.
The diff coverage is 97.05%.

❗ Current head d55c046 differs from pull request most recent head a94c266. Consider uploading reports for the commit a94c266 to get more accurate results

@@            Coverage Diff             @@
##           master    #1269      +/-   ##
==========================================
+ Coverage   64.57%   65.31%   +0.74%     
==========================================
  Files         125      125              
  Lines        8713     8862     +149     
  Branches     1901     1944      +43     
==========================================
+ Hits         5626     5788     +162     
+ Misses       2833     2818      -15     
- Partials      254      256       +2     
Impacted Files Coverage Δ
packages/transactions/src/keys.ts 98.78% <94.73%> (+5.92%) ⬆️
packages/common/src/signatures.ts 100.00% <100.00%> (+77.77%) ⬆️
packages/encryption/src/ec.ts 76.02% <100.00%> (+3.40%) ⬆️
packages/common/src/utils.ts 43.18% <0.00%> (+0.45%) ⬆️
packages/transactions/src/utils.ts 95.90% <0.00%> (+0.53%) ⬆️
packages/encryption/src/sha2Hash.ts 96.55% <0.00%> (+1.55%) ⬆️
packages/wallet-sdk/src/utils.ts 77.46% <0.00%> (+1.99%) ⬆️
packages/stacking/src/utils.ts 62.50% <0.00%> (+8.18%) ⬆️
packages/encryption/src/keys.ts 78.46% <0.00%> (+9.71%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60a2643...a94c266. Read the comment docs.

@janniks janniks marked this pull request as ready for review May 23, 2022 19:56
@janniks janniks changed the title fix: add missing rsv functions [poc] add missing rsv functions May 23, 2022
@janniks janniks force-pushed the fix/add-missing-rsv-methods branch from 2360d66 to b37a490 Compare May 23, 2022 20:10
@janniks janniks force-pushed the fix/add-missing-rsv-methods branch from b37a490 to ebe55af Compare May 23, 2022 20:24
Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

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

Always a fan of explicit naming 👍

Copy link
Contributor

@beguene beguene left a comment

Choose a reason for hiding this comment

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

Really like the Rsv suffix, it will avoid confusion and prevent errors.

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.

5 participants