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 secp256r1 precompile: RIP 7212 #2443

Conversation

PowerStream3604
Copy link

Description

This PR adds the secp256r1 precompile to BSC network.
As mentioned in the RIP 7212, it adds the Secp256r1 precompile to the address 0x100 with the gas cost of 3450.

Rationale

Together with the recent rise of account abstraction and more integration of blockchain with Web2 applications, there has been an increasing need to validate Secp256r1-based signatures.
Many applications/key management systems like Passkey, Okta, etc are utilizing Secp256r1 signature scheme.

Conventionally, the validation of Secp256r1 signature was performed fully on-chain through smart contracts, hence degrading the UX of users due to high gas fees (e.g., 180K~350K gas unit depending on the implementation).

With the adoption of this implementation, BSC Network, which is one of the most used and popular chains, will be able to accommodate more seamless integration with these Web2 applications and use cases.

Changes

Notable changes:

  • Add Secp256r1 precompile to the Cancun version
  • Add tests to validate the correctness of the implementation
  • Set Secp256r1 precompile gas fee to 3450

@PowerStream3604
Copy link
Author

Okay it looks like it was a duplicate of #2400
I'll close this for now and reopen it if needed.

@zzzckck
Copy link
Collaborator

zzzckck commented May 10, 2024

We may support it in next BSC hard fork: Haber, target Q3

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.

2 participants