Michelson opcode to convert bytes to integer
Michelson is a high-level language so there should be no need for such an opcode.
But ZK-rollups will introduce bytes-black-boxed operations. Not fully black-box, some verification part will need to be able check amounts of inputs/outputs of ZK-transactions. These amounts will be extracted from a byte sequence, as integers. We already have a way to split bytes, we need a way to interpreter them as integers.
It seems to be general enough to have an opcode to interpret a value of type bytes
, either as nat
or int
, either little-endian or big-endian. Most other bit tricks (e.g. trimming) can be implemented with existing Michelson opcodes on integer types.