Add MASM network account tutorial covering network notes, FPI, and diagnostics
- Dominant language
- Rust
- Stars
- 18
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
## 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
Contributor guide
Assessment
This issue has not been assessed yet.