Skip to content

ethereum utility library #2404

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

Merged
merged 23 commits into from
May 21, 2025
Merged

ethereum utility library #2404

merged 23 commits into from
May 21, 2025

Conversation

aramikm
Copy link
Collaborator

@aramikm aramikm commented May 13, 2025

Goal

The goal of this PR is to create a ethereum utility library which can help us dealing with ethereum addresses and signatures and etc.

Closes #2281

What is added?

  • Generates CJS and ESM and browser compatible JS.
  • Be able to generate EIP-712 signatures and verify them
  • Generate Ethereum keys with different address encodings

Checklist

  • Unit Tests added?
  • e2e Tests modified

@aramikm aramikm marked this pull request as ready for review May 20, 2025 00:56
@aramikm aramikm requested review from demisx and wilwade as code owners May 20, 2025 00:56
Copy link
Collaborator

@demisx demisx left a comment

Choose a reason for hiding this comment

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

LGTM, but I mostly reviewed only the .github/workflows/ changes. You might want to ask someone else also to review.

verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
};

export const ADD_PROVIDER_DEFINITION = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again, I don't think so, but I wonder if we need to version these in any way? I guess we can later add _V2 on the end without issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would say, any structs that already are at "V2" should get _V2 appended to the const name now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If it the only version based on our existing convention I didn't add any version but all versions > 1 should have the version in the name unless there's been a mistake (just like what Joe suggested)

@@ -97,50 +97,6 @@ export function signPayload(keys: KeyringPair, data: Codec): MultiSignatureType
}
}

/**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yay!

Copy link
Collaborator

@wilwade wilwade left a comment

Choose a reason for hiding this comment

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

A few questions, but nothing blocking. Good work.

@@ -0,0 +1 @@
nodejs 20.12.2
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: e2e tests are using 22.12.0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct, but I think since we have other clients that are using node 20 it made sense to use the older version since this is going to be a dependency for those.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator

@enddynayn enddynayn left a comment

Choose a reason for hiding this comment

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

👍 great!

Copy link
Collaborator

@mattheworris mattheworris left a comment

Choose a reason for hiding this comment

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

  • Read through changes.
  • Nice work!
    🚢 it!

@aramikm aramikm merged commit bfdd6a7 into main May 21, 2025
31 checks passed
@aramikm aramikm deleted the ethereum_utils branch May 21, 2025 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create New JS/TS Library for Ethereum-Compatible Keys and Signatures
7 participants