diff --git a/docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx b/docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx deleted file mode 100644 index b7de3caf1344..000000000000 --- a/docs/docs/_protocol-specs/public-vm/gen/_instruction-set.mdx +++ /dev/null @@ -1,1603 +0,0 @@ -[comment]: # (THIS IS A GENERATED FILE! DO NOT EDIT!) -[comment]: # (Generated via `yarn preprocess`) - -[comment]: # (Generated by genMarkdown.js, InstructionSet.js, InstructionSize.js) - -import Markdown from 'react-markdown' -import CodeBlock from '@theme/CodeBlock' - - -## Instructions Table - -Click on an instruction name to jump to its section. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OpcodeNameSummaryExpression
0x00\[\`ADD\`\](#isa-section-add)Addition (a + b){ - `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` - }
0x01\[\`SUB\`\](#isa-section-sub)Subtraction (a - b){ - `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` - }
0x02\[\`MUL\`\](#isa-section-mul)Multiplication (a * b){ - `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` - }
0x03\[\`DIV\`\](#isa-section-div)Unsigned integer division (a / b){ - `M[dstOffset] = M[aOffset] / M[bOffset]` - }
0x04\[\`FDIV\`\](#isa-section-fdiv)Field division (a / b){ - `M[dstOffset] = M[aOffset] / M[bOffset]` - }
0x05\[\`EQ\`\](#isa-section-eq)Equality check (a == b){ - `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` - }
0x06\[\`LT\`\](#isa-section-lt)Less-than check (a < b){ - `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` - }
0x07\[\`LTE\`\](#isa-section-lte)Less-than-or-equals check (a <= b){ - `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` - }
0x08\[\`AND\`\](#isa-section-and)Bitwise AND (a & b){ - `M[dstOffset] = M[aOffset] AND M[bOffset]` - }
0x09\[\`OR\`\](#isa-section-or)Bitwise OR (a | b){ - `M[dstOffset] = M[aOffset] OR M[bOffset]` - }
0x0a\[\`XOR\`\](#isa-section-xor)Bitwise XOR (a ^ b){ - `M[dstOffset] = M[aOffset] XOR M[bOffset]` - }
0x0b\[\`NOT\`\](#isa-section-not)Bitwise NOT (inversion){ - `M[dstOffset] = NOT M[aOffset]` - }
0x0c\[\`SHL\`\](#isa-section-shl)Bitwise leftward shift (a << b){ - `M[dstOffset] = M[aOffset] << M[bOffset]` - }
0x0d\[\`SHR\`\](#isa-section-shr)Bitwise rightward shift (a >> b){ - `M[dstOffset] = M[aOffset] >> M[bOffset]` - }
0x0e\[\`CAST\`\](#isa-section-cast)Type cast{ - `M[dstOffset] = cast(M[aOffset])` - }
0x0f\[\`ADDRESS\`\](#isa-section-address)Get the address of the currently executing l2 contract{ - `M[dstOffset] = context.environment.address` - }
0x10\[\`SENDER\`\](#isa-section-sender)Get the address of the sender (caller of the current context){ - `M[dstOffset] = context.environment.sender` - }
0x11\[\`TRANSACTIONFEE\`\](#isa-section-transactionfee)Get the computed transaction fee during teardown phase, zero otherwise{ - `M[dstOffset] = context.environment.transactionFee` - }
0x12\[\`CHAINID\`\](#isa-section-chainid)Get this rollup's L1 chain ID{ - `M[dstOffset] = context.environment.globals.chainId` - }
0x13\[\`VERSION\`\](#isa-section-version)Get this rollup's L2 version ID{ - `M[dstOffset] = context.environment.globals.version` - }
0x14\[\`BLOCKNUMBER\`\](#isa-section-blocknumber)Get this L2 block's number{ - `M[dstOffset] = context.environment.globals.blocknumber` - }
0x15\[\`TIMESTAMP\`\](#isa-section-timestamp)Get this L2 block's timestamp{ - `M[dstOffset] = context.environment.globals.timestamp` - }
0x16\[\`FEEPERL2GAS\`\](#isa-section-feeperl2gas)Get the fee to be paid per "L2 gas" - constant for entire transaction{ - `M[dstOffset] = context.environment.globals.feePerL2Gas` - }
0x17\[\`FEEPERDAGAS\`\](#isa-section-feeperdagas)Get the fee to be paid per "DA gas" - constant for entire transaction{ - `M[dstOffset] = context.environment.globals.feePerDaGas` - }
0x18\[\`CALLDATACOPY\`\](#isa-section-calldatacopy)Copy calldata into memory{ - `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` - }
0x19\[\`L2GASLEFT\`\](#isa-section-l2gasleft)Remaining "L2 gas" for this call (after this instruction){ - `M[dstOffset] = context.MachineState.l2GasLeft` - }
0x1a\[\`DAGASLEFT\`\](#isa-section-dagasleft)Remaining "DA gas" for this call (after this instruction){ - `M[dstOffset] = context.machineState.daGasLeft` - }
0x1b\[\`JUMP\`\](#isa-section-jump)Jump to a location in the bytecode{ - `context.machineState.pc = loc` - }
0x1c\[\`JUMPI\`\](#isa-section-jumpi)Conditionally jump to a location in the bytecode{ - `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` - }
0x1d\[\`INTERNALCALL\`\](#isa-section-internalcall)Make an internal call. Push the current PC to the internal call stack and jump to the target location. -{`context.machineState.internalCallStack.push(context.machineState.pc) -context.machineState.pc = loc`} -
0x1e\[\`INTERNALRETURN\`\](#isa-section-internalreturn)Return from an internal call. Pop from the internal call stack and jump to the popped location.{ - `context.machineState.pc = context.machineState.internalCallStack.pop()` - }
0x1f\[\`SET\`\](#isa-section-set)Set a memory word from a constant in the bytecode{ - `M[dstOffset] = const` - }
0x20\[\`MOV\`\](#isa-section-mov)Move a word from source memory location to destination{ - `M[dstOffset] = M[srcOffset]` - }
0x21\[\`CMOV\`\](#isa-section-cmov)Move a word (conditionally chosen) from one memory location to another (`d = cond > 0 ? a : b`){ - `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` - }
0x22\[\`SLOAD\`\](#isa-section-sload)Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. -{`M[dstOffset] = S[M[slotOffset]]`} -
0x23\[\`SSTORE\`\](#isa-section-sstore)Write a word to this contract's persistent public storage -{`S[M[slotOffset]] = M[srcOffset]`} -
0x24\[\`NOTEHASHEXISTS\`\](#isa-section-notehashexists)Check whether a note hash exists in the note hash tree (as of the start of the current block) -{`exists = context.worldState.noteHashes.has({ - leafIndex: M[leafIndexOffset] - leaf: hash(context.environment.address, M[noteHashOffset]), -}) -M[existsOffset] = exists`} -
0x25\[\`EMITNOTEHASH\`\](#isa-section-emitnotehash)Emit a new note hash to be inserted into the note hash tree -{`context.worldState.noteHashes.append( - hash(context.environment.address, M[noteHashOffset]) -)`} -
0x26\[\`NULLIFIEREXISTS\`\](#isa-section-nullifierexists)Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) -{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( - hash(M[addressOffset], M[nullifierOffset]) -) -M[existsOffset] = exists`} -
0x27\[\`EMITNULLIFIER\`\](#isa-section-emitnullifier)Emit a new nullifier to be inserted into the nullifier tree -{`context.worldState.nullifiers.append( - hash(context.environment.address, M[nullifierOffset]) -)`} -
0x28\[\`L1TOL2MSGEXISTS\`\](#isa-section-l1tol2msgexists)Check if a message exists in the L1-to-L2 message tree -{`exists = context.worldState.l1ToL2Messages.has({ - leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] -}) -M[existsOffset] = exists`} -
0x29\[\`GETCONTRACTINSTANCE\`\](#isa-section-getcontractinstance)Copies contract instance data to memory -{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ - instance_found_in_address, - instance.salt ?? 0, - instance.deployer ?? 0, - instance.contractClassId ?? 0, - instance.initializationHash ?? 0, - instance.portalContractAddress ?? 0, - instance.publicKeysHash ?? 0, -]`} -
0x2a\[\`EMITUNENCRYPTEDLOG\`\](#isa-section-emitunencryptedlog)Emit an unencrypted log -{`context.accruedSubstate.unencryptedLogs.append( - UnencryptedLog { - address: context.environment.address, - log: M[logOffset:logOffset+M[logSizeOffset]], - } -)`} -
0x2b\[\`SENDL2TOL1MSG\`\](#isa-section-sendl2tol1msg)Send an L2-to-L1 message -{`context.accruedSubstate.sentL2ToL1Messages.append( - SentL2ToL1Message { - address: context.environment.address, - recipient: M[recipientOffset], - message: M[contentOffset] - } -)`} -
0x2c\[\`CALL\`\](#isa-section-call)Call into another contract -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } -chargeGas(context, - l2GasCost=M[instr.args.gasOffset], - daGasCost=M[instr.args.gasOffset+1]) -traceNestedCall(context, instr.args.addrOffset) -nestedContext = deriveContext(context, instr.args, isStaticCall=false) -execute(nestedContext) -updateContextAfterNestedCall(context, instr.args, nestedContext)`} -
0x2d\[\`STATICCALL\`\](#isa-section-staticcall)Call into another contract, disallowing World State and Accrued Substate modifications -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } -chargeGas(context, - l2GasCost=M[instr.args.gasOffset], - daGasCost=M[instr.args.gasOffset+1]) -traceNestedCall(context, instr.args.addrOffset) -nestedContext = deriveContext(context, instr.args, isStaticCall=true -execute(nestedContext) -updateContextAfterNestedCall(context, instr.args, nestedContext)`} -
0x2e\[\`RETURN\`\](#isa-section-return)Halt execution within this context (without revert), optionally returning some data -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] -halt`} -
0x2f\[\`REVERT\`\](#isa-section-revert)Halt execution within this context as `reverted`, optionally returning some data -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] -context.contractCallResults.reverted = true -halt`} -
0x30\[\`TORADIXLE\`\](#isa-section-to_radix_le)Convert a word to an array of limbs in little-endian radix formTBD: Storage of limbs and if T[dstOffset] is constrained to U8
- - -## Instructions - -### `ADD` -Addition (a + b) - -[See in table.](#isa-table-add) - -- **Opcode**: 0x00 -- **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] + M[bOffset] mod 2^k` -- **Details**: Wraps on overflow -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/ADD.png)](/img/protocol-specs/public-vm/bit-formats/ADD.png) - -### `SUB` -Subtraction (a - b) - -[See in table.](#isa-table-sub) - -- **Opcode**: 0x01 -- **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] - M[bOffset] mod 2^k` -- **Details**: Wraps on undeflow -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/SUB.png)](/img/protocol-specs/public-vm/bit-formats/SUB.png) - -### `MUL` -Multiplication (a * b) - -[See in table.](#isa-table-mul) - -- **Opcode**: 0x02 -- **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] * M[bOffset] mod 2^k` -- **Details**: Wraps on overflow -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/MUL.png)](/img/protocol-specs/public-vm/bit-formats/MUL.png) - -### `DIV` -Unsigned integer division (a / b) - -[See in table.](#isa-table-div) - -- **Opcode**: 0x03 -- **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` -- **Details**: If the input is a field, it will be interpreted as an integer -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/DIV.png)](/img/protocol-specs/public-vm/bit-formats/DIV.png) - -### `FDIV` -Field division (a / b) - -[See in table.](#isa-table-fdiv) - -- **Opcode**: 0x04 -- **Category**: Compute - Arithmetic -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] / M[bOffset]` -- **Tag checks**: `T[aOffset] == T[bOffset] == field` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 120 - - -### `EQ` -Equality check (a \=\= b) - -[See in table.](#isa-table-eq) - -- **Opcode**: 0x05 -- **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] == M[bOffset] ? 1 : 0` -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = u8` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/EQ.png)](/img/protocol-specs/public-vm/bit-formats/EQ.png) - -### `LT` -Less-than check (a \< b) - -[See in table.](#isa-table-lt) - -- **Opcode**: 0x06 -- **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] < M[bOffset] ? 1 : 0` -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = u8` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/LT.png)](/img/protocol-specs/public-vm/bit-formats/LT.png) - -### `LTE` -Less-than-or-equals check (a \<\= b) - -[See in table.](#isa-table-lte) - -- **Opcode**: 0x07 -- **Category**: Compute - Comparators -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] <= M[bOffset] ? 1 : 0` -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = u8` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/LTE.png)](/img/protocol-specs/public-vm/bit-formats/LTE.png) - -### `AND` -Bitwise AND (a & b) - -[See in table.](#isa-table-and) - -- **Opcode**: 0x08 -- **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] AND M[bOffset]` -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/AND.png)](/img/protocol-specs/public-vm/bit-formats/AND.png) - -### `OR` -Bitwise OR (a | b) - -[See in table.](#isa-table-or) - -- **Opcode**: 0x09 -- **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] OR M[bOffset]` -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/OR.png)](/img/protocol-specs/public-vm/bit-formats/OR.png) - -### `XOR` -Bitwise XOR (a ^ b) - -[See in table.](#isa-table-xor) - -- **Opcode**: 0x0a -- **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] XOR M[bOffset]` -- **Tag checks**: `T[aOffset] == T[bOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/XOR.png)](/img/protocol-specs/public-vm/bit-formats/XOR.png) - -### `NOT` -Bitwise NOT (inversion) - -[See in table.](#isa-table-not) - -- **Opcode**: 0x0b -- **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = NOT M[aOffset]` -- **Tag checks**: `T[aOffset] == inTag` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 96 - -[![](/img/protocol-specs/public-vm/bit-formats/NOT.png)](/img/protocol-specs/public-vm/bit-formats/NOT.png) - -### `SHL` -Bitwise leftward shift (a \<\< b) - -[See in table.](#isa-table-shl) - -- **Opcode**: 0x0c -- **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] << M[bOffset]` -- **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/SHL.png)](/img/protocol-specs/public-vm/bit-formats/SHL.png) - -### `SHR` -Bitwise rightward shift (a \>\> b) - -[See in table.](#isa-table-shr) - -- **Opcode**: 0x0d -- **Category**: Compute - Bitwise -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for this instruction. -- **Args**: - - **aOffset**: memory offset of the operation's left input - - **bOffset**: memory offset of the operation's right input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[aOffset] >> M[bOffset]` -- **Tag checks**: `T[aOffset] == inTag`, `T[bOffset] == u8` -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 128 - -[![](/img/protocol-specs/public-vm/bit-formats/SHR.png)](/img/protocol-specs/public-vm/bit-formats/SHR.png) - -### `CAST` -Type cast - -[See in table.](#isa-table-cast) - -- **Opcode**: 0x0e -- **Category**: Type Conversions -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **dstTag**: The [tag/size](./memory-model#tags-and-tagged-memory) to tag the destination with but not to check inputs against. -- **Args**: - - **aOffset**: memory offset of word to cast - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = cast(M[aOffset])` -- **Details**: Cast a word in memory based on the `dstTag` specified in the bytecode. Truncates (`M[dstOffset] = M[aOffset] mod 2^dstsize`) when casting to a smaller type, left-zero-pads when casting to a larger type. See [here](./memory-model#cast-and-tag-conversions) for more details. -- **Tag updates**: `T[dstOffset] = dstTag` -- **Bit-size**: 96 - -[![](/img/protocol-specs/public-vm/bit-formats/CAST.png)](/img/protocol-specs/public-vm/bit-formats/CAST.png) - -### `ADDRESS` -Get the address of the currently executing l2 contract - -[See in table.](#isa-table-address) - -- **Opcode**: 0x0f -- **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.address` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png)](/img/protocol-specs/public-vm/bit-formats/ADDRESS.png) - -### `SENDER` -Get the address of the sender (caller of the current context) - -[See in table.](#isa-table-sender) - -- **Opcode**: 0x10 -- **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.sender` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/SENDER.png)](/img/protocol-specs/public-vm/bit-formats/SENDER.png) - -### `TRANSACTIONFEE` -Get the computed transaction fee during teardown phase, zero otherwise - -[See in table.](#isa-table-transactionfee) - -- **Opcode**: 0x11 -- **Category**: Execution Environment -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.transactionFee` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - - -### `CHAINID` -Get this rollup's L1 chain ID - -[See in table.](#isa-table-chainid) - -- **Opcode**: 0x12 -- **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.globals.chainId` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/CHAINID.png)](/img/protocol-specs/public-vm/bit-formats/CHAINID.png) - -### `VERSION` -Get this rollup's L2 version ID - -[See in table.](#isa-table-version) - -- **Opcode**: 0x13 -- **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.globals.version` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/VERSION.png)](/img/protocol-specs/public-vm/bit-formats/VERSION.png) - -### `BLOCKNUMBER` -Get this L2 block's number - -[See in table.](#isa-table-blocknumber) - -- **Opcode**: 0x14 -- **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.globals.blocknumber` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png)](/img/protocol-specs/public-vm/bit-formats/BLOCKNUMBER.png) - -### `TIMESTAMP` -Get this L2 block's timestamp - -[See in table.](#isa-table-timestamp) - -- **Opcode**: 0x15 -- **Category**: Execution Environment - Globals -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.globals.timestamp` -- **Tag updates**: `T[dstOffset] = u64` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png)](/img/protocol-specs/public-vm/bit-formats/TIMESTAMP.png) - -### `FEEPERL2GAS` -Get the fee to be paid per "L2 gas" - constant for entire transaction - -[See in table.](#isa-table-feeperl2gas) - -- **Opcode**: 0x16 -- **Category**: Execution Environment - Globals - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.globals.feePerL2Gas` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERL2GAS.png) - -### `FEEPERDAGAS` -Get the fee to be paid per "DA gas" - constant for entire transaction - -[See in table.](#isa-table-feeperdagas) - -- **Opcode**: 0x17 -- **Category**: Execution Environment - Globals - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.environment.globals.feePerDaGas` -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png)](/img/protocol-specs/public-vm/bit-formats/FEEPERDAGAS.png) - -### `CALLDATACOPY` -Copy calldata into memory - -[See in table.](#isa-table-calldatacopy) - -- **Opcode**: 0x18 -- **Category**: Execution Environment - Calldata -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **cdOffset**: offset into calldata to copy from - - **copySize**: number of words to copy - - **dstOffset**: memory offset specifying where to copy the first word to -- **Expression**: `M[dstOffset:dstOffset+copySize] = context.environment.calldata[cdOffset:cdOffset+copySize]` -- **Details**: Calldata is read-only and cannot be directly operated on by other instructions. This instruction moves words from calldata into memory so they can be operated on normally. -- **Tag updates**: `T[dstOffset:dstOffset+copySize] = field` -- **Bit-size**: 120 - -[![](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png)](/img/protocol-specs/public-vm/bit-formats/CALLDATACOPY.png) - -### `L2GASLEFT` -Remaining "L2 gas" for this call (after this instruction) - -[See in table.](#isa-table-l2gasleft) - -- **Opcode**: 0x19 -- **Category**: Machine State - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.MachineState.l2GasLeft` -- **Tag updates**: `T[dstOffset] = u32` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/L2GASLEFT.png) - -### `DAGASLEFT` -Remaining "DA gas" for this call (after this instruction) - -[See in table.](#isa-table-dagasleft) - -- **Opcode**: 0x1a -- **Category**: Machine State - Gas -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = context.machineState.daGasLeft` -- **Tag updates**: `T[dstOffset] = u32` -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png)](/img/protocol-specs/public-vm/bit-formats/DAGASLEFT.png) - -### `JUMP` -Jump to a location in the bytecode - -[See in table.](#isa-table-jump) - -- **Opcode**: 0x1b -- **Category**: Machine State - Control Flow -- **Args**: - - **loc**: target location to jump to -- **Expression**: `context.machineState.pc = loc` -- **Details**: Target location is an immediate value (a constant in the bytecode). -- **Bit-size**: 48 - -[![](/img/protocol-specs/public-vm/bit-formats/JUMP.png)](/img/protocol-specs/public-vm/bit-formats/JUMP.png) - -### `JUMPI` -Conditionally jump to a location in the bytecode - -[See in table.](#isa-table-jumpi) - -- **Opcode**: 0x1c -- **Category**: Machine State - Control Flow -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **loc**: target location conditionally jump to - - **condOffset**: memory offset of the operations 'conditional' input -- **Expression**: `context.machineState.pc = M[condOffset] > 0 ? loc : context.machineState.pc` -- **Details**: Target location is an immediate value (a constant in the bytecode). `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/JUMPI.png)](/img/protocol-specs/public-vm/bit-formats/JUMPI.png) - -### `INTERNALCALL` -Make an internal call. Push the current PC to the internal call stack and jump to the target location. - -[See in table.](#isa-table-internalcall) - -- **Opcode**: 0x1d -- **Category**: Machine State - Control Flow -- **Args**: - - **loc**: target location to jump/call to -- **Expression**: - -{`context.machineState.internalCallStack.push(context.machineState.pc) -context.machineState.pc = loc`} - -- **Details**: Target location is an immediate value (a constant in the bytecode). -- **Bit-size**: 48 - - -### `INTERNALRETURN` -Return from an internal call. Pop from the internal call stack and jump to the popped location. - -[See in table.](#isa-table-internalreturn) - -- **Opcode**: 0x1e -- **Category**: Machine State - Control Flow -- **Expression**: `context.machineState.pc = context.machineState.internalCallStack.pop()` -- **Bit-size**: 16 - -[![](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png)](/img/protocol-specs/public-vm/bit-formats/INTERNALRETURN.png) - -### `SET` -Set a memory word from a constant in the bytecode - -[See in table.](#isa-table-set) - -- **Opcode**: 0x1f -- **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. - - **inTag**: The [type/size](./memory-model#tags-and-tagged-memory) to check inputs against and tag the destination with. `field` type is NOT supported for SET. -- **Args**: - - **const**: an N-bit constant value from the bytecode to store in memory (any type except `field`) - - **dstOffset**: memory offset specifying where to store the constant -- **Expression**: `M[dstOffset] = const` -- **Details**: Set memory word at `dstOffset` to `const`'s immediate value. `const`'s bit-size (N) can be 8, 16, 32, 64, or 128 based on `inTag`. It _cannot be 254 (`field` type)_! -- **Tag updates**: `T[dstOffset] = inTag` -- **Bit-size**: 64+N - -[![](/img/protocol-specs/public-vm/bit-formats/SET.png)](/img/protocol-specs/public-vm/bit-formats/SET.png) - -### `MOV` -Move a word from source memory location to destination - -[See in table.](#isa-table-mov) - -- **Opcode**: 0x20 -- **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of word to move - - **dstOffset**: memory offset specifying where to store that word -- **Expression**: `M[dstOffset] = M[srcOffset]` -- **Tag updates**: `T[dstOffset] = T[srcOffset]` -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/MOV.png)](/img/protocol-specs/public-vm/bit-formats/MOV.png) - -### `CMOV` -Move a word (conditionally chosen) from one memory location to another (`d \= cond \> 0 ? a : b`) - -[See in table.](#isa-table-cmov) - -- **Opcode**: 0x21 -- **Category**: Machine State - Memory -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **aOffset**: memory offset of word 'a' to conditionally move - - **bOffset**: memory offset of word 'b' to conditionally move - - **condOffset**: memory offset of the operations 'conditional' input - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: `M[dstOffset] = M[condOffset] > 0 ? M[aOffset] : M[bOffset]` -- **Details**: One of two source memory locations is chosen based on the condition. `T[condOffset]` is not checked because the greater-than-zero suboperation is the same regardless of type. -- **Tag updates**: `T[dstOffset] = M[condOffset] > 0 ? T[aOffset] : T[bOffset]` -- **Bit-size**: 152 - -[![](/img/protocol-specs/public-vm/bit-formats/CMOV.png)](/img/protocol-specs/public-vm/bit-formats/CMOV.png) - -### `SLOAD` -Load a word from this contract's persistent public storage. Zero is loaded for unwritten slots. - -[See in table.](#isa-table-sload) - -- **Opcode**: 0x22 -- **Category**: World State - Public Storage -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **slotOffset**: memory offset of the storage slot to load from - - **dstOffset**: memory offset specifying where to store operation's result -- **Expression**: - -{`M[dstOffset] = S[M[slotOffset]]`} - -- **Details**: - -{`// Expression is shorthand for -leafIndex = hash(context.environment.address, M[slotOffset]) -exists = context.worldState.publicStorage.has(leafIndex) // exists == previously-written -if exists: - value = context.worldState.publicStorage.get(leafIndex: leafIndex) -else: - value = 0 -M[dstOffset] = value`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.publicStorageReads.append( - TracedStorageRead { - callPointer: context.environment.callPointer, - slot: M[slotOffset], - exists: exists, // defined above - value: value, // defined above - counter: ++context.worldStateAccessTrace.accessCounter, - } -)`} - -- **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree membership check -- **Tag updates**: `T[dstOffset] = field` -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/SLOAD.png)](/img/protocol-specs/public-vm/bit-formats/SLOAD.png) - -### `SSTORE` -Write a word to this contract's persistent public storage - -[See in table.](#isa-table-sstore) - -- **Opcode**: 0x23 -- **Category**: World State - Public Storage -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of the word to store - - **slotOffset**: memory offset containing the storage slot to store to -- **Expression**: - -{`S[M[slotOffset]] = M[srcOffset]`} - -- **Details**: - -{`// Expression is shorthand for -context.worldState.publicStorage.set({ - leafIndex: hash(context.environment.address, M[slotOffset]), - leaf: M[srcOffset], -})`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.publicStorageWrites.append( - TracedStorageWrite { - callPointer: context.environment.callPointer, - slot: M[slotOffset], - value: M[srcOffset], - counter: ++context.worldStateAccessTrace.accessCounter, - } -)`} - -- **Triggers downstream circuit operations**: Storage slot siloing (hash with contract address), public data tree update -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/SSTORE.png)](/img/protocol-specs/public-vm/bit-formats/SSTORE.png) - -### `NOTEHASHEXISTS` -Check whether a note hash exists in the note hash tree (as of the start of the current block) - -[See in table.](#isa-table-notehashexists) - -- **Opcode**: 0x24 -- **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **noteHashOffset**: memory offset of the note hash - - **leafIndexOffset**: memory offset of the leaf index - - **existsOffset**: memory offset specifying where to store operation's result (whether the note hash leaf exists) -- **Expression**: - -{`exists = context.worldState.noteHashes.has({ - leafIndex: M[leafIndexOffset] - leaf: hash(context.environment.address, M[noteHashOffset]), -}) -M[existsOffset] = exists`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.noteHashChecks.append( - TracedNoteHashCheck { - callPointer: context.environment.callPointer, - leafIndex: M[leafIndexOffset] - noteHash: M[noteHashOffset], - exists: exists, // defined above - counter: ++context.worldStateAccessTrace.accessCounter, - } -)`} - -- **Triggers downstream circuit operations**: Note hash siloing (hash with storage contract address), note hash tree membership check -- **Tag updates**: `T[existsOffset] = u8` -- **Bit-size**: 120 - - -### `EMITNOTEHASH` -Emit a new note hash to be inserted into the note hash tree - -[See in table.](#isa-table-emitnotehash) - -- **Opcode**: 0x25 -- **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **noteHashOffset**: memory offset of the note hash -- **Expression**: - -{`context.worldState.noteHashes.append( - hash(context.environment.address, M[noteHashOffset]) -)`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.noteHashes.append( - TracedNoteHash { - callPointer: context.environment.callPointer, - noteHash: M[noteHashOffset], // unsiloed note hash - counter: ++context.worldStateAccessTrace.accessCounter, - } -)`} - -- **Triggers downstream circuit operations**: Note hash siloing (hash with contract address), note hash tree insertion. -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png)](/img/protocol-specs/public-vm/bit-formats/EMITNOTEHASH.png) - -### `NULLIFIEREXISTS` -Check whether a nullifier exists in the nullifier tree (including nullifiers from earlier in the current transaction or from earlier in the current block) - -[See in table.](#isa-table-nullifierexists) - -- **Opcode**: 0x26 -- **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **nullifierOffset**: memory offset of the unsiloed nullifier - - **addressOffset**: memory offset of the storage address - - **existsOffset**: memory offset specifying where to store operation's result (whether the nullifier exists) -- **Expression**: - -{`exists = pendingNullifiers.has(M[addressOffset], M[nullifierOffset]) || context.worldState.nullifiers.has( - hash(M[addressOffset], M[nullifierOffset]) -) -M[existsOffset] = exists`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.nullifierChecks.append( - TracedNullifierCheck { - callPointer: context.environment.callPointer, - nullifier: M[nullifierOffset], - address: M[addressOffset], - exists: exists, // defined above - counter: ++context.worldStateAccessTrace.accessCounter, - } -)`} - -- **Triggers downstream circuit operations**: Nullifier siloing (hash with storage contract address), nullifier tree membership check -- **Tag updates**: `T[existsOffset] = u8` -- **Bit-size**: 120 - - -### `EMITNULLIFIER` -Emit a new nullifier to be inserted into the nullifier tree - -[See in table.](#isa-table-emitnullifier) - -- **Opcode**: 0x27 -- **Category**: World State - Notes & Nullifiers -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **nullifierOffset**: memory offset of nullifier -- **Expression**: - -{`context.worldState.nullifiers.append( - hash(context.environment.address, M[nullifierOffset]) -)`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.nullifiers.append( - TracedNullifier { - callPointer: context.environment.callPointer, - nullifier: M[nullifierOffset], // unsiloed nullifier - counter: ++context.worldStateAccessTrace.accessCounter, - } -)`} - -- **Triggers downstream circuit operations**: Nullifier siloing (hash with contract address), nullifier tree non-membership-check and insertion. -- **Bit-size**: 56 - -[![](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png)](/img/protocol-specs/public-vm/bit-formats/EMITNULLIFIER.png) - -### `L1TOL2MSGEXISTS` -Check if a message exists in the L1-to-L2 message tree - -[See in table.](#isa-table-l1tol2msgexists) - -- **Opcode**: 0x28 -- **Category**: World State - Messaging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **msgHashOffset**: memory offset of the message hash - - **msgLeafIndexOffset**: memory offset of the message's leaf index in the L1-to-L2 message tree - - **existsOffset**: memory offset specifying where to store operation's result (whether the message exists in the L1-to-L2 message tree) -- **Expression**: - -{`exists = context.worldState.l1ToL2Messages.has({ - leafIndex: M[msgLeafIndexOffset], leaf: M[msgHashOffset] -}) -M[existsOffset] = exists`} - -- **World State access tracing**: - -{`context.worldStateAccessTrace.l1ToL2MessagesChecks.append( - L1ToL2Message { - callPointer: context.environment.callPointer, - leafIndex: M[msgLeafIndexOffset], - msgHash: M[msgHashOffset], - exists: exists, // defined above - } -)`} - -- **Triggers downstream circuit operations**: L1-to-L2 message tree membership check -- **Tag updates**: - -{`T[existsOffset] = u8,`} - -- **Bit-size**: 120 - - -### `GETCONTRACTINSTANCE` -Copies contract instance data to memory - -[See in table.](#isa-table-getcontractinstance) - -- **Opcode**: 0x29 -- **Category**: Other -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **addressOffset**: memory offset of the contract instance address - - **dstOffset**: location to write the contract instance information to -- **Expression**: - -{`M[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = [ - instance_found_in_address, - instance.salt ?? 0, - instance.deployer ?? 0, - instance.contractClassId ?? 0, - instance.initializationHash ?? 0, - instance.portalContractAddress ?? 0, - instance.publicKeysHash ?? 0, -]`} - -- **Additional AVM circuit checks**: TO-DO -- **Triggers downstream circuit operations**: TO-DO -- **Tag updates**: T[dstOffset:dstOffset+CONTRACT_INSTANCE_SIZE+1] = field -- **Bit-size**: 88 - - -### `EMITUNENCRYPTEDLOG` -Emit an unencrypted log - -[See in table.](#isa-table-emitunencryptedlog) - -- **Opcode**: 0x2a -- **Category**: Accrued Substate - Logging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **logOffset**: memory offset of the data to log - - **logSizeOffset**: memory offset to number of words to log -- **Expression**: - -{`context.accruedSubstate.unencryptedLogs.append( - UnencryptedLog { - address: context.environment.address, - log: M[logOffset:logOffset+M[logSizeOffset]], - } -)`} - -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png)](/img/protocol-specs/public-vm/bit-formats/EMITUNENCRYPTEDLOG.png) - -### `SENDL2TOL1MSG` -Send an L2-to-L1 message - -[See in table.](#isa-table-sendl2tol1msg) - -- **Opcode**: 0x2b -- **Category**: Accrued Substate - Messaging -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **recipientOffset**: memory offset of the message recipient - - **contentOffset**: memory offset of the message content -- **Expression**: - -{`context.accruedSubstate.sentL2ToL1Messages.append( - SentL2ToL1Message { - address: context.environment.address, - recipient: M[recipientOffset], - message: M[contentOffset] - } -)`} - -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png)](/img/protocol-specs/public-vm/bit-formats/SENDL2TOL1MSG.png) - -### `CALL` -Call into another contract - -[See in table.](#isa-table-call) - -- **Opcode**: 0x2c -- **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee - - **addrOffset**: address of the contract to call - - **argsOffset**: memory offset to args (will become the callee's calldata) - - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata - - **retOffset**: destination memory offset specifying where to store the data returned from the callee - - **retSize**: number of words to copy from data returned by callee - - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) -- **Expression**: - -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } -chargeGas(context, - l2GasCost=M[instr.args.gasOffset], - daGasCost=M[instr.args.gasOffset+1]) -traceNestedCall(context, instr.args.addrOffset) -nestedContext = deriveContext(context, instr.args, isStaticCall=false) -execute(nestedContext) -updateContextAfterNestedCall(context, instr.args, nestedContext)`} - -- **Details**: Creates a new (nested) execution context and triggers execution within that context. - Execution proceeds in the nested context until it reaches a halt at which point - execution resumes in the current/calling context. - A non-existent contract or one with no code will return success. - ["Nested contract calls"](./nested-calls) provides a full explanation of this - instruction along with the shorthand used in the expression above. - The explanation includes details on charging gas for nested calls, - nested context derivation, world state tracing, and updating the parent context - after the nested call halts. -- **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` -- **Tag updates**: - -{`T[successOffset] = u8 -T[retOffset:retOffset+retSize] = field`} - -- **Bit-size**: 248 - -[![](/img/protocol-specs/public-vm/bit-formats/CALL.png)](/img/protocol-specs/public-vm/bit-formats/CALL.png) - -### `STATICCALL` -Call into another contract, disallowing World State and Accrued Substate modifications - -[See in table.](#isa-table-staticcall) - -- **Opcode**: 0x2d -- **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **gasOffset**: offset to two words containing `{l2GasLeft, daGasLeft}`: amount of gas to provide to the callee - - **addrOffset**: address of the contract to call - - **argsOffset**: memory offset to args (will become the callee's calldata) - - **argsSizeOffset**: memory offset for the number of words to pass via callee's calldata - - **retOffset**: destination memory offset specifying where to store the data returned from the callee - - **retSize**: number of words to copy from data returned by callee - - **successOffset**: destination memory offset specifying where to store the call's success (0: failure, 1: success) -- **Expression**: - -{`// instr.args are { gasOffset, addrOffset, argsOffset, retOffset, retSize } -chargeGas(context, - l2GasCost=M[instr.args.gasOffset], - daGasCost=M[instr.args.gasOffset+1]) -traceNestedCall(context, instr.args.addrOffset) -nestedContext = deriveContext(context, instr.args, isStaticCall=true -execute(nestedContext) -updateContextAfterNestedCall(context, instr.args, nestedContext)`} - -- **Details**: Same as `CALL`, but disallows World State and Accrued Substate modifications. - ["Nested contract calls"](./nested-calls) provides a full explanation of this - instruction along with the shorthand used in the expression above. - The explanation includes details on charging gas for nested calls, - nested context derivation, world state tracing, and updating the parent context - after the nested call halts. -- **Tag checks**: `T[gasOffset] == T[gasOffset+1] == T[gasOffset+2] == u32` -- **Tag updates**: - -{`T[successOffset] = u8 -T[retOffset:retOffset+retSize] = field`} - -- **Bit-size**: 248 - -[![](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png)](/img/protocol-specs/public-vm/bit-formats/STATICCALL.png) - -### `RETURN` -Halt execution within this context (without revert), optionally returning some data - -[See in table.](#isa-table-return) - -- **Opcode**: 0x2e -- **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **retOffset**: memory offset of first word to return - - **retSize**: number of words to return -- **Expression**: - -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] -halt`} - -- **Details**: Return control flow to the calling context/contract. Caller will accept World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/RETURN.png)](/img/protocol-specs/public-vm/bit-formats/RETURN.png) - -### `REVERT` -Halt execution within this context as `reverted`, optionally returning some data - -[See in table.](#isa-table-revert) - -- **Opcode**: 0x2f -- **Category**: Control Flow - Contract Calls -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **retOffset**: memory offset of first word to return - - **retSize**: number of words to return -- **Expression**: - -{`context.contractCallResults.output = M[retOffset:retOffset+retSize] -context.contractCallResults.reverted = true -halt`} - -- **Details**: Return control flow to the calling context/contract. Caller will reject World State and Accrued Substate modifications. See ["Halting"](./execution#halting) to learn more. See ["Nested contract calls"](./nested-calls) to see how the caller updates its context after the nested call halts. -- **Bit-size**: 88 - -[![](/img/protocol-specs/public-vm/bit-formats/REVERT.png)](/img/protocol-specs/public-vm/bit-formats/REVERT.png) - -### `TORADIXLE` -Convert a word to an array of limbs in little-endian radix form - -[See in table.](#isa-table-to_radix_le) - -- **Opcode**: 0x30 -- **Category**: Conversions -- **Flags**: - - **indirect**: Toggles whether each memory-offset argument is an indirect offset. Rightmost bit corresponds to 0th offset arg, etc. Indirect offsets result in memory accesses like `M[M[offset]]` instead of the more standard `M[offset]`. -- **Args**: - - **srcOffset**: memory offset of word to convert. - - **dstOffset**: memory offset specifying where the first limb of the radix-conversion result is stored. - - **radix**: the maximum bit-size of each limb. - - **numLimbs**: the number of limbs the word will be converted into. -- **Expression**: TBD: Storage of limbs and if T[dstOffset] is constrained to U8 -- **Details**: The limbs will be stored in a contiguous memory block starting at `dstOffset`. -- **Tag checks**: `T[srcOffset] == field` -- **Bit-size**: 152 - diff --git a/docs/docs/_protocol-specs/addresses-and-keys/address.md b/docs/docs/protocol-specs/addresses-and-keys/address.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/address.md rename to docs/docs/protocol-specs/addresses-and-keys/address.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/diversified-and-stealth.md b/docs/docs/protocol-specs/addresses-and-keys/diversified-and-stealth.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/diversified-and-stealth.md rename to docs/docs/protocol-specs/addresses-and-keys/diversified-and-stealth.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md b/docs/docs/protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md rename to docs/docs/protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md b/docs/docs/protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md rename to docs/docs/protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/example-usage/nullifier.md b/docs/docs/protocol-specs/addresses-and-keys/example-usage/nullifier.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/example-usage/nullifier.md rename to docs/docs/protocol-specs/addresses-and-keys/example-usage/nullifier.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md b/docs/docs/protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md rename to docs/docs/protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/index.md b/docs/docs/protocol-specs/addresses-and-keys/index.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/index.md rename to docs/docs/protocol-specs/addresses-and-keys/index.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/keys-requirements.md b/docs/docs/protocol-specs/addresses-and-keys/keys-requirements.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/keys-requirements.md rename to docs/docs/protocol-specs/addresses-and-keys/keys-requirements.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/keys.md b/docs/docs/protocol-specs/addresses-and-keys/keys.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/keys.md rename to docs/docs/protocol-specs/addresses-and-keys/keys.md diff --git a/docs/docs/_protocol-specs/addresses-and-keys/precompiles.md b/docs/docs/protocol-specs/addresses-and-keys/precompiles.md similarity index 100% rename from docs/docs/_protocol-specs/addresses-and-keys/precompiles.md rename to docs/docs/protocol-specs/addresses-and-keys/precompiles.md diff --git a/docs/docs/_protocol-specs/bytecode/index.md b/docs/docs/protocol-specs/bytecode/index.md similarity index 100% rename from docs/docs/_protocol-specs/bytecode/index.md rename to docs/docs/protocol-specs/bytecode/index.md diff --git a/docs/docs/_protocol-specs/calls/batched-calls.md b/docs/docs/protocol-specs/calls/batched-calls.md similarity index 100% rename from docs/docs/_protocol-specs/calls/batched-calls.md rename to docs/docs/protocol-specs/calls/batched-calls.md diff --git a/docs/docs/_protocol-specs/calls/enqueued-calls.md b/docs/docs/protocol-specs/calls/enqueued-calls.md similarity index 100% rename from docs/docs/_protocol-specs/calls/enqueued-calls.md rename to docs/docs/protocol-specs/calls/enqueued-calls.md diff --git a/docs/docs/_protocol-specs/calls/index.md b/docs/docs/protocol-specs/calls/index.md similarity index 100% rename from docs/docs/_protocol-specs/calls/index.md rename to docs/docs/protocol-specs/calls/index.md diff --git a/docs/docs/_protocol-specs/calls/public-private-messaging.md b/docs/docs/protocol-specs/calls/public-private-messaging.md similarity index 100% rename from docs/docs/_protocol-specs/calls/public-private-messaging.md rename to docs/docs/protocol-specs/calls/public-private-messaging.md diff --git a/docs/docs/_protocol-specs/calls/static-calls.md b/docs/docs/protocol-specs/calls/static-calls.md similarity index 100% rename from docs/docs/_protocol-specs/calls/static-calls.md rename to docs/docs/protocol-specs/calls/static-calls.md diff --git a/docs/docs/_protocol-specs/calls/sync-calls.md b/docs/docs/protocol-specs/calls/sync-calls.md similarity index 100% rename from docs/docs/_protocol-specs/calls/sync-calls.md rename to docs/docs/protocol-specs/calls/sync-calls.md diff --git a/docs/docs/_protocol-specs/calls/unconstrained-calls.md b/docs/docs/protocol-specs/calls/unconstrained-calls.md similarity index 100% rename from docs/docs/_protocol-specs/calls/unconstrained-calls.md rename to docs/docs/protocol-specs/calls/unconstrained-calls.md diff --git a/docs/docs/_protocol-specs/circuits/high-level-topology.md b/docs/docs/protocol-specs/circuits/high-level-topology.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/high-level-topology.md rename to docs/docs/protocol-specs/circuits/high-level-topology.md diff --git a/docs/docs/_protocol-specs/circuits/private-function.md b/docs/docs/protocol-specs/circuits/private-function.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/private-function.md rename to docs/docs/protocol-specs/circuits/private-function.md diff --git a/docs/docs/_protocol-specs/circuits/private-kernel-initial.mdx b/docs/docs/protocol-specs/circuits/private-kernel-initial.mdx similarity index 100% rename from docs/docs/_protocol-specs/circuits/private-kernel-initial.mdx rename to docs/docs/protocol-specs/circuits/private-kernel-initial.mdx diff --git a/docs/docs/_protocol-specs/circuits/private-kernel-inner.mdx b/docs/docs/protocol-specs/circuits/private-kernel-inner.mdx similarity index 100% rename from docs/docs/_protocol-specs/circuits/private-kernel-inner.mdx rename to docs/docs/protocol-specs/circuits/private-kernel-inner.mdx diff --git a/docs/docs/_protocol-specs/circuits/private-kernel-reset.md b/docs/docs/protocol-specs/circuits/private-kernel-reset.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/private-kernel-reset.md rename to docs/docs/protocol-specs/circuits/private-kernel-reset.md diff --git a/docs/docs/_protocol-specs/circuits/private-kernel-tail.md b/docs/docs/protocol-specs/circuits/private-kernel-tail.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/private-kernel-tail.md rename to docs/docs/protocol-specs/circuits/private-kernel-tail.md diff --git a/docs/docs/_protocol-specs/circuits/public-kernel-initial.md b/docs/docs/protocol-specs/circuits/public-kernel-initial.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/public-kernel-initial.md rename to docs/docs/protocol-specs/circuits/public-kernel-initial.md diff --git a/docs/docs/_protocol-specs/circuits/public-kernel-inner.md b/docs/docs/protocol-specs/circuits/public-kernel-inner.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/public-kernel-inner.md rename to docs/docs/protocol-specs/circuits/public-kernel-inner.md diff --git a/docs/docs/_protocol-specs/circuits/public-kernel-tail.md b/docs/docs/protocol-specs/circuits/public-kernel-tail.md similarity index 100% rename from docs/docs/_protocol-specs/circuits/public-kernel-tail.md rename to docs/docs/protocol-specs/circuits/public-kernel-tail.md diff --git a/docs/docs/_protocol-specs/constants.md b/docs/docs/protocol-specs/constants.md similarity index 100% rename from docs/docs/_protocol-specs/constants.md rename to docs/docs/protocol-specs/constants.md diff --git a/docs/docs/_protocol-specs/contract-deployment/classes.md b/docs/docs/protocol-specs/contract-deployment/classes.md similarity index 100% rename from docs/docs/_protocol-specs/contract-deployment/classes.md rename to docs/docs/protocol-specs/contract-deployment/classes.md diff --git a/docs/docs/_protocol-specs/contract-deployment/index.md b/docs/docs/protocol-specs/contract-deployment/index.md similarity index 100% rename from docs/docs/_protocol-specs/contract-deployment/index.md rename to docs/docs/protocol-specs/contract-deployment/index.md diff --git a/docs/docs/_protocol-specs/contract-deployment/instances.md b/docs/docs/protocol-specs/contract-deployment/instances.md similarity index 100% rename from docs/docs/_protocol-specs/contract-deployment/instances.md rename to docs/docs/protocol-specs/contract-deployment/instances.md diff --git a/docs/docs/_protocol-specs/cryptography/hashing/hashing.md b/docs/docs/protocol-specs/cryptography/hashing/hashing.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/hashing/hashing.md rename to docs/docs/protocol-specs/cryptography/hashing/hashing.md diff --git a/docs/docs/_protocol-specs/cryptography/hashing/pedersen.md b/docs/docs/protocol-specs/cryptography/hashing/pedersen.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/hashing/pedersen.md rename to docs/docs/protocol-specs/cryptography/hashing/pedersen.md diff --git a/docs/docs/_protocol-specs/cryptography/hashing/poseidon2.md b/docs/docs/protocol-specs/cryptography/hashing/poseidon2.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/hashing/poseidon2.md rename to docs/docs/protocol-specs/cryptography/hashing/poseidon2.md diff --git a/docs/docs/_protocol-specs/cryptography/index.md b/docs/docs/protocol-specs/cryptography/index.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/index.md rename to docs/docs/protocol-specs/cryptography/index.md diff --git a/docs/docs/_protocol-specs/cryptography/merkle-trees.md b/docs/docs/protocol-specs/cryptography/merkle-trees.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/merkle-trees.md rename to docs/docs/protocol-specs/cryptography/merkle-trees.md diff --git a/docs/docs/_protocol-specs/cryptography/proving-system/data-bus.md b/docs/docs/protocol-specs/cryptography/proving-system/data-bus.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/proving-system/data-bus.md rename to docs/docs/protocol-specs/cryptography/proving-system/data-bus.md diff --git a/docs/docs/_protocol-specs/cryptography/proving-system/overview.md b/docs/docs/protocol-specs/cryptography/proving-system/overview.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/proving-system/overview.md rename to docs/docs/protocol-specs/cryptography/proving-system/overview.md diff --git a/docs/docs/_protocol-specs/cryptography/proving-system/performance-targets.md b/docs/docs/protocol-specs/cryptography/proving-system/performance-targets.md similarity index 100% rename from docs/docs/_protocol-specs/cryptography/proving-system/performance-targets.md rename to docs/docs/protocol-specs/cryptography/proving-system/performance-targets.md diff --git a/docs/docs/_protocol-specs/data-publication-and-availability/index.md b/docs/docs/protocol-specs/data-publication-and-availability/index.md similarity index 100% rename from docs/docs/_protocol-specs/data-publication-and-availability/index.md rename to docs/docs/protocol-specs/data-publication-and-availability/index.md diff --git a/docs/docs/_protocol-specs/data-publication-and-availability/overview.md b/docs/docs/protocol-specs/data-publication-and-availability/overview.md similarity index 100% rename from docs/docs/_protocol-specs/data-publication-and-availability/overview.md rename to docs/docs/protocol-specs/data-publication-and-availability/overview.md diff --git a/docs/docs/_protocol-specs/data-publication-and-availability/published-data.md b/docs/docs/protocol-specs/data-publication-and-availability/published-data.md similarity index 100% rename from docs/docs/_protocol-specs/data-publication-and-availability/published-data.md rename to docs/docs/protocol-specs/data-publication-and-availability/published-data.md diff --git a/docs/docs/_protocol-specs/decentralization/actors.md b/docs/docs/protocol-specs/decentralization/actors.md similarity index 100% rename from docs/docs/_protocol-specs/decentralization/actors.md rename to docs/docs/protocol-specs/decentralization/actors.md diff --git a/docs/docs/_protocol-specs/decentralization/block-production.md b/docs/docs/protocol-specs/decentralization/block-production.md similarity index 100% rename from docs/docs/_protocol-specs/decentralization/block-production.md rename to docs/docs/protocol-specs/decentralization/block-production.md diff --git a/docs/docs/_protocol-specs/decentralization/governance.md b/docs/docs/protocol-specs/decentralization/governance.md similarity index 100% rename from docs/docs/_protocol-specs/decentralization/governance.md rename to docs/docs/protocol-specs/decentralization/governance.md diff --git a/docs/docs/_protocol-specs/decentralization/p2p-network.md b/docs/docs/protocol-specs/decentralization/p2p-network.md similarity index 100% rename from docs/docs/_protocol-specs/decentralization/p2p-network.md rename to docs/docs/protocol-specs/decentralization/p2p-network.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/fee-juice.md b/docs/docs/protocol-specs/gas-and-fees/fee-juice.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/fee-juice.md rename to docs/docs/protocol-specs/gas-and-fees/fee-juice.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/fee-schedule.md b/docs/docs/protocol-specs/gas-and-fees/fee-schedule.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/fee-schedule.md rename to docs/docs/protocol-specs/gas-and-fees/fee-schedule.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/index.md b/docs/docs/protocol-specs/gas-and-fees/index.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/index.md rename to docs/docs/protocol-specs/gas-and-fees/index.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/kernel-tracking.md b/docs/docs/protocol-specs/gas-and-fees/kernel-tracking.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/kernel-tracking.md rename to docs/docs/protocol-specs/gas-and-fees/kernel-tracking.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/published-gas-and-fee-data.md b/docs/docs/protocol-specs/gas-and-fees/published-gas-and-fee-data.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/published-gas-and-fee-data.md rename to docs/docs/protocol-specs/gas-and-fees/published-gas-and-fee-data.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/specifying-gas-fee-info.md b/docs/docs/protocol-specs/gas-and-fees/specifying-gas-fee-info.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/specifying-gas-fee-info.md rename to docs/docs/protocol-specs/gas-and-fees/specifying-gas-fee-info.md diff --git a/docs/docs/_protocol-specs/gas-and-fees/tx-setup-and-teardown.md b/docs/docs/protocol-specs/gas-and-fees/tx-setup-and-teardown.md similarity index 100% rename from docs/docs/_protocol-specs/gas-and-fees/tx-setup-and-teardown.md rename to docs/docs/protocol-specs/gas-and-fees/tx-setup-and-teardown.md diff --git a/docs/docs/_protocol-specs/intro.md b/docs/docs/protocol-specs/intro.md similarity index 100% rename from docs/docs/_protocol-specs/intro.md rename to docs/docs/protocol-specs/intro.md diff --git a/docs/docs/_protocol-specs/l1-smart-contracts/frontier.md b/docs/docs/protocol-specs/l1-smart-contracts/frontier.md similarity index 100% rename from docs/docs/_protocol-specs/l1-smart-contracts/frontier.md rename to docs/docs/protocol-specs/l1-smart-contracts/frontier.md diff --git a/docs/docs/_protocol-specs/l1-smart-contracts/index.md b/docs/docs/protocol-specs/l1-smart-contracts/index.md similarity index 100% rename from docs/docs/_protocol-specs/l1-smart-contracts/index.md rename to docs/docs/protocol-specs/l1-smart-contracts/index.md diff --git a/docs/docs/_protocol-specs/logs/index.md b/docs/docs/protocol-specs/logs/index.md similarity index 100% rename from docs/docs/_protocol-specs/logs/index.md rename to docs/docs/protocol-specs/logs/index.md diff --git a/docs/docs/_protocol-specs/pre-compiled-contracts/index.md b/docs/docs/protocol-specs/pre-compiled-contracts/index.md similarity index 100% rename from docs/docs/_protocol-specs/pre-compiled-contracts/index.md rename to docs/docs/protocol-specs/pre-compiled-contracts/index.md diff --git a/docs/docs/_protocol-specs/pre-compiled-contracts/registry.md b/docs/docs/protocol-specs/pre-compiled-contracts/registry.md similarity index 100% rename from docs/docs/_protocol-specs/pre-compiled-contracts/registry.md rename to docs/docs/protocol-specs/pre-compiled-contracts/registry.md diff --git a/docs/docs/_protocol-specs/private-message-delivery/index.md b/docs/docs/protocol-specs/private-message-delivery/index.md similarity index 100% rename from docs/docs/_protocol-specs/private-message-delivery/index.md rename to docs/docs/protocol-specs/private-message-delivery/index.md diff --git a/docs/docs/_protocol-specs/private-message-delivery/private-msg-delivery.md b/docs/docs/protocol-specs/private-message-delivery/private-msg-delivery.md similarity index 100% rename from docs/docs/_protocol-specs/private-message-delivery/private-msg-delivery.md rename to docs/docs/protocol-specs/private-message-delivery/private-msg-delivery.md diff --git a/docs/docs/_protocol-specs/private-message-delivery/send-note-guidelines.md b/docs/docs/protocol-specs/private-message-delivery/send-note-guidelines.md similarity index 100% rename from docs/docs/_protocol-specs/private-message-delivery/send-note-guidelines.md rename to docs/docs/protocol-specs/private-message-delivery/send-note-guidelines.md diff --git a/docs/docs/_protocol-specs/public-vm/_nested-context.md b/docs/docs/protocol-specs/public-vm/_nested-context.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/_nested-context.md rename to docs/docs/protocol-specs/public-vm/_nested-context.md diff --git a/docs/docs/_protocol-specs/public-vm/alu.md b/docs/docs/protocol-specs/public-vm/alu.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/alu.md rename to docs/docs/protocol-specs/public-vm/alu.md diff --git a/docs/docs/_protocol-specs/public-vm/avm-circuit.md b/docs/docs/protocol-specs/public-vm/avm-circuit.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/avm-circuit.md rename to docs/docs/protocol-specs/public-vm/avm-circuit.md diff --git a/docs/docs/_protocol-specs/public-vm/bytecode-validation-circuit.md b/docs/docs/protocol-specs/public-vm/bytecode-validation-circuit.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/bytecode-validation-circuit.md rename to docs/docs/protocol-specs/public-vm/bytecode-validation-circuit.md diff --git a/docs/docs/_protocol-specs/public-vm/circuit-index.md b/docs/docs/protocol-specs/public-vm/circuit-index.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/circuit-index.md rename to docs/docs/protocol-specs/public-vm/circuit-index.md diff --git a/docs/docs/_protocol-specs/public-vm/context.mdx b/docs/docs/protocol-specs/public-vm/context.mdx similarity index 100% rename from docs/docs/_protocol-specs/public-vm/context.mdx rename to docs/docs/protocol-specs/public-vm/context.mdx diff --git a/docs/docs/_protocol-specs/public-vm/control-flow.md b/docs/docs/protocol-specs/public-vm/control-flow.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/control-flow.md rename to docs/docs/protocol-specs/public-vm/control-flow.md diff --git a/docs/docs/_protocol-specs/public-vm/execution.md b/docs/docs/protocol-specs/public-vm/execution.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/execution.md rename to docs/docs/protocol-specs/public-vm/execution.md diff --git a/docs/docs/_protocol-specs/public-vm/index.md b/docs/docs/protocol-specs/public-vm/index.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/index.md rename to docs/docs/protocol-specs/public-vm/index.md diff --git a/docs/docs/_protocol-specs/public-vm/instruction-set.mdx b/docs/docs/protocol-specs/public-vm/instruction-set.mdx similarity index 100% rename from docs/docs/_protocol-specs/public-vm/instruction-set.mdx rename to docs/docs/protocol-specs/public-vm/instruction-set.mdx diff --git a/docs/docs/_protocol-specs/public-vm/intro.md b/docs/docs/protocol-specs/public-vm/intro.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/intro.md rename to docs/docs/protocol-specs/public-vm/intro.md diff --git a/docs/docs/_protocol-specs/public-vm/memory-model.md b/docs/docs/protocol-specs/public-vm/memory-model.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/memory-model.md rename to docs/docs/protocol-specs/public-vm/memory-model.md diff --git a/docs/docs/_protocol-specs/public-vm/nested-calls.mdx b/docs/docs/protocol-specs/public-vm/nested-calls.mdx similarity index 100% rename from docs/docs/_protocol-specs/public-vm/nested-calls.mdx rename to docs/docs/protocol-specs/public-vm/nested-calls.mdx diff --git a/docs/docs/_protocol-specs/public-vm/security.md b/docs/docs/protocol-specs/public-vm/security.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/security.md rename to docs/docs/protocol-specs/public-vm/security.md diff --git a/docs/docs/_protocol-specs/public-vm/state.md b/docs/docs/protocol-specs/public-vm/state.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/state.md rename to docs/docs/protocol-specs/public-vm/state.md diff --git a/docs/docs/_protocol-specs/public-vm/type-structs.md b/docs/docs/protocol-specs/public-vm/type-structs.md similarity index 100% rename from docs/docs/_protocol-specs/public-vm/type-structs.md rename to docs/docs/protocol-specs/public-vm/type-structs.md diff --git a/docs/docs/_protocol-specs/rollup-circuits/base-rollup.md b/docs/docs/protocol-specs/rollup-circuits/base-rollup.md similarity index 100% rename from docs/docs/_protocol-specs/rollup-circuits/base-rollup.md rename to docs/docs/protocol-specs/rollup-circuits/base-rollup.md diff --git a/docs/docs/_protocol-specs/rollup-circuits/index.md b/docs/docs/protocol-specs/rollup-circuits/index.md similarity index 100% rename from docs/docs/_protocol-specs/rollup-circuits/index.md rename to docs/docs/protocol-specs/rollup-circuits/index.md diff --git a/docs/docs/_protocol-specs/rollup-circuits/merge-rollup.md b/docs/docs/protocol-specs/rollup-circuits/merge-rollup.md similarity index 100% rename from docs/docs/_protocol-specs/rollup-circuits/merge-rollup.md rename to docs/docs/protocol-specs/rollup-circuits/merge-rollup.md diff --git a/docs/docs/_protocol-specs/rollup-circuits/root-rollup.md b/docs/docs/protocol-specs/rollup-circuits/root-rollup.md similarity index 100% rename from docs/docs/_protocol-specs/rollup-circuits/root-rollup.md rename to docs/docs/protocol-specs/rollup-circuits/root-rollup.md diff --git a/docs/docs/_protocol-specs/rollup-circuits/tree-parity.md b/docs/docs/protocol-specs/rollup-circuits/tree-parity.md similarity index 100% rename from docs/docs/_protocol-specs/rollup-circuits/tree-parity.md rename to docs/docs/protocol-specs/rollup-circuits/tree-parity.md diff --git a/docs/docs/_protocol-specs/state/archive.md b/docs/docs/protocol-specs/state/archive.md similarity index 100% rename from docs/docs/_protocol-specs/state/archive.md rename to docs/docs/protocol-specs/state/archive.md diff --git a/docs/docs/_protocol-specs/state/index.md b/docs/docs/protocol-specs/state/index.md similarity index 100% rename from docs/docs/_protocol-specs/state/index.md rename to docs/docs/protocol-specs/state/index.md diff --git a/docs/docs/_protocol-specs/state/note-hash-tree.md b/docs/docs/protocol-specs/state/note-hash-tree.md similarity index 100% rename from docs/docs/_protocol-specs/state/note-hash-tree.md rename to docs/docs/protocol-specs/state/note-hash-tree.md diff --git a/docs/docs/_protocol-specs/state/nullifier-tree.md b/docs/docs/protocol-specs/state/nullifier-tree.md similarity index 100% rename from docs/docs/_protocol-specs/state/nullifier-tree.md rename to docs/docs/protocol-specs/state/nullifier-tree.md diff --git a/docs/docs/_protocol-specs/state/public-data-tree.md b/docs/docs/protocol-specs/state/public-data-tree.md similarity index 100% rename from docs/docs/_protocol-specs/state/public-data-tree.md rename to docs/docs/protocol-specs/state/public-data-tree.md diff --git a/docs/docs/_protocol-specs/state/tree-implementations.md b/docs/docs/protocol-specs/state/tree-implementations.md similarity index 100% rename from docs/docs/_protocol-specs/state/tree-implementations.md rename to docs/docs/protocol-specs/state/tree-implementations.md diff --git a/docs/docs/_protocol-specs/state/wonky-tree.md b/docs/docs/protocol-specs/state/wonky-tree.md similarity index 100% rename from docs/docs/_protocol-specs/state/wonky-tree.md rename to docs/docs/protocol-specs/state/wonky-tree.md diff --git a/docs/docs/_protocol-specs/todo.md b/docs/docs/protocol-specs/todo.md similarity index 100% rename from docs/docs/_protocol-specs/todo.md rename to docs/docs/protocol-specs/todo.md diff --git a/docs/docs/_protocol-specs/transactions/index.md b/docs/docs/protocol-specs/transactions/index.md similarity index 100% rename from docs/docs/_protocol-specs/transactions/index.md rename to docs/docs/protocol-specs/transactions/index.md diff --git a/docs/docs/_protocol-specs/transactions/local-execution.md b/docs/docs/protocol-specs/transactions/local-execution.md similarity index 100% rename from docs/docs/_protocol-specs/transactions/local-execution.md rename to docs/docs/protocol-specs/transactions/local-execution.md diff --git a/docs/docs/_protocol-specs/transactions/public-execution.md b/docs/docs/protocol-specs/transactions/public-execution.md similarity index 100% rename from docs/docs/_protocol-specs/transactions/public-execution.md rename to docs/docs/protocol-specs/transactions/public-execution.md diff --git a/docs/docs/_protocol-specs/transactions/tx-object.md b/docs/docs/protocol-specs/transactions/tx-object.md similarity index 100% rename from docs/docs/_protocol-specs/transactions/tx-object.md rename to docs/docs/protocol-specs/transactions/tx-object.md diff --git a/docs/docs/_protocol-specs/transactions/validity.md b/docs/docs/protocol-specs/transactions/validity.md similarity index 100% rename from docs/docs/_protocol-specs/transactions/validity.md rename to docs/docs/protocol-specs/transactions/validity.md diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index df9dff30a4d1..16f8a9101de8 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -55,7 +55,10 @@ const config = { ); }, routeBasePath: "/", - include: ["**/*.{md,mdx}"], + include: process.env.SHOW_PROTOCOL_SPECS + ? ['**/*.{md,mdx}'] + : ['**/*.{md,mdx}', '!protocol-specs/**'], + remarkPlugins: [math], rehypePlugins: [ [ @@ -298,6 +301,13 @@ const config = { label: "Roadmap", className: "no-external-icon", }, + ...(process.env.SHOW_PROTOCOL_SPECS ? + [{ + type: "docSidebar", + sidebarId: "protocolSpecSidebar", + label: "Protocol Specification", + className: "no-external-icon", + }] : []), { to: "https://noir-lang.org/docs", label: "Noir docs", diff --git a/docs/package.json b/docs/package.json index e77327e3822a..87112cc38a02 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,8 +4,8 @@ "private": true, "scripts": { "docs": "yarn preprocess && yarn typedoc && docusaurus start --host ${HOST:-localhost}", - "dev": "HOST=0.0.0.0 ENV=dev yarn docs", - "dev:local": "ENV=dev yarn docs", + "dev": "HOST=0.0.0.0 ENV=dev SHOW_PROTOCOL_SPECS=true yarn docs", + "dev:local": "ENV=dev SHOW_PROTOCOL_SPECS=true yarn docs", "build": "./scripts/build.sh", "swizzle": "docusaurus swizzle", "clean": "./scripts/clean.sh", diff --git a/docs/sidebars.js b/docs/sidebars.js index 3c6fd4f846de..ae40d1e6a513 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -168,4 +168,226 @@ export default { dirName: "aztec/roadmap", }, ], + + ...(process.env.SHOW_PROTOCOL_SPECS ? { + protocolSpecSidebar: [ + "protocol-specs/intro", + { + label: "Cryptography", + type: "category", + link: { type: "doc", id: "protocol-specs/cryptography/index" }, + items: [ + { + label: "Proving System", + type: "category", + items: [ + "protocol-specs/cryptography/proving-system/performance-targets", + "protocol-specs/cryptography/proving-system/overview", + "protocol-specs/cryptography/proving-system/data-bus", + ], + }, + { + label: "Hashing", + type: "category", + items: [ + "protocol-specs/cryptography/hashing/hashing", + "protocol-specs/cryptography/hashing/poseidon2", + "protocol-specs/cryptography/hashing/pedersen", + ], + }, + "protocol-specs/cryptography/merkle-trees", + ], + }, + { + label: "Addresses & Keys", + type: "category", + link: { type: "doc", id: "protocol-specs/addresses-and-keys/index" }, + items: [ + "protocol-specs/addresses-and-keys/address", + "protocol-specs/addresses-and-keys/keys-requirements", + "protocol-specs/addresses-and-keys/keys", + { + label: "Example Usage of Keys", + type: "category", + items: [ + "protocol-specs/addresses-and-keys/example-usage/nullifier", + "protocol-specs/addresses-and-keys/example-usage/diversified-and-stealth-keys", + "protocol-specs/addresses-and-keys/example-usage/tag-sequence-derivation", + "protocol-specs/addresses-and-keys/example-usage/encrypt-and-tag", + ], + }, + "protocol-specs/addresses-and-keys/precompiles", + "protocol-specs/addresses-and-keys/diversified-and-stealth", + ], + }, + { + label: "State", + type: "category", + link: { type: "doc", id: "protocol-specs/state/index" }, + items: [ + "protocol-specs/state/tree-implementations", + "protocol-specs/state/archive", + "protocol-specs/state/note-hash-tree", + "protocol-specs/state/nullifier-tree", + "protocol-specs/state/public-data-tree", + "protocol-specs/state/wonky-tree", + ], + }, + { + label: "Transactions", + type: "category", + link: { type: "doc", id: "protocol-specs/transactions/index" }, + items: [ + "protocol-specs/transactions/local-execution", + "protocol-specs/transactions/public-execution", + "protocol-specs/transactions/tx-object", + "protocol-specs/transactions/validity", + ], + }, + { + label: "Bytecode", + type: "category", + link: { type: "doc", id: "protocol-specs/bytecode/index" }, + items: [], + }, + { + label: "Contract Deployment", + type: "category", + link: { type: "doc", id: "protocol-specs/contract-deployment/index" }, + items: [ + "protocol-specs/contract-deployment/classes", + "protocol-specs/contract-deployment/instances", + ], + }, + { + label: "Calls", + type: "category", + link: { type: "doc", id: "protocol-specs/calls/index" }, + items: [ + "protocol-specs/calls/sync-calls", + "protocol-specs/calls/enqueued-calls", + "protocol-specs/calls/batched-calls", + "protocol-specs/calls/static-calls", + "protocol-specs/calls/unconstrained-calls", + "protocol-specs/calls/public-private-messaging", + ], + }, + { + label: "L1 smart contracts", + type: "category", + link: { type: "doc", id: "protocol-specs/l1-smart-contracts/index" }, + items: ["protocol-specs/l1-smart-contracts/frontier"], + }, + { + label: "Data availability", + type: "category", + link: { + type: "doc", + id: "protocol-specs/data-publication-and-availability/index", + }, + items: [ + "protocol-specs/data-publication-and-availability/overview", + "protocol-specs/data-publication-and-availability/published-data", + ], + }, + { + label: "Logs", + type: "category", + link: { type: "doc", id: "protocol-specs/logs/index" }, + items: [], + }, + { + label: "Pre-compiled Contracts", + type: "category", + link: { type: "doc", id: "protocol-specs/pre-compiled-contracts/index" }, + items: ["protocol-specs/pre-compiled-contracts/registry"], + }, + { + label: "Private Message Delivery", + type: "category", + link: { + type: "doc", + id: "protocol-specs/private-message-delivery/index", + }, + items: [ + "protocol-specs/private-message-delivery/private-msg-delivery", // renamed to avoid routing problems + "protocol-specs/private-message-delivery/send-note-guidelines", + ], + }, + { + label: "Gas & Fees", + type: "category", + link: { type: "doc", id: "protocol-specs/gas-and-fees/index" }, + items: [ + "protocol-specs/gas-and-fees/fee-juice", + "protocol-specs/gas-and-fees/specifying-gas-fee-info", + "protocol-specs/gas-and-fees/tx-setup-and-teardown", + "protocol-specs/gas-and-fees/kernel-tracking", + "protocol-specs/gas-and-fees/fee-schedule", + "protocol-specs/gas-and-fees/published-gas-and-fee-data", + ], + }, + { + label: "Decentralization", + type: "category", + items: [ + "protocol-specs/decentralization/actors", + "protocol-specs/decentralization/governance", + "protocol-specs/decentralization/block-production", + "protocol-specs/decentralization/p2p-network", + ], + }, + { + label: "Circuits", + type: "category", + link: { type: "doc", id: "protocol-specs/circuits/high-level-topology" }, + items: [ + "protocol-specs/circuits/private-function", + "protocol-specs/circuits/private-kernel-initial", + "protocol-specs/circuits/private-kernel-inner", + "protocol-specs/circuits/private-kernel-reset", + "protocol-specs/circuits/private-kernel-tail", + "protocol-specs/circuits/public-kernel-initial", + "protocol-specs/circuits/public-kernel-inner", + "protocol-specs/circuits/public-kernel-tail", + ], + }, + { + label: "Rollup Circuits", + type: "category", + link: { type: "doc", id: "protocol-specs/rollup-circuits/index" }, + items: [ + "protocol-specs/rollup-circuits/base-rollup", + "protocol-specs/rollup-circuits/merge-rollup", + "protocol-specs/rollup-circuits/tree-parity", + "protocol-specs/rollup-circuits/root-rollup", + ], + }, + { + label: "Aztec (Public) VM", + type: "category", + link: { type: "doc", id: "protocol-specs/public-vm/index" }, + items: [ + "protocol-specs/public-vm/intro", + "protocol-specs/public-vm/state", + "protocol-specs/public-vm/memory-model", + "protocol-specs/public-vm/context", + "protocol-specs/public-vm/execution", + "protocol-specs/public-vm/nested-calls", + "protocol-specs/public-vm/instruction-set", + { + label: "AVM Circuit", + type: "category", + link: { type: "doc", id: "protocol-specs/public-vm/circuit-index" }, + items: [ + "protocol-specs/public-vm/avm-circuit", + "protocol-specs/public-vm/control-flow", + "protocol-specs/public-vm/alu", + "protocol-specs/public-vm/bytecode-validation-circuit", + ], + }, + "protocol-specs/public-vm/type-structs", + ], + }, + ]}: {}), };