MIP-28 - Enhancing MultiversX Smart Contract Capabilities with Zero-Knowledge Proofs and Elliptic Curve Cryptography Primitives

Enhancing MultiversX Smart Contract Capabilities with Zero-Knowledge Proofs and Elliptic Curve Cryptography Primitives

Abstract: This proposal outlines the formal integration and documentation of a new set of powerful cryptographic primitives recently added to the MultiversX Virtual Machine (VM). These additions, primarily centered around zero-knowledge proofs (ZKPs) and elliptic curve cryptography (ECC), are designed to significantly advance the capabilities of smart contracts on the MultiversX network. By providing on-chain, low-level access to these cryptographic building blocks, the MultiversX SpaceVM aims to empower developers to build a new generation of decentralized applications that are more private, scalable, and sophisticated, thereby unlocking a wide range of new use cases.

1. Introduction & Purpose: The introduction of these new cryptographic primitives represents a significant leap forward for smart contracts on MultiversX. The core purpose is the formal integration and documentation of these tools, which will empower developers to create decentralized applications that are inherently more private, scalable, and sophisticated. This initiative is set to open the door to diverse new use cases, ranging from privacy-preserving Decentralized Finance (DeFi) to complex SovereignChain integration solutions. The proposal also serves to detail the new functions, their technical specifications, and the exciting possibilities they unlock for the MultiversX ecosystem, inviting community discussion and feedback.

2. Formal Integration & Documentation: The proposal formally integrates and documents a new set of cryptographic primitives within the MultiversX VM. This includes two primary categories of functions:

2.1. New ZK Proof Verification Functions: The MultiversX VM now includes two new functions for verifying zero-knowledge proofs directly on-chain: ManagedVerifyGroth16 and ManagedVerifyPlonk. These functions are crucial for enabling smart contracts to validate complex computations without needing to execute them on-chain, which helps save gas and facilitates privacy-preserving applications.

  • 1. ManagedVerifyGroth16

    • Description: This function verifies a zero-knowledge proof using the Groth16 proof system. Groth16 is described as a widely-used, efficient, and succinct non-interactive zero-knowledge proof system.

    • Supported Curves: The function supports the BN254, BLS12_377, and BLS12_381 elliptic curves.

  • 2. ManagedVerifyPlonk

    • Description: This function verifies a zero-knowledge proof using the PLONK proof system. PLONK is noted as a newer proof system featuring a universal and updatable trusted setup, offering more flexibility than Groth16’s per-circuit trusted setup.

    • Supported Curves: The function supports the BN254, BLS12_377, and BLS12_381 elliptic curves.

These functions are considered essential for building applications requiring privacy and scalability, such as ZK-rollups and anonymous credential systems.

2.2. New Elliptic Curve Operations: Alongside the ZK proof verification functions, the VM now provides a suite of low-level functions for performing elliptic curve cryptography operations. These are foundational for many cryptographic protocols, including digital signatures, key exchange, and more complex ZK schemes. The supported curves for these operations are BN254, BLS12_377, and BLS12_381.

  • Supported Groups: For all these operations, the supported groups are G1 and G2.

  • 1. ManagedAddEC

    • Description: Performs point addition on an elliptic curve (P1 + P2).
  • 2. ManagedMulEC

    • Description: Performs scalar multiplication on an elliptic curve (s * P).
  • 3. ManagedMapToCurveEC

    • Description: Maps a byte array to a valid point on an elliptic curve, an operation crucial for protocols requiring hashing to a curve.
  • 4. ManagedMultiExpEC

    • Description: Performs a multi-exponentiation operation (s1*P1 + s2*P2 + … + sn*Pn), which is an optimized way to perform multiple scalar multiplications and additions at once.
  • 5. ManagedPairingCheckEC

    • Description: Performs a pairing check, a fundamental operation in advanced cryptographic schemes like BLS signatures and some ZK-SNARKs. A pairing is defined as a map e: G1 x G2 → GT that satisfies the bilinearity property e(a*P, b*Q) = e(P, Q)^(a*b).

These elliptic curve operations provide foundational building blocks for developers to implement a wide variety of cryptographic protocols directly in their smart contracts.

3. New Smart Contract Use Cases & Impact: The introduction of these new cryptographic primitives unlocks a vast design space for developers on the MultiversX network. Key use cases include:

  • 3.1. Privacy-Preserving Applications:

    • Confidential Transactions: Enabling shielded transaction amounts, senders, or receivers using ZK proofs for enhanced privacy in DeFi.

    • Anonymous Credentials and Voting: Proving statements about identity (e.g., age) without revealing the identity itself, leading to private and secure voting or authentication systems.

    • Private Data Marketplaces: Users can prove possession of data without revealing it, allowing for monetizing information privately.

  • 3.2. On-Chain Verifiable Computation:

    • ZK-Bridging: bridge with proofs

    • On-Chain Verifiable Computation: Offloading heavy computations off-chain and verifying results on-chain with ZK proofs, allowing for more complex and computationally intensive applications.

  • 3.3. Advanced Financial Instruments:

    • Sophisticated Derivatives: Using new ECC operations to build more complex and secure financial instruments like options and futures.

    • Novel DeFi Primitives: Enabling privacy-preserving AMMs, on-chain verifiable randomness, and other advanced DeFi solutions.

  • 3.4. Identity and Reputation Systems:

    • Verifiable Credentials: Building decentralized identity systems based on W3C Verifiable Credentials for privacy-preserving credential presentation.

    • On-Chain Reputation: Using ZK proofs to build reputation systems where users can prove their reputation without revealing their entire history.

  • 3.5. Interoperability and Cross-Chain Communication:

    • Secure Bridges: Utilizing new cryptographic primitives (e.g., BLS signatures) to build more secure and trust-minimized bridges between MultiversX and other blockchains.

4. Community Engagement: The MultiversX team invites the community to discuss, provide feedback, and actively explore the potential of these newly integrated tools. This collaborative approach is vital for maximizing the utility and adoption of these powerful cryptographic capabilities. Question for community: is there need for other curves / other primitives?

1 Like