gnark icon indicating copy to clipboard operation
gnark copied to clipboard

MPC Generated Pedersen Keys

Open 0xForerunner opened this issue 1 year ago • 1 comments

Description

Some circuits require that the pedersen key is MPC generated.

I'm opening this up as a draft PR as I'd like to gather some feedback on it! Additionally, it will require that encoding for [][]curve.G1Affine is supported in gnark-crypto. Once I've got the go ahead from one of the maintainers I'll proceed with the encoding work upstream and properly updating the templates.

This change involves adding a couple fields to both Phase2Evaluations and Phase2 which represent the G1 points of the Pedersen keys. Phase2.Contribute() then handles the MPC contributions like you'd expect.

Breaking changes include the addition of the new struct fields, as well as the change of arguments in ExtractKeys

Fixes

https://github.com/Consensys/gnark/issues/1046 https://github.com/Consensys/gnark/issues/1136

Type of change

  • New feature

How has this been tested?

  • ✅ TestEcdsa

Checklist:

  • ✅ I have performed a self-review of my code
  • ✅ I have commented my code, particularly in hard-to-understand areas
  • ✅ I have made corresponding changes to the documentation
  • ✅ I have added tests that prove my fix is effective or that my feature works
  • 🚫 I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • ✅ New and existing unit tests pass locally with my changes

0xForerunner avatar Jun 27 '24 05:06 0xForerunner

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 27 '24 05:06 CLAassistant

Just commenting here for a bump! @ivokub or @Tabaie Would love to get your thoughts.

0xForerunner avatar Jul 05 '24 17:07 0xForerunner

Hi @ewoolsey apologies for the delay it's been very busy recently. Will review asap.

Tabaie avatar Jul 05 '24 17:07 Tabaie

Hi @ewoolsey apologies for the delay it's been very busy recently. Will review asap.

All good, thanks so much for taking a look! I don't see any reason why this shouldn't be the default behaviour, but if you see any issues let me know!

0xForerunner avatar Jul 05 '24 17:07 0xForerunner

@hussein-aitlahcen thanks so much for the initial review. If you think this is good to go ahead now then I'll go ahead and translate these changes into the templates.

0xForerunner avatar Jul 23 '24 22:07 0xForerunner

@hussein-aitlahcen thanks so much for the initial review. If you think this is good to go ahead now then I'll go ahead and translate these changes into the templates.

Maybe @Tabaie could double check what we did please? I'm not a cryptographer :).

hussein-aitlahcen avatar Jul 23 '24 22:07 hussein-aitlahcen

@Tabaie just bumping this one more time 👍

0xForerunner avatar Jul 29 '24 15:07 0xForerunner

@Tabaie sorry just bumping this again ahah

0xForerunner avatar Aug 30 '24 16:08 0xForerunner

Thanks so much for taking a look @Tabaie. Let me know if there's anything you need from me!

0xForerunner avatar Oct 02 '24 23:10 0xForerunner