0xMiden / 0xMiden/miden-proposals

Enable Atomic Composability via User-Defined Batches

Đang mở
#7 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
1
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## TL;DR

Miden follows the **actor model**: each transaction represents the state transition of a single account. This enables **parallel execution** and **asynchronous transaction processing**, but comes at the cost of **atomic composability** — the ability to modify multiple accounts atomically in one transaction.

Many DeFi use cases (e.g., flash loans, DEX arbitrage, liquidations) rely on atomic multi-account operations. We're looking for a team to research and implement **user-defined batches** as a way to bring atomic composability to Miden without sacrificing its core architectural advantages.

---

## Problem

Miden's actor model processes one account per transaction:
- This allows efficient parallel execution
- It minimizes contention and improves scalability

However, it also **prevents atomic updates across multiple accounts**. For example:
- A flashloan where funds are borrowed, used, and repaid must happen in one atomic operation
- Complex DeFi protocols often require multi-step workflows involving several accounts

On Miden, each account is updated in isolation, so such atomic interactions are not currently possible.

---

## Proposed Direction: User-Defined Batches

Users could construct a **batch** of account updates (transactions) that are:
- Verified together
- Either all succeed or all fail (atomicity)
- Executed sequentially or in a specified order

This introduces a limited form of atomic composability **without breaking the actor model**.

Key considerations:
- Accounts touched by a batch must be **locked** during verification
- Execution remains deterministic and auditable
- Fees, proofs, and constraints must be aggregated and validated coherently

---

## Objectives

We are looking for a team to:

1. **Analyze** the problem and explore multiple solutions
- What are the trade-offs of different batching models?
- How do they fit with Miden's parallel proving and execution design?

2. **Design** a concrete mechanism for user-defined batches
- Define batch structure, verification rules, account locking, etc.
- Evaluate potential DoS or front-running vectors
- Ensure compatibility with note/account model

3. **Implement** the batching feature in the Miden SDK
- Batch builder and validator APIs
- Tooling to simulate and test batch transactions
- Error reporting and debug tooling

4. **Document** and teach
- Write developer-facing documentation
- Publish tutorials or walkthroughs on how to use batch transactions in practice

---

## Deliverables

- Specification document outlining the proposed batching design and rationale
- SDK implementation (batch builder, validator, etc.)
- CLI or testing tools for working with batches
- Documentation and tutorials for developers

Specific milestones and timelines are to be defined.

---

## Desired Expertise

- Familiarity with Miden’s architecture (actor model, off-chain proving, notes/accounts)
- Strong Rust and some MASM expertise

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue này mô tả một dự án nghiên cứu và triển khai cho các batch do người dùng định nghĩa trong giao thức Miden. Bắt đầu bằng việc nghiên cứu Miden SDK và kiến trúc mô hình actor của nó. Công việc liên quan đến việc thiết kế cấu trúc batch, quy tắc xác minh và khóa tài khoản, sau đó triển khai các API batch builder và validator bằng Rust. Các sản phẩm bàn giao bao gồm tài liệu đặc tả, triển khai SDK, công cụ CLI/kiểm thử và tài liệu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rust
Lĩnh vực
backend-api-design, blockchain
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.