0xMiden / 0xMiden/tutorials

Add MASM network account tutorial covering network notes, FPI, and diagnostics

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

Mô tả

## Problem

Pioneer feedback reports that it is difficult to build and debug network-account flows that use FPI.

The concrete use case was a registry network account that needed to consume a network note and FPI into a newly created pool account to verify its code commitment. The team could get the logic working locally with public accounts, but the network-account/network-note path was difficult to reason about and debug.

The missing end-to-end documentation is:

- writing the network account / called account procedures in MASM,
- creating a public note targeted at a network account,
- using the correct `NetworkAccountTarget` attachment,
- calling FPI from a network-note execution path,
- understanding which account data can be lazy-loaded,
- checking network-note failure/status when execution does not consume the note.

This should be MASM-first. Current FPI examples use `exec.tx::execute_foreign_procedure` in MASM; Rust or TypeScript client code should only be used for setup, deployment, transaction construction, and status inspection.

## Why this matters

Network accounts are the pattern developers need for shared public state, AMMs, registries, and other app-level contracts. If the first serious network-account integration requires private debugging help from the core team, the DevEx is not ready for more Pioneers.

## Proposed scope

Create a MASM-first tutorial or guide that walks through a small but realistic flow:

- write a public/network account in MASM that exposes a callable interface,
- write a second public account in MASM that will be read through FPI,
- use Rust or TypeScript client code only to deploy accounts, create notes, and submit/check transactions,
- create a public network note targeting the network account,
- execute MASM logic that reads the foreign account state/code commitment,
- explain which pieces are loaded by the client/node and which need to be supplied by the developer,
- show how to query network-note error/status when the note remains unconsumed.

## Acceptance criteria

- The tutorial runs against a supported local/testnet setup.
- The tutorial demonstrates a network note with `NetworkAccountTarget`.
- The tutorial includes a MASM `exec.tx::execute_foreign_procedure` call during the network-note flow.
- The tutorial does not imply that high-level Rust smart-contract code currently supports FPI directly.
- The tutorial documents the v0.14+ lazy-loading behavior for public foreign accounts.
- The tutorial includes a debugging section using the network-note status/error endpoint available in supported versions.

## Related context

- 0xMiden/protocol#2285
- 0xMiden/protocol#2814
- 0xMiden/node#1758
- 0xMiden/node#1818
- 0xMiden/miden-client#1958
- 0xMiden/miden-client#1981
- 0xMiden/tutorials#122

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

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

Đánh giá

Issue này chưa được đánh giá.

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.