Skip to content

feat: NetworkAccountTarget helpers in miden::standards#2338

Merged
mmagician merged 21 commits intomainfrom
mmagician-network-target-helpers
Jan 27, 2026
Merged

feat: NetworkAccountTarget helpers in miden::standards#2338
mmagician merged 21 commits intomainfrom
mmagician-network-target-helpers

Conversation

@mmagician
Copy link
Collaborator

@mmagician mmagician commented Jan 24, 2026

Create two MASM helper procedures under a new miden::standards::attachment::network_account_target:

  • new_attachment(account_id_prefix, account_id_suffix, exec_hint) -> NOTE_ATTACHMENT
  • get_id(NOTE_ATTACHMENT, NOTE_METADATA_HEADER) -> account_id_prefix, account_id_suffix

closes #2337

@mmagician mmagician force-pushed the mmagician-network-target-helpers branch 2 times, most recently from a429f13 to 39c3b41 Compare January 24, 2026 14:48
@mmagician mmagician marked this pull request as ready for review January 24, 2026 15:02
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 reviewed only the non-test code and left a couple of small comments inline.

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter 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!

I left a few suggestions.

@mmagician mmagician changed the base branch from next to main January 26, 2026 20:40
@mmagician mmagician changed the base branch from main to next January 26, 2026 20:40
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 a couple of comments inline.

Not for this PR, but we should also create documentation for the standards - similar to how we have docs for the protocol functionality. Let's create an issue for this.


# 0.13.3 (TBD)

- Added standards for working with `NetworkAccountTarget` attachments ([#2338](https://github.com/0xMiden/miden-base/pull/2338)).
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want this to go into the v0.13.x release, we should change the PR target to main. Otherwise, we should move the changelog entry into the v0.14.0 section.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed to main and rebased 👍🏼

Copy link
Contributor

@PhilippGackstatter PhilippGackstatter 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 to me!

Left two comments regarding validation and moving MASM tests to miden-testing.

Comment on lines +238 to +239
u32split
# => [attachment_kind, attachment_scheme]
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably validate attachment_kind as well here, i.e.:

https://github.com/0xMiden/miden-base/blob/fda68e1008f8b7b7633b8c3dfc6a0fe4e150dd32/crates/miden-protocol/asm/kernels/transaction/lib/output_note.masm#L375-L378

And looking at the neighboring extract_sender_from_metadata, it doesn't validate the account ID which it probably should also do. Would you mind adding a account_id::validate line there and add a Panics if section? If not, lmk and I'll open an issue or address it.

In general, I think the procedures we provide should provide as much safety as they can and if users want to work with potentially invalid metadata, they likely know what they're doing and can write their own procedures. But for 95% of users, validation should be the safer option.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

opened an issue: #2349

@mmagician mmagician changed the base branch from next to main January 27, 2026 10:26
@mmagician mmagician force-pushed the mmagician-network-target-helpers branch from 59052a4 to d01e1cf Compare January 27, 2026 10:26
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

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

Looks great, thank you for moving the tests to miden-testing🙏

@mmagician mmagician merged commit 0a90aeb into main Jan 27, 2026
17 checks passed
@mmagician mmagician deleted the mmagician-network-target-helpers branch January 27, 2026 16:50
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.

Create network target account helpers

3 participants