Skip to content

Conversation

@mablr
Copy link
Contributor

@mablr mablr commented Nov 17, 2025

Motivation

Close #1040

Solution

add Signature::as_rsy method to obtain raw signature bytes, with y_parity as it is

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

- to obtain normalized signature bytes, with y_parity as it is
Copy link
Contributor Author

@mablr mablr left a comment

Choose a reason for hiding this comment

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

I’m not sure if this is the most appropriate name for this Signature helper.

Copy link
Contributor

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

this is eip-2098, so let's find an appropriate name for this and link to the eip?

ref https://eips.ethereum.org/EIPS/eip-2098

@github-project-automation github-project-automation bot moved this to In Progress in Alloy Nov 19, 2025
@mablr
Copy link
Contributor Author

mablr commented Nov 19, 2025

There is as_erc2098():

pub fn as_erc2098(&self) -> [u8; 64] {

Here as far as I understand we do uncompacted, so the following may be suitable:

  • as_erc2098_uncompacted()
  • as_eip2098_uncompacted()

@mattsse
Copy link
Member

mattsse commented Nov 19, 2025

hmm, actually, this isn't eip-2098, becasue we have that already and that is different

@mablr
Copy link
Contributor Author

mablr commented Nov 20, 2025

hmm, actually, this isn't eip-2098, becasue we have that already and that is different

I agree

(I edited my previous comment just before yours, sorry for the possible confusion)

@onbjerg
Copy link
Contributor

onbjerg commented Nov 20, 2025

erhhh, unsure then. maybe as_rsy? to highlight what it does. we already have a as_bytes and honestly I think maybe that's a mistake too because it doesn't really tell you the format (but we can't change that right now)

@mablr mablr changed the title feat: add as_raw_bytes method to Signature feat(primitives): add Signature::as_rsy method Nov 20, 2025
@mablr mablr requested a review from onbjerg November 20, 2025 20:54
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, pending @onbjerg

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

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[Feature] Add helper to obtain normalized signature bytes

3 participants