Open tomyrd opened 5 days ago
I think this is a good functionality to add. It could be done via a relatively simple kernel procedure - e.g., something like miden::note::get_script_hash
. This procedure would return the hash of the currently executing note or error out if we are not currently executing any notes.
Feature description
Would it be useful to have procedures in the kernel to obtain the context's script hash?
Why is this feature needed?
While implementing https://github.com/0xPolygonMiden/clob-example/pull/3 I needed to get the note script's hash from inside the note script itself. I ended up compiling and hashing the script and adding the digest to the note's inputs.
Maybe this case is too niche to deserve a dedicated procedure.