-
Notifications
You must be signed in to change notification settings - Fork 28
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 eip55 #176
Support eip55 #176
Conversation
@@ -48,7 +48,8 @@ | |||
"@ipld/dag-cbor": "^9.0.6", | |||
"caip": "^1.1.0", | |||
"multiformats": "^12.1.3", | |||
"uint8arrays": "^4.0.9" | |||
"uint8arrays": "^4.0.9", | |||
"viem": "^1.19.13" |
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.
Any way to avoid importing this full library for just one utility function please? Maybe there are alternative packages that would be lighter?
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.
Viem is very likely going to be a dependency for the upcoming Varsig implementation, which means it's pretty much always going to be a requirement everywhere.
I think viem is pretty tree-shakable, so it shouldn't have much of an impact on actual build sizes?
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.
OK thanks, sounds good if tree-shaking works well 👍
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.
Well that's what I see on https://bundlephobia.com/package/viem
Can we trust the badge shown there?
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.
I don't know how reliable it is, I guess it depends on our own build process as well?
Would be good to figure out though, the lib is 200kB+ so a pretty big addition to a low-level library.
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.
Any thoughts on this @ukstv
This PR enables the pkh-ethereum CACAO verifier to verify SIWE messages that have the ethereum address in the
iss
field encoded using EIP-55, while retaining support for lower case addresses.In addition it would be desirable to change the default behavior of generated SIWE messages for CACAO to use eip55 by default since the spec says the address "Must" be encoded using eip55. However, since the
did-session
package uses@ceramicnetwork
packages that depend on a released version of@didtools
it's not possible to make this change now before the verification support has been rolled out.This PR fixes #173