An open API service indexing awesome lists of open source software.

https://github.com/abdelstark/mikan

Mikan ๐ŸŠ: The ZK Friendly DA Layer for Bitcoin L2s
https://github.com/abdelstark/mikan

bitcoin da-layer data-availability data-availability-sampling starknet starks

Last synced: 2 months ago
JSON representation

Mikan ๐ŸŠ: The ZK Friendly DA Layer for Bitcoin L2s

Awesome Lists containing this project

README

        

GitHub Workflow Status
Bitcoin

# Mikan ๐ŸŠ: The ZK Friendly DA Layer for Bitcoin L2s




DOCS

|

FRIDA PAPER

|

FRIEDA LIB

Mikan

Mikan is a ZK-Rollup friendly data availability layer built on the Malachite consensus framework.
It provides strong data availability guarantees using STARK-friendly cryptographic primitives
without requiring a trusted setup.

It is design to be particularly friendly to ZK-Rollups, specifically on Bitcoin, by providing a DA layer that is
compatible with the FRI commitment scheme, and by eliminating the need for a trusted setup.

> Name origin ๐ŸŠ (่œœๆŸ‘):
>
> Officially known as a Citrus unshiu or unshiu mikan, mikan is a type of mandarin orange and citrus fruit that originated in southern Japan approximately 400 years ago.
>
> Bitcoin goes necessarily with the orange color, so naturally a DA layer for Bitcoin L2s should be orange, and the Japanese connection is a Satoshi style touch.

## ๐Ÿ’ผ Table of Contents

- [Mikan ๐ŸŠ: The ZK Friendly DA Layer for Bitcoin L2s](#mikan--the-zk-friendly-da-layer-for-bitcoin-l2s)
- [๐Ÿ’ผ Table of Contents](#-table-of-contents)
- [๐Ÿ”ง Key Features](#-key-features)
- [๐Ÿ“ Architecture](#-architecture)
- [๐Ÿ”‘ Cryptographic Components](#-cryptographic-components)
- [๐ŸŽฎ Getting Started](#-getting-started)
- [Prerequisites](#prerequisites)
- [Run a local testnet](#run-a-local-testnet)
- [Build the app](#build-the-app)
- [Setup the testnet](#setup-the-testnet)
- [Spawn the nodes](#spawn-the-nodes)
- [Usage for Rollups](#usage-for-rollups)
- [๐Ÿค Contributing](#-contributing)
- [๐Ÿ—บ๏ธ Roadmap](#๏ธ-roadmap)
- [๐Ÿ“ License](#-license)
- [๐Ÿ“š References](#-references)

## ๐Ÿ”ง Key Features

- **No Trusted Setup**: Unlike solutions using KZG commitments, Mikan relies on transparent
cryptography based on the FRI protocol, eliminating the need for trusted setup ceremonies.

- **ZK-Friendly Proofs**: Mikan generates succinct proofs of data availability using the M31
field (Mersenne prime 2^31-1), which is STARK-friendly and can be efficiently verified
inside ZK proofs.

- **Fast Consensus**: Built on the Malachite BFT consensus framework, which provides
high throughput and quick finality.

## ๐Ÿ“ Architecture

Mikan consists of the following components:

1. **Consensus Layer**: Based on Malachite BFT, handling block production and agreement.
2. **Data Availability Layer**: Uses FRI commitments and proofs for data availability sampling.
3. **Network Layer**: Ensures quick propagation of proposal parts across the network.
4. **API**: Allows rollups to submit data and retrieve availability certificates.

### ๐Ÿ”‘ Cryptographic Components

- **FRI Protocol**: Fast Reed-Solomon Interactive Oracle Proof for data availability.
- **M31 Field**: Uses the Mersenne prime 2^31-1 for efficient field arithmetic.
- **Merkle Trees**: For efficient commitments and proofs.

The core primitives for the Data Availability Sampling are implemented in [FRI Extended for Data Availability: a FRI-based Data Availability Sampling library, written in Rust.](https://github.com/keep-starknet-strange/frieda).

## ๐ŸŽฎ Getting Started

### Prerequisites

- Rust 1.71.0 or later
- Cargo

### Run a local testnet

#### Build the app

```bash
cargo build
```

### Setup the testnet

Generate configuration and genesis for three nodes using the `testnet` command:

```bash
cargo run -- testnet --nodes 3 --home nodes
```

This will create the configuration for three nodes in the `nodes` folder. Feel free to inspect this folder and look at the generated files.

### Spawn the nodes

```bash
bash spawn.bash --nodes 3 --home nodes
```

If successful, the logs for each node can then be found at `nodes/X/logs/node.log`.

```bash
tail -f nodes/0/logs/node.log
```

Press `Ctrl-C` to stop all the nodes.

## Usage for Rollups

Rollups can submit data to Mikan via its API:

1. **Submit Data**: Rollup submits transaction data to Mikan nodes
2. **Receive Commitment**: Mikan returns a cryptographic commitment to the data
3. **Verify Availability**: Anyone can verify data availability by sampling

The FRI commitment can be included in the rollup's state transition proof, creating
a seamless integration between the rollup's validity proofs and data availability guarantees.

## ๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## ๐Ÿ—บ๏ธ Roadmap

See [ROADMAP.md](ROADMAP.md).

## ๐Ÿ“ License

This project is licensed under the [MIT License](LICENSE).

## ๐Ÿ“š References

- [FRI Extended for Data Availability: a FRI-based Data Availability Sampling library, written in Rust.](https://github.com/keep-starknet-strange/frieda)
- [FRIDA: Data Availability Sampling from FRI](https://eprint.iacr.org/2024/248)
- [A Guide to Selecting the Right Data Availability Layer](https://blog.availproject.org/a-guide-to-selecting-the-right-data-availability-layer/)
- [M31 arithmetic opcodes for efficient STARK verification on Bitcoin](https://hackmd.io/@abdelhamid/m31-opcodes-bitcoin-stark)
- [Malachite - Flexible BFT consensus engine in Rust](https://github.com/informalsystems/malachite)

---

Started with love by [AbdelStark](https://github.com/AbdelStark) ๐Ÿงก

Feel free to follow me on Nostr if youโ€™d like, using my public key:

```text
npub1hr6v96g0phtxwys4x0tm3khawuuykz6s28uzwtj5j0zc7lunu99snw2e29
```

Or just **scan this QR code** to find me:

![Nostr Public Key QR Code](https://hackmd.io/_uploads/SkAvwlYYC.png)