Identity Mixer: Using IBM/mathlib instead of AMCL
yacovm opened this issue · 0 comments
Currently, the Identity Mixer (hereafter "idemix") implementation in fabric-CA uses an implementation from an old incarnation of Fabric.
Nowadays, Fabric doesn't contain an implementation of idemix and instead, it imports the official IBM implementation.
There are several problems with the current state of affairs:
- Fabric-CA is essentially using an Idemix version that doesn't exist anymore (it was removed in this PR), and thus is no longer maintained.
- The official idemix implementation supports several elliptic curve and finite field packages, such as the efficient BN254 implementation of gnark-crypto. This flexibility is due to using Mathlib which is an abstraction layer on top of various elliptic curve and finite field arithmetic packages. In contrast, Fabric-CA is restricted to a specific implementation and hardcodes its usage throughout its code.
Fabric-CA is the main tool for issuance of idemix credentials, and it currently restricts consumers of it to a specific elliptic curve and finite field package, while idemix itself can support a wider variety of credentials (for other elliptic curve and finite field packages).
What I propose is to refactor Fabric-CA such that it will use Mathlib, in alignment to the Fabric idemix implementation.
Then, Fabric-CA could issue every idemix credential that the Fabric version of idemix can consume.
Another advantage of doing this, is that the aforementioned elliptic curve implementation of gnark-crypto is much faster than the current implementation used by Fabric-CA, and consumers of idemix could get a performance boost by using a different elliptic curve implementation.
I propose to add to the idemix configuration of the Fabric-CA server (and similarly in the client) the following key which will toggle between the available curve and finite field packages.
CurveID string `def:"CurveID" skip:"true" help:"Name of the curve among {'amcl.Fp256bn', 'gurvy.Bn254', 'amcl.Fp256Miraclbn'}, defaults to 'amcl.Fp256bn'"`
The default curve, as mentioned above, will remain what Fabric-CA uses today, for backward compatibility.