0xMiden / 0xMiden/tutorials

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

Abierto
#193 0 comentarios 0 reacciones 0 asignados Ver en GitHub
documentation
Lenguaje dominante
Rust
Estrellas
18
Forks
34
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.