Skip to content

feat: add miden::standards::note_tag module#2366

Merged
PhilippGackstatter merged 7 commits intonextfrom
pgackst-note-tag-followup
Jan 30, 2026
Merged

feat: add miden::standards::note_tag module#2366
PhilippGackstatter merged 7 commits intonextfrom
pgackst-note-tag-followup

Conversation

@PhilippGackstatter
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter commented Jan 29, 2026

Follow-up to #2329 that removes miden::protocol::note::build_note_tag_for_network_account and adds miden::standards::note_tag.

It contains two procedures:

  • create_account_target - equivalent to NoteTag::with_account_target
  • create_custom_account_target - equivalent to NoteTag::with_custom_account_target

Setting note tags for notes targeted at network accounts may no longer be useful, as mentioned here. So, the current use of this procedure in create_burn_note may not be necessary. The logic still seems useful to have when creating notes targeted at local accounts at runtime.

Includes various small doc fixes and replaces magic numbers with constants.

Replaces ExecutionError with ExecError in CodeExecutor for better out-of-the-box error messages in failing tests.

Comment on lines +25 to +28
push.{id_prefix}
push.{tag_len}

exec.note_tag::create_custom_account_target
Copy link
Contributor

Choose a reason for hiding this comment

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

In what scenario would it be required to create a NoteTag with a tag length greater than 1? Does this mean that the note can have multiple tags?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not quite sure I understand the question. A note tag with len 0 or 1 would contain 0 or 1 bit from the account ID prefix, so it'd be almost useless. So for useful note tags we almost always want a tag with len greater than 1. (Default is 14).

I think the reason to support 0 is mainly for API uniformity, so you can pass any value in 0..=32, but also so you can easily "nullify" a note tag by passing len = 0, if you don't want a tag.

Not sure if this answers the question.

Copy link
Contributor

@partylikeits1983 partylikeits1983 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for updating the bridge out masm code :)

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I left one comment inline - but it is not directly related to this PR.

Comment on lines +60 to 61
exec.note_tag::create_account_target
# => [network_faucet_tag, ASSET]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not directly related to this PR, but why do we need to set a tag for a BURN note? These are network notes and instead of a tag we should be setting an attachment for them, no?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll merge this PR as is - but cc @partylikeits1983 and @mmagician in case this is something we'd want to update in a different PR.

@PhilippGackstatter PhilippGackstatter merged commit 72f5fc6 into next Jan 30, 2026
17 checks passed
@PhilippGackstatter PhilippGackstatter deleted the pgackst-note-tag-followup branch January 30, 2026 08:40
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.

3 participants