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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trait (Serde, Debug, Eq), store and is_valid_xxx_signature and tests for secp256r1 #987

Open
0xknwn opened this issue May 9, 2024 · 0 comments 路 May be fixed by #988
Open

Add trait (Serde, Debug, Eq), store and is_valid_xxx_signature and tests for secp256r1 #987

0xknwn opened this issue May 9, 2024 · 0 comments 路 May be fixed by #988

Comments

@0xknwn
Copy link

0xknwn commented May 9, 2024

馃 Motivation

OpenZeppelin/cairo-contracts includes a number of utils to support secp256k1:

  • types for publickey and signature
  • traits for serialization, debug, eq
  • a store to save the secp256k1 public keys in a contract in a packed format
  • is_valid_eth_signature to check a secp256k1 signature is valid
  • a collection of Cairo tests and a data set to validate the implementation of the above

These tools are used internally in OpenZeppelin/cairo-contracts to implement the Eth Account. They are also available for third party projects that uses your project as a library. We use them in our starknet-modular-account project.

We have implemented the same set of tools for secp256r1 that is also supported by the starknet corelib. We would like to submit a PR that them so that we can rely on them the same way we rely on your secp256k1 implementation.

馃摑 Details

See PR #988 for details about the implementation. We've done the adaptation from secp256k1 to secp256r1 but, except for the mapping between the functions and features the implementation is the same.

@0xknwn 0xknwn linked a pull request May 9, 2024 that will close this issue
4 tasks
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 a pull request may close this issue.

1 participant