-
Notifications
You must be signed in to change notification settings - Fork 108
Milestone
Description
Feature description
In release 0.10.0, we had a convenient Note::is_network_note() method. Since the introduction of NoteAttachments, it’s now more confusing to determine whether a Note is a network note.
Current Behavior
Right now, the simplest approach is:
NetworkAccountTarget::try_from(note.metadata().attachment())This works, but it’s indirect and not very discoverable.
Proposal
Introduce a NetworkNote newtype wrapper in miden-standards.
This would allow a cleaner API such as:
NetworkNote::try_from(note)Benefits
-
Makes “is this a network note?” a straightforward, first-class operation.
-
Centralizes the parsing/validation logic instead of spreading it across call sites.
-
Enables extracting additional network-note-specific properties, e.g.:
- target account ID
Acceptance Criteria
-
NetworkNote::try_from(Note)(or&Note) returns:Ok(NetworkNote)if the note is a network note- an error otherwise (ideally informative enough to debug misuse)
-
NetworkNoteexposes helper accessors for common fields (at minimum: target account ID)
Why is this feature needed?
DevEx
Reactions are currently unavailable