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

feat: add common signature encoding #107

Merged
merged 5 commits into from
Jul 5, 2024
Merged

Conversation

feri42
Copy link
Contributor

@feri42 feri42 commented Jun 25, 2024

This signature encoding seems to be popping up frequently. I'm wondering if we should include it here.

The binary encoding comes in handy so far for: filecoin, theta, tron, vechain, ...

@feri42 feri42 changed the title feat: add commin signature encoding feat: add common signature encoding Jun 26, 2024

const r = Buffer.from(sig.r.toArray('be', 32))
const s = Buffer.from(sig.s.toArray('be', 32))
return Buffer.concat([r, s, Buffer.from([sig.recoveryParam])])
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the same order in which ethereum expects them? Is there some standard format that defines this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@feri42
Copy link
Contributor Author

feri42 commented Jul 4, 2024

@mvayngrib , @kewde are you guys OK with this? I already have 4 assets that follow this pattern.

Copy link
Contributor

@sparten11740 sparten11740 left a comment

Choose a reason for hiding this comment

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

utACK

@sparten11740 sparten11740 requested a review from mvayngrib July 5, 2024 12:28
Copy link
Contributor

@kewde kewde left a comment

Choose a reason for hiding this comment

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

utACK

@feri42 feri42 merged commit db4e478 into master Jul 5, 2024
8 checks passed
@feri42 feri42 deleted the f/add-new-signature-encoding branch July 5, 2024 21:19
Copy link
Collaborator

@mvayngrib mvayngrib left a comment

Choose a reason for hiding this comment

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

post utACK

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

Successfully merging this pull request may close these issues.

4 participants