0xMiden/miden-vm

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

Open

#2,687 opened on Feb 13, 2026

 (1 comment) (0 reactions) (0 assignees)Rust (303 forks)github user discovery
documentationgood first issue

Repository metrics

Stars
 (753 stars)
PR merge metrics
 (Avg merge 6d 2h) (71 merged PRs in 30d)

Description

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

Contributor guide