Skip to content

Add Rust smart contract authoring path and compiler maturity warning #289

@BrianSeong99

Description

@BrianSeong99

Context

The Build → Smart Contracts section is currently Rust-first, but the planned IA should make the model explicit:

  • Smart Contracts is the domain.
  • Rust and MASM are authoring paths.
  • Miden Standards are reusable building blocks used from both authoring paths.

Rust-authored smart contracts are an important onboarding path, but the current Rust compiler should be presented with an appropriate maturity warning so developers understand the tradeoff before relying on it for production-sensitive code.

Related issues:

  • 0xMiden/docs#287 tracks Build-facing docs for Miden standards.
  • 0xMiden/docs#288 tracks MASM as a dedicated authoring path under Build → Smart Contracts.
  • 0xMiden/docs#286 tracks renaming Core Concepts to Reference.

Recommendation

Add or clarify a Rust authoring path under Build → Smart Contracts and include a visible callout near the start of the Rust path.

Suggested callout text:

:::caution Compiler maturity
Rust smart contract support is still under active development and is not yet fully production-ready. Use it with caution for production-sensitive logic, validate generated behavior with tests, and prefer direct MASM when you need precise control over account, note, or transaction-script execution.
:::

The exact wording can be tuned with the compiler team, but the docs should clearly set expectations that Rust authoring is useful and supported for development, while the compiler is still maturing.

Proposed information architecture

Recommended placement inside Smart Contracts:

  • builder/smart-contracts/rust/index.md
  • builder/smart-contracts/rust/project-structure.md
  • builder/smart-contracts/rust/accounts.md
  • builder/smart-contracts/rust/components.md
  • builder/smart-contracts/rust/storage.md
  • builder/smart-contracts/rust/testing.md
  • builder/smart-contracts/rust/compiler-limitations.md

This can be phased in. If a full IA refactor is too large for the first PR, add the warning callout to the existing Rust-first Smart Contracts overview and first smart contract pages first.

Content to cover

Minimum first pass:

  • What Rust authoring does in Miden: Rust → Wasm → MASM → VM execution/proof.
  • When Rust is the right authoring path.
  • When direct MASM is safer or more precise.
  • Known compiler limitations and unsupported patterns.
  • How to inspect or reason about generated MASM where possible.
  • How to test Rust-authored account components and scripts.
  • Cross-links to MASM docs, compiler reference, and Miden Standards docs.

Validation requirements

Every Rust example in this section should be validated in a brand-new Docker environment before the PR is opened.

Expected validation path:

  • Compile Rust examples against the target published crate versions for versioned v0.14 docs.
  • Compile Rust examples against the appropriate local or next sources for current/unstable docs when APIs differ.
  • Run the smallest available test harness when compilation alone is not enough to validate behavior.
  • Run the docs build after ingestion and confirm no new broken links or anchors.
  • Update versioned docs when examples describe v0.14 APIs or behavior.

Scope

  • Add or clarify the Rust authoring path under Build → Smart Contracts.
  • Add the compiler maturity warning callout.
  • Cross-link Rust docs with MASM, Standards, Tutorials, and Compiler reference pages.
  • Keep examples executable and grounded in shipped APIs.

Out of scope

  • Changing compiler behavior.
  • Replacing MASM docs.
  • Documenting every compiler limitation in the first PR if the list needs compiler-team review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions