Skip to content

Convert note scripts to libraries #2339

@bobbinth

Description

@bobbinth

Currently, we write note script MASM files as programs (i.e., with begin ... end block). This makes it difficult to get access to note script roots programmatically (see #2335 (comment) for more context). To fix this, we can convert note scripts to libraries. For example, BURN note script, instead of the current

use miden::standards::notes::burn

begin
    exec.burn::main
end

Could be defined as:

pub use miden::standards::notes::burn::main

To make this work, we'll need to add an annotation to the miden::standards::notes::burn::main. This would look something like:

@note_script
pub proc main
    ...
end

Then, in the NoteScript: constructor, we'd take Library rather than Program as a parameter, and then would look for the procedure with @note_script attribute.

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersstandardsRelated to standard note scripts or account components

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions