0xMiden / 0xMiden/miden-proposals

Implement Precompiles for Efficient Cryptography and ZK Proof Verification

Ouverte
#6 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Aucune donnée de langage
Étoiles
1
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## TL;DR

Miden VM is designed for STARK-based proving, and while this enables parallelization and recursion, it makes certain algorithms prohibitively expensive to execute natively. We will build a [canonical interface for adding precompiles](https://github.com/0xMiden/miden-vm/issues/1796), and we're looking for a team to help build a first set of essential precompiles.

The goal is to support cryptographic primitives and proof systems that are currently inefficient or infeasible to implement directly in Miden Assembly, like eliptic curves.

---

## Problem

Miden’s core proving model excels at operations optimized for STARKs, but struggles with:

- Elliptic curve operations not friendly to STARKs (e.g., secp256k1 for ECDSA)
- Hash functions like Keccak (used in Ethereum compatibility)
- Recursive SNARK/STARK verification (e.g., SP1 or RISC Zero proofs)

These operations are foundational for:
- Verifying Ethereum and Solana signatures
- Bridging with EVM ecosystems
- Verifying off-chain computations (via recursive proofs)
- Integrating external ZK circuits or proving systems
- Oracles

Running these computations inside the Miden VM as MASM code is currently **too slow or too expensive** to be practical.

---

## Objective

We want to implement **precompiles** — native host functions callable from within the Miden VM — to enable the above use cases.

---

## Scope

Implement precompiles for:

1. **ECDSA (secp256k1)**: Signature verification for Ethereum-style accounts
2. **EdDSA (ed25519)**: Signature verification for Solana-style accounts
3. **Keccak-256**: Hash function used widely in EVM compatibility
4. **Proof verification**:
- **SP1** proofs
- **RISC Zero** proofs

---

## Proof of Concept Phase

The first goal is a working proof-of-concept:
- The precompiles are callable via the interface defined in [#1796](https://github.com/0xMiden/miden-vm/issues/1796)
- Each function should accept inputs in a Miden-compatible format (stack, memory, or note inputs)
- Return valid results verifiable inside the Miden VM
- Include simple test vectors or benchmarks
- Maybe: batching of signature verification using Miden's recursion

---

## Final Product

A production-ready implementation should include:
- Performance-optimized precompile logic
- Miden SDK integration
- Benchmarks for runtime and constraint cost
- Documentation and usage examples
- Defined performance targets (to be specified)

---

## Desired Expertise

We are looking for a team with experience in:
- Cryptographic implementation (especially ECDSA, EdDSA and Keccak)
- ZK proof systems and recursive verification
- Rust (the Miden VM is implemented in Rust)
- WASM or host binding experience is a plus

---

## Interested?

If you're interested in contributing to this effort or have relevant experience, please comment below or reach out directly. Let us know:
- Which precompile(s) you're interested in tackling
- Your relevant experience
- Timeline or availability for PoC and full implementation

Let's make Miden composable and interoperable without compromising on performance or privacy! 🔧🧪

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Examinez la conception d'interface canonique dans l'issue #1796. Le travail implique d'implémenter des fonctions hôtes natives en Rust pour des primitives cryptographiques (secp256k1, ed25519, Keccak-256) et la vérification de preuves (SP1, RISC Zero). Commencez par comprendre l'interface d'appel hôte de la Miden VM et comment les entrées/sorties sont transmises. 'Terminé' signifie que chaque précompilation est appelable, renvoie des résultats vérifiables et dispose de vecteurs de test.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
rust, wasm
Domaine
backend, blockchain, cryptography
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.