GuildOfWeavers / distaff

Zero-knowledge virtual machine written in Rust
MIT License
244 stars 44 forks source link

Add support for macro operations #22

Closed bobbinth closed 4 years ago

bobbinth commented 4 years ago

Currently, there are several operations which are meaningful only if executed as a part of a mini-program. These operations include CMP, BINACC, and HASHR. Knowing how to arrange these operations into mini-programs to achieve common tasks places an undue burden on users of the VM.

A better approach is to have a simple assembly-like set of instructions which may reduce either to a single operation or to a pre-defined sequence of operations.

For example, new operations could be HASH, GT, 'LT` etc. which would be reduce to a mini-programs upon execution.