-
Notifications
You must be signed in to change notification settings - Fork 315
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
feat: add SIP-018 support #1284
feat: add SIP-018 support #1284
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
thoughts on moving the new files/methods to the @stacks/encryption package? currently, this is where all the additional signing related methods are (which are not necessarily needed for transactions) — this way we could keep the encrpytion dep out of transactions deps. cc @kyranjamie
|
@janniks Yes I initially did that but I needed |
I could temporarily move my |
or I can just keep |
Not sure on best way to organise this, but signing methods in encryption package doesn't really make sense. Either we have a generic |
🙃 semantically signing is somewhat closer to tx, as txs need signing (not structured). in hindsight, signing can only really live in tx unless we want to split structured-signing from signing (even in the monorepo i don't want the package count to explode). so if structured signing needs clarity values (currently in tx, unless we wanna open the next can of worms), and signing anything else would result in circular deps. so for now, i think we can leave as is — and i'll try to think of how/if this can be improved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
At some point we might need to think about how this type will be serialized. Currently, devs could probably cast it to a clarity buffer and use the reference clarity verifier
1786b9f
to
1e87cc5
Compare
Codecov Report
@@ Coverage Diff @@
## master #1284 +/- ##
==========================================
+ Coverage 64.78% 64.97% +0.18%
==========================================
Files 125 126 +1
Lines 8718 8742 +24
Branches 1896 1896
==========================================
+ Hits 5648 5680 +32
+ Misses 2818 2811 -7
+ Partials 252 251 -1
Continue to review full report at Codecov.
|
@janniks I added
export function encodeStructuredData({
message,
domain,
}: {
message: ClarityValue;
domain: ClarityValue;
}): Buffer {
|
1e87cc5
to
1425a8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Excited to try this out soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Should we merge+release?
Yes ! 🚀 |
closes #1283 #1281
Those functions are required to support SIP-018 here, in connect and the web-wallet
The following functions have been added
encodeStructuredData
decodeStructuredDataSignature
signStructuredData
Testing information
I added some unit test and the test vectors specified in SIP-018 covering 100% of the new code paths.
Checklist
npm run test
passescc: @janniks @kyranjamie @MarvinJanssen @aulneau