-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Compact form EIP-2098 signature recovery #1185
Labels
feat
Issue is a feature
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
In Ethers-rs (and I assume it's also in Ethers-js but I have not gotten there yet), when a message is signed the return type is a
Signature
which when converted into a vector consists of65
bytes that represent ther
,s
andv
values.The issue is that
Sway
uses64
bytes.There is a function that can be implemented to transform the representation here (
to_compact()
).This is not the final representation because it's not a single vector of bytes but we can have that function and perhaps another which takes these two values and outputs a vector.
Possible implementations
This is an implementation I have written in Rust inspired from Ethers-rs. I have not tested this to prove that it works but I think it might. It may be taken as an example from Rust and ported to Ts (and also added into the Rust SDK).
I haven't cleaned this up at all so there may be some canonical way of implementing this.
The text was updated successfully, but these errors were encountered: