Skip to content

feat(rust): add NFT mint-and-transfer recipe - #250

Merged
BrianSeong99 merged 3 commits into
mainfrom
brian/nft-mint-transfer-recipe
Sep 14, 2026
Merged

BrianSeong99 merged 3 commits into
mainfrom
brian/nft-mint-transfer-recipe

Conversation

@BrianSeong99

@BrianSeong99 BrianSeong99 commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add a runnable Rust recipe that mints one NFT with the standard non-fungible faucet, consumes it into Alice's wallet, transfers it to Bob, and verifies ownership after each step. The recipe funds all three accounts with native testnet assets and waits for every transaction to commit.

Based on main after #249 merged. The three NFT commits were replayed onto the merged migration on September 14. The diff contains only the five NFT recipe files (+759/-0), with no migration commits or unrelated changes.

Changes

  • Compose the standard authenticated NFT faucet with BasicWallet for native fee funding and CodeInspection for the production MINT note.
  • Publish and consume a real MINT request, then consume and transfer the resulting P2ID NFT notes. Verify the complete asset in wallet vaults and confirm both NFT-bearing notes are consumed.
  • Document the metadata/salt commitment as an off-chain convention; the faucet does not validate its preimage.
  • Follow the Rust tutorials' structure: overview, learning objectives, prerequisites, numbered steps with excerpts, complete example, expected output, and further reading. Place the page between the fungible-transfer and counter tutorials.
  • Register nft_mint_transfer with the tutorial runner and Rust doctests. Add a consistency test that keeps the published code identical to the executable.

Verification

Rechecked after replaying onto main on September 14: all six targeted Rust tests pass, the NFT binary compiles, and Rust doctests pass (18 passed, 26 ignored). The documentation build passes with no broken-link or anchor warnings. Rustfmt, Prettier, runner syntax/discovery and diff checks pass. All three commit patches are unchanged; the executable, documentation, shared NFT helpers and dependency lockfiles match the previously validated versions. The two live testnet runs below are prior validation, not new network runs after the history cleanup.

  • Targeted Rust tests: 6 passed (3 shared-library, 2 MASM compilation, 1 recipe consistency); the NFT binary compiled successfully.
  • Rust documentation tests: 18 passed, 26 partial snippets ignored (16 existing plus 10 NFT walkthrough excerpts). All 10 new excerpts were checked against the unchanged executable; the full NFT example remains compiled and covered by the consistency test.
  • Docusaurus npm run build:dev: passed with no broken-link warnings.
  • Rustfmt, Prettier, shell syntax, and tutorial runner discovery checks passed.
  • Two independent direct testnet runs with fresh accounts and stores completed successfully. Each committed all 3 fee-funding consumes and 5 NFT-flow transactions, including the final ownership assertions.
  • Run 2 balance verification: 119 native base units deducted per transaction, totaling 952 across those 8 transactions (Alice 476, Bob 238, NFT faucet 238). These figures exclude the funding service's own note-creation transactions.

Testnet execution used the locked dependencies and TUTORIAL_NETWORK=testnet cargo run --locked --manifest-path ../../Cargo.toml --bin nft_mint_transfer from a fresh directory under rust-client/.tutorial-runs/. The canonical Yarn wrapper's discovery and syntax were checked; its full clean-and-run path was not executed.

Follow-up and limits

  • Add the recipe to the Docs repository's explicit Rust Recipes sidebar when this source is ingested; maintain the content here.
  • The devnet attempt rejected SDK 0.16.0 during version negotiation before account creation. Testnet is the verified network.
  • Insufficient-balance and network-failure scenarios are not covered. Burning, marketplaces, and metadata hosting are outside this recipe.

@0xrouss-miden 0xrouss-miden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the full mint and transfer flow on testnet, including the final ownership checks. Rust tests and the docs build also pass. Ready to merge once #249 lands

@BrianSeong99
BrianSeong99 changed the base branch from chore/migrate-v0.16 to main September 14, 2026 09:56
@BrianSeong99
BrianSeong99 force-pushed the brian/nft-mint-transfer-recipe branch from c6b157c to d98d8e4 Compare September 14, 2026 09:56
@BrianSeong99
BrianSeong99 merged commit 965739b into main Sep 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants