Skip to content

fabricx: use idemix with new curves to sign transactions#1236

Open
Rozerxshashank wants to merge 2 commits intohyperledger-labs:mainfrom
Rozerxshashank:issue-1093-idemix-curves
Open

fabricx: use idemix with new curves to sign transactions#1236
Rozerxshashank wants to merge 2 commits intohyperledger-labs:mainfrom
Rozerxshashank:issue-1093-idemix-curves

Conversation

@Rozerxshashank
Copy link
Copy Markdown

@Rozerxshashank Rozerxshashank commented Apr 10, 2026

Closes : #1093

Description

This PR addresses the hardcoded FP256BN_AMCL curve in the Idemix implementation. The existing logic made it difficult to adopt newer, more efficient elliptic curves like BN254 (via mathlib/gnark-crypto), which offer better performance and avoid known race conditions in the older AMCL library.
I've refactored the identity loading pipeline to make the elliptic curve configurable while maintaining strict backward compatibility.

Changes

  • Config: Added an optional curveID field to the MSP configuration struct.
  • Loader: Updated the identity loader to parse the curveID string and pass the corresponding math.CurveID to the providers.
  • Deserializer: Added a curve-configurable constructor for the deserializer to ensure consistent verification of remote identities.
  • Membership Interface: Extended LocalMembership with RegisterIdemixMSPWithCurve to allow programmatic curve selection.
  • Backward Compatibility: All existing methods (RegisterIdemixMSP, NewProviderWithAnyPolicy, NewDeserializer) now delegate to the new curve-aware variants using the legacy FP256BN_AMCL as the default.

Testing

Verified the changes with the following steps:

  • Ran all Idemix provider unit tests (platform/fabric/core/generic/msp/idemix): Passed.
  • Ran full platform build: Succeeded.
  • Verified linting with golangci-lint run --fix: 0 issues.

Manual Configuration

You can now specify the curve in your network configuration:

fabric:
  msps:
    - id: idemix
      mspType: idemix
      mspID: IdemixOrgMSP
      path: ./crypto/idemix
      curveID: BN254  # Supported: BN254, FP256BN_AMCL, BLS12_381_BBS, etc.

@Rozerxshashank Rozerxshashank force-pushed the issue-1093-idemix-curves branch from 35054e1 to 93528c5 Compare April 10, 2026 19:38
@Rozerxshashank Rozerxshashank force-pushed the issue-1093-idemix-curves branch from 93528c5 to 494fe9b Compare April 12, 2026 09:12
@adecaro adecaro self-requested a review April 13, 2026 08:09
@mbrandenburger mbrandenburger added this to the 26Q2 milestone Apr 13, 2026
@mbrandenburger mbrandenburger added idemix msp everything identity related labels Apr 13, 2026
@Rozerxshashank
Copy link
Copy Markdown
Author

HI @adecaro, please review this when you get time. Thanks ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idemix msp everything identity related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fabricx: use idemix with new curves to sign transactions

3 participants