0xMiden/miden-vm

docs: document `word("...")` string constructor for word constants

Aperta

#2687 aperta il 13 feb 2026

 (1 commento) (0 reazioni) (0 assegnatari)Rust (303 fork)github user discovery
documentationgood first issue

Metriche repository

Star
 (753 stelle)
Metriche merge PR
 (Merge medio 6g 2h) (71 PR mergiate in 30 g)

Descrizione

Summary

The word("...") syntax for deriving a Word constant from a string hash is widely used (especially for named storage slot IDs) but is not documented in the assembly reference.

Details

The code organization docs document word constants declared as arrays ([1,2,3,4]) and hex values, but not the word("string") constructor.

This constructor is used extensively in miden-base and tutorials, e.g.:

const METADATA_SLOT = word("miden::standards::fungible_faucets::metadata")
push.METADATA_SLOT[0..2]
exec.active_account::get_item

Suggestion

Add a subsection to the "Word constants" section in docs/src/user_docs/assembly/code_organization.md explaining:

  • The word("string") syntax and what it computes (deterministic Word from string hash)
  • Common use case: named storage slot IDs with [0..2] slice notation

Guida contributor