Stateless VM
The base layer implements a fork of ZkVM, which is part of a new blockchain architecture Slingshot, being developed by Oleg Andreev and others.
Base layer does not use Spacesuit, Musig and other libraries that are part of the project Slingshot, but only implement 14 specific opcodes from ZkVM relevant to implementing Twilight. Other ZkVM opcodes are specific to Cloak protocol, and their non-inclusion does not affect the expressiveness of programs on the base layer.

ZkVM forked opcodes

Stack Instructions
østringø → string
stack itemøstack \ item → ø
x[k] … x[0] dup:k → x[k] ... x[0] x[k]
x[k] x[k-1] ... x[0] roll:k → x[k-1] ... x[0] x[k]
CS instructions
scalar → expr
point → r1cs "variable"
var → expr
expr1 → expr2 (negates weight in expr1)
expr1 expr2 → expr3
expr1 expr2 → expr3
expr1 expr2 → constraint
adds 64 bit range proof for expr to CS
c1 c2→ c3
c1 → ø
For detailed spec, check ZkVM transaction specifications. Some opcodes have been renamed in the recent PR.
Copy link