0xMiden / 0xMiden/protocol

Optimize note script encoding

Open
#576 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
132
Forks
167
Avg merge
1d 23h
Merged PRs (30d)
110

Description

### What should be done?

The note script is encoded to/from Felts to push to/from the VM. The current encoding uses `u32`, since a Felt doesn't support the full range of `u64`. But this can be improved by just not having the high bit set, which means one can use 7 bytes out of the 8 bytes in a `u64` to encode the script, and almost double the space efficiency

### How should it be done?

Change the `NoteScript` conversions to/from Felt to use `u64`

### When is this task done?

When the code above is merged and tested

### Additional context

https://github.com/0xPolygonMiden/miden-base/pull/572#discussion_r1555578703

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.