0xMiden / 0xMiden/tutorials

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

未关闭
#193 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
documentation
主要语言
Rust
星标
18
派生
34
PR 合并指标
30 天内没有已合并 PR

描述

## 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

贡献指南

打开贡献指南

调研方向

The tutorial will be added to the 0xMiden/tutorials repository. Start by reviewing existing MASM tutorials and the linked protocol and node issues to understand network accounts, FPI, and network notes. The tutorial must include MASM code for network accounts, a client script for setup, and demonstrate note creation and status checking. Verify the tutorial runs against a local/testnet Miden node.

由索引模型根据 Issue 内容生成。

评估

技术栈
rust, typescript
领域
documentation
Issue 类型
文档
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。