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

Add raw hash signing function (without the wrapping in Ethereum message: ...) #6955

Closed
mconnelly8 opened this issue Apr 4, 2024 · 8 comments · Fixed by #7346
Closed

Add raw hash signing function (without the wrapping in Ethereum message: ...) #6955

mconnelly8 opened this issue Apr 4, 2024 · 8 comments · Fixed by #7346
Assignees
Labels

Comments

@mconnelly8
Copy link

No description provided.

@jdevcs
Copy link
Contributor

jdevcs commented May 28, 2024

@jdevcs
Copy link
Contributor

jdevcs commented May 28, 2024

scope: add function, doc, unit test ( with recovery )

@blackmoshui
Copy link
Contributor

@jdevcs Hey, is anyone working on this? I'd love to try this one. I plan to add one more option parameter into the hashMessage to add support for whether there is a prefix or not.

export const hashMessage = (message: string): string => {

Overall, should we introduce new function pairs, such as signRaw/recoverRaw, or modify the logic of the existing sign/recover?

The latter might introduce breaking changes, because the current prefixed param of recover actually combines whether to hash and add a prefix. If we modify the existing functionality, this logic might change.

const hashedMessage = prefixedOrR ? data : hashMessage(data);

@jdevcs
Copy link
Contributor

jdevcs commented Oct 14, 2024

@blackmoshui thanks for your contribution, We will prefer to avoid breaking change.

@mconnelly8
Copy link
Author

Hey @blackmoshui, just wanted to confirm that you want to implement this? Let us know if you have any questions. The main thing we want to ensure is that we want to avoid breaking changes.

@blackmoshui
Copy link
Contributor

Hey @blackmoshui, just wanted to confirm that you want to implement this? Let us know if you have any questions. The main thing we want to ensure is that we want to avoid breaking changes.

I understand that avoiding breaking changes in a client-side SDK is very important.

I plan to add an optional parameter to hashMessage to support not adding a prefix, then add a new signRaw function along with corresponding tests and documentation.

In the initial PR, I won't add functions like recoverRaw because users can combine existing hashMessage and recover functions to implement recovery themselves. I believe this approach won't introduce any breaking changes.

What do you think? I can prepare a draft PR first.

@mconnelly8
Copy link
Author

@jdevcs?

@blackmoshui
Copy link
Contributor

I prepared a PR, but after completing it I realized that we could also achieve this functionality by modifying the existing sign function instead of adding a new function. I can modify the PR if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants