Skip to content

Comments

feat: migrate to miden VM 0.21 and miden crypto 0.22#2508

Open
PhilippGackstatter wants to merge 52 commits intopgackst-asset-layoutfrom
pgackst-bele-migration
Open

feat: migrate to miden VM 0.21 and miden crypto 0.22#2508
PhilippGackstatter wants to merge 52 commits intopgackst-asset-layoutfrom
pgackst-bele-migration

Conversation

@PhilippGackstatter
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter commented Feb 25, 2026

Changes

  • Updates dependencies:
    • Miden VM crates to 0.21
    • Miden Crypto to 0.22
    • Removes unused miden-air, winterfell, winter-rand-utils, winter-air
  • Deactivates the agglayer crate to avoid merge conflicts with work done in the agglayer branch.
  • Reverses StackInputs and StackOutputs since this changed in the VM.
  • The definition of "tracked" in a PartialSmt has changed which is why a PartialAccountTree test needed an update (upsert_state_commitments_fails_on_untracked_key).
  • Removes const from some AccountId methods due to as_canonical_u64 not being const (which replaces the previously const fn as_int).
  • Attempts to establish consistent usage of RATE0, RATE1, CAPACITY as the hasher state. Previously the order of the rate words was not documented (RATE, RATE) and after hashing we sometimes used PERM, PERM, PERM which doesn't say much. Not yet fully converted in this PR -> done as a follow-up.
  • Optimized advice stack in a few cases to avoid a swap when hashing such as swapping NOTE_ATTACHMENT and NOTE_METADATA_HEADER.
  • The input and output notes commitment could avoid a swapw in the kernel if we re-arranged how the hash is defined (though this isn't done in this PR, and I'm not fully convinced yet it's worth doing).
  • deny.toml
    • Upgrades toml to version 1 to fix the cargo deny check that complained about two versions being used.
    • Remove ISC license that is not encountered in dependencies.
    • Add "CC0-1.0" license used by tiny-keccak.
    • Removes some unused skip-tree entries.

Migration

  • See Change stack ordering through unified LE convention and sponge state remapping miden-vm#2547 for the changes at the VM level.
  • The order of [prefix, suffix] was changed to [suffix, prefix] for all slot IDs and account IDs (and the newly introduced asset ID). Note that slot IDs can still be pushed with push.SLOT_NAME[0..2]. See the diff of docs/src/protocol_library.md with the previous version for what has changed in miden::protocol.
  • Word layouts must be reversed on the VM stack, e.g. TokenMetadata changes from stack [token_symbol, decimals, max_supply, token_supply] to [token_supply, max_supply, decimals, token_symbol].

Follow-Ups

Done in #2512 except for the agglayer ones.

  • All TODO(bele). Some of these are agglayer-related.
  • Refactor account ID to be defined as suffix = digest0 and prefix = digest1 where digest is the hash of seed and the commitments so it is more consistent with the half-word layout.
  • Reorder tx summary on the stack so it can be hashed without swapping and adv.insert_hqword can be used.
  • Rename the Falcon512Rpo variants in Signature, AuthScheme, AuthSecretKey to Falcon512Poseidon2.
  • Couple smaller improvements post-migration to optimize stack layout and consistency.

Thanks to @Al-Kindi-0 and @huitseeker for their prior migration work that was a great reference, and the support in DMs!

@PhilippGackstatter PhilippGackstatter added the pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority label Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant