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 support for RIP-7212 #523

Closed
Amxx opened this issue Jun 17, 2024 · 6 comments · Fixed by #552 or NomicFoundation/hardhat#5512
Closed

Add support for RIP-7212 #523

Amxx opened this issue Jun 17, 2024 · 6 comments · Fixed by #552 or NomicFoundation/hardhat#5512
Assignees

Comments

@Amxx
Copy link

Amxx commented Jun 17, 2024

Describe the feature

RIP-7212 provides a precompile, at address(0x100) for secp256r1 verification. This is already live on multiple networks, including Matic (polygon).

It is currently not possible to test code that relies on this precompile using hardhat.

Some pointers:

Search terms

secp265r1, p256, precompile, RIP-7212, EIP-7212

@kanej
Copy link
Member

kanej commented Jun 18, 2024

Thanks @Amxx, we will take a look. We have larger plans for better L2 support, but this is useful enough to do more directly.

@kanej kanej transferred this issue from NomicFoundation/hardhat Jun 18, 2024
@github-project-automation github-project-automation bot moved this to Unconfirmed in EDR Jun 18, 2024
@fvictorio
Copy link
Member

@alcuadrado any preference for the config option? I'd suggest:

networks: {
  hardhat: {
    enableRip7212: true, // defaults to false

Some alternatives:

  • enableRIP7212
  • enableSecp265r1
  • enableSecp265r1Precompile

@fvictorio fvictorio removed this from Hardhat Jun 19, 2024
@fvictorio fvictorio moved this from Unconfirmed to Todo in EDR Jun 19, 2024
@alcuadrado
Copy link
Member

I think it's better to name the standard, because that's more precise than just naming the curve

@fvictorio fvictorio assigned fvictorio and unassigned kanej Jul 3, 2024
@fvictorio fvictorio assigned Wodann and unassigned fvictorio Jul 11, 2024
@fvictorio
Copy link
Member

To unit test this:

A call to the precompile address with this calldata:

0x4cee90eb86eaa050036147a12d49004b6b9c72bd725d39d4785011fe190f0b4da73bd4903f0ce3b639bbbf6e8e80d16931ff4bcf5993d58468e8fb19086e8cac36dbcd03009df8c59286b162af3bd7fcc0450c9aa81be5d10d312af6c66b1d604aebd3099c618202fcfe16ae7770b0c49ab5eadf74b754204a3bb6060e44eff37618b065f9832de4ca6ca971a7a1adc826d0f7c00181a5fb2ddf79ae00b4e10e

should return 0x0000000000000000000000000000000000000000000000000000000000000001.

Source, which in turn is copied from here.

@github-project-automation github-project-automation bot moved this from Todo to Done in EDR Jul 17, 2024
@Wodann Wodann reopened this Jul 17, 2024
@github-project-automation github-project-automation bot moved this from Done to Unconfirmed in EDR Jul 17, 2024
@Wodann Wodann moved this from Unconfirmed to Done in EDR Jul 17, 2024
@Wodann
Copy link
Member

Wodann commented Jul 17, 2024

I added support for RIP-7212 in EDR and exposed a config option to Hardhat. On their end, they need to expose it to the end user.

@fvictorio
Copy link
Member

@Amxx we just released Hardhat v2.22.7, which includes a new enableRip7212 option.

You can enable it like this:

networks: {
  hardhat: {
    enableRip7212: true,
  },
},

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
5 participants