# Opcodes

The following lists show the standard and cryptographic opcodes supported by Beo instructions.

### Table of Standard Opcodes[​](https://developer.aleo.org/guides/aleo/opcodes#table-of-standard-opcodes) <a href="#table-of-standard-opcodes" id="table-of-standard-opcodes"></a>

| Name        | Description                                           |
| ----------- | ----------------------------------------------------- |
| abs         | Absolute value operation                              |
| abs.w       | Wrapping absolute value operation                     |
| add         | Addition operation                                    |
| add.w       | Wrapping addition operation                           |
| and         | AND operation                                         |
| assert.eq   | Assert equality                                       |
| assert.neq  | Assert non-equality                                   |
| branch.eq   | Branches to a position if the arguments are equal     |
| branch.neq  | Branches to a position if the arguments are not equal |
| cast        | Cast between literals                                 |
| cast.lossy  | Cast between literals with lossy truncation           |
| div         | Division operation                                    |
| div.w       | Wrapping division operation                           |
| double      | Double operation                                      |
| gt          | Greater than comparison                               |
| gte         | Greater than or equal to comparison                   |
| inv         | Multiplicative inverse operation                      |
| is.eq       | Equality comparison                                   |
| is.neq      | Not equal comparison                                  |
| lt          | Less than comparison                                  |
| lte         | Less than or equal to comparison                      |
| mod         | Arithmetic modulo operation                           |
| mul         | Multiplication operation                              |
| mul.w       | Wrapping multiplication operation                     |
| nand        | `Boolean` NAND operation                              |
| neg         | Additive inverse operation                            |
| nor         | `Boolean` NOR operation                               |
| not         | NOT operation                                         |
| or          | OR Operation                                          |
| position    | The position command                                  |
| pow         | Exponentiation operation                              |
| pow.w       | Wrapping exponentiation operation                     |
| rand.chacha | Generates a random value within the `finalize` scope. |
| rem         | Remainder operation                                   |
| rem.w       | Wrapping remainder operation                          |
| shl         | Shift left operation                                  |
| shl.w       | Wrapping shift left operation                         |
| shr         | Shift right operation                                 |
| shr.w       | Wrapping shift right operation                        |
| sqrt        | Square root operation                                 |
| square      | Square operation                                      |
| sub         | Subtraction operation                                 |
| sub.w       | Wrapping subtraction operation                        |
| ternary     | Ternary select operation                              |
| xor         | XOR operation                                         |

### Table of Cryptographic Opcodes[​](https://developer.aleo.org/guides/aleo/opcodes#table-of-cryptographic-opcodes) <a href="#table-of-cryptographic-opcodes" id="table-of-cryptographic-opcodes"></a>

| Name           | Description                       |
| -------------- | --------------------------------- |
| commit.bhp256  | 256-bit input BHP commitment      |
| commit.bhp512  | 512-bit input BHP commitment      |
| commit.bhp768  | 768-bit input BHP commitment      |
| commit.bhp1024 | 1024-bit input BHP commitment     |
| commit.ped64   | 64-bit input Pedersen commitment  |
| commit.ped128  | 128-bit input Pedersen commitment |
| hash.bhp256    | 256-bit input BHP hash            |
| hash.bhp512    | 512-bit input BHP hash            |
| hash.bhp768    | 768-bit input BHP hash            |
| hash.bhp1024   | 1024-bit input BHP hash           |
| hash.keccak256 | 256-bit input Keccak hash         |
| hash.keccak384 | 384-bit input Keccak hash         |
| hash.keccak512 | 512-bit input Keccak hash         |
| hash.ped64     | 64-bit input Pedersen hash        |
| hash.ped128    | 128-bit input Pedersen hash       |
| hash.psd2      | Poseidon hash with input rate 2   |
| hash.psd4      | Poseidon hash with input rate 4   |
| hash.psd8      | Poseidon hash with input rate 8   |
| hash.sha3\_256 | 256-bit input SHA3 hash           |
| hash.sha3\_384 | 384-bit input SHA3 hash           |
| hash.sha3\_512 | 512-bit input SHA3 hash           |
| sign.verify    | Verify a Schnorr signature        |

### Specification[​](https://developer.aleo.org/guides/aleo/opcodes#specification) <a href="#specification" id="specification"></a>

The following is the specification for each opcode in the Beo Virtual Machine (BVM).

#### `abs`[​](https://developer.aleo.org/guides/aleo/opcodes#abs) <a href="#abs" id="abs"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description)

Computes the absolute value of the input, checking for overflow, storing the result in the destination register.

For integer types, a constraint is added to check for underflow. For cases where wrapping semantics are needed, see the abs.w instruction. This underflow happens when the input is the minimum value of a signed integer type. For example, `abs -128i8` would result in underflow, since `128` cannot be represented as an `i8`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types)

| Input  | Destination |
| ------ | ----------- |
| `I8`   | `I8`        |
| `I16`  | `I16`       |
| `I32`  | `I32`       |
| `I64`  | `I64`       |
| `I128` | `I128`      |

***

#### `abs.w`[​](https://developer.aleo.org/guides/aleo/opcodes#absw) <a href="#absw" id="absw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-1)

Compute the absolute value of the input, wrapping around at the boundary of the type, and storing the result in the destination register.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-1)

| Input  | Destination |
| ------ | ----------- |
| `I8`   | `I8`        |
| `I16`  | `I16`       |
| `I32`  | `I32`       |
| `I64`  | `I64`       |
| `I128` | `I128`      |

***

#### `add`[​](https://developer.aleo.org/guides/aleo/opcodes#add) <a href="#add" id="add"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-2)

Adds `first` with `second`, storing the outcome in `destination`.

For integer types, a constraint is added to check for overflow. For cases where wrapping semantics are needed for integer types, see the add.w instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-2)

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Field`  | `Field`  | `Field`     |
| `Group`  | `Group`  | `Group`     |
| `I8`     | `I8`     | `I8`        |
| `I16`    | `I16`    | `I16`       |
| `I32`    | `I32`    | `I32`       |
| `I64`    | `I64`    | `I64`       |
| `I128`   | `I128`   | `I128`      |
| `U8`     | `U8`     | `U8`        |
| `U16`    | `U16`    | `U16`       |
| `U32`    | `U32`    | `U32`       |
| `U64`    | `U64`    | `U64`       |
| `U128`   | `U128`   | `U128`      |
| `Scalar` | `Scalar` | `Scalar`    |

***

#### `add.w`[​](https://developer.aleo.org/guides/aleo/opcodes#addw) <a href="#addw" id="addw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-3)

Adds `first` with `second`, wrapping around at the boundary of the type, and storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-3)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `I8`   | `I8`   | `I8`        |
| `I16`  | `I16`  | `I16`       |
| `I32`  | `I32`  | `I32`       |
| `I64`  | `I64`  | `I64`       |
| `I128` | `I128` | `I128`      |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `and`[​](https://developer.aleo.org/guides/aleo/opcodes#and) <a href="#and" id="and"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-4)

Performs an AND operation on integer (bitwise) or boolean `first` and `second`, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-4)

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Boolean` | `Boolean` | `Boolean`   |
| `I8`      | `I8`      | `I8`        |
| `I16`     | `I16`     | `I16`       |
| `I32`     | `I32`     | `I32`       |
| `I64`     | `I64`     | `I64`       |
| `I128`    | `I128`    | `I128`      |
| `U8`      | `U8`      | `U8`        |
| `U16`     | `U16`     | `U16`       |
| `U32`     | `U32`     | `U32`       |
| `U64`     | `U64`     | `U64`       |
| `U128`    | `U128`    | `U128`      |

***

#### `assert.eq`[​](https://developer.aleo.org/guides/aleo/opcodes#asserteq) <a href="#asserteq" id="asserteq"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-5)

Checks whether `first` and `second` are equal, halting if they are not equal.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-5)

| First       | Second      |
| ----------- | ----------- |
| `Address`   | `Address`   |
| `Boolean`   | `Boolean`   |
| `Field`     | `Field`     |
| `Group`     | `Group`     |
| `I8`        | `I8`        |
| `I16`       | `I16`       |
| `I32`       | `I32`       |
| `I64`       | `I64`       |
| `I128`      | `I128`      |
| `U8`        | `U8`        |
| `U16`       | `U16`       |
| `U32`       | `U32`       |
| `U64`       | `U64`       |
| `U128`      | `U128`      |
| `Scalar`    | `Scalar`    |
| `Signature` | `Signature` |
| `Struct`    | `Struct`    |
| `Record`    | `Record`    |

***

#### `assert.neq`[​](https://developer.aleo.org/guides/aleo/opcodes#assertneq) <a href="#assertneq" id="assertneq"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-6)

Checks whether `first` and `second` are not equal, halting if they are equal.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-6)

| First       | Second      |
| ----------- | ----------- |
| `Address`   | `Address`   |
| `Boolean`   | `Boolean`   |
| `Field`     | `Field`     |
| `Group`     | `Group`     |
| `I8`        | `I8`        |
| `I16`       | `I16`       |
| `I32`       | `I32`       |
| `I64`       | `I64`       |
| `I128`      | `I128`      |
| `U8`        | `U8`        |
| `U16`       | `U16`       |
| `U32`       | `U32`       |
| `U64`       | `U64`       |
| `U128`      | `U128`      |
| `Scalar`    | `Scalar`    |
| `Signature` | `Signature` |
| `Struct`    | `Struct`    |
| `Record`    | `Record`    |

***

#### `branch.eq`[​](https://developer.aleo.org/guides/aleo/opcodes#brancheq) <a href="#brancheq" id="brancheq"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-7)

The command `branch.eq <first> <second> to <destination>` branches execution to the position indicated by `destination` if `first` and `second` are equal. This command is restricted to the finalize scope, and the destination must follow the command. Backward branches are not currently supported.

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Address` | `Address` | `Position`  |
| `Boolean` | `Boolean` | `Position`  |
| `Field`   | `Field`   | `Position`  |
| `Group`   | `Group`   | `Position`  |
| `I8`      | `I8`      | `Position`  |
| `I16`     | `I16`     | `Position`  |
| `I32`     | `I32`     | `Position`  |
| `I64`     | `I64`     | `Position`  |
| `I128`    | `I128`    | `Position`  |
| `U8`      | `U8`      | `Position`  |
| `U16`     | `U16`     | `Position`  |
| `U32`     | `U32`     | `Position`  |
| `U64`     | `U64`     | `Position`  |
| `U128`    | `U128`    | `Position`  |
| `Scalar`  | `Scalar`  | `Position`  |
| `Struct`  | `Struct`  | `Position`  |
| `Record`  | `Record`  | `Position`  |

***

#### `branch.neq`[​](https://developer.aleo.org/guides/aleo/opcodes#branchneq) <a href="#branchneq" id="branchneq"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-8)

The command `branch.neq <first> <second> to <destination>` branches execution to the [position](https://developer.aleo.org/guides/aleo/opcodes#position) indicated by `destination` if `first` and `second` are not equal. This command is restricted to the finalize scope, and the destination must follow the command. Backward branches are not currently supported.

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Address` | `Address` | `Position`  |
| `Boolean` | `Boolean` | `Position`  |
| `Field`   | `Field`   | `Position`  |
| `Group`   | `Group`   | `Position`  |
| `I8`      | `I8`      | `Position`  |
| `I16`     | `I16`     | `Position`  |
| `I32`     | `I32`     | `Position`  |
| `I64`     | `I64`     | `Position`  |
| `I128`    | `I128`    | `Position`  |
| `U8`      | `U8`      | `Position`  |
| `U16`     | `U16`     | `Position`  |
| `U32`     | `U32`     | `Position`  |
| `U64`     | `U64`     | `Position`  |
| `U128`    | `U128`    | `Position`  |
| `Scalar`  | `Scalar`  | `Position`  |
| `Struct`  | `Struct`  | `Position`  |
| `Record`  | `Record`  | `Position`  |

***

#### `cast`[​](https://developer.aleo.org/guides/aleo/opcodes#cast) <a href="#cast" id="cast"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-9)

Enables casting between different literals.

**Example Usage**[**​**](https://developer.aleo.org/guides/aleo/opcodes#example-usage)

```
input r0 as field.private;
cast r0 into r1 as group;
cast r0 into r2 as u8;
cast r3 r4 r5 r6 into r7 as [boolean; 4u32];
cast r7 into r8 as [[boolean; 4u32]; 1u32];
```

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-7)

| First     | Second    |
| --------- | --------- |
| `Address` | `Address` |
| `Array`   | `Array`   |
| `Boolean` | `Boolean` |
| `Field`   | `Field`   |
| `Group`   | `Group`   |
| `I8`      | `I8`      |
| `I16`     | `I16`     |
| `I32`     | `I32`     |
| `I64`     | `I64`     |
| `I128`    | `I128`    |
| `U8`      | `U8`      |
| `U16`     | `U16`     |
| `U32`     | `U32`     |
| `U64`     | `U64`     |
| `U128`    | `U128`    |
| `Scalar`  | `Scalar`  |

***

#### `cast.lossy`[​](https://developer.aleo.org/guides/aleo/opcodes#castlossy) <a href="#castlossy" id="castlossy"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-10)

Perform casting with lossy truncation.

**Example Usage**[**​**](https://developer.aleo.org/guides/aleo/opcodes#example-usage-1)

```
input r0 as field.private;
cast r0 into r1 as group;
cast r0 into r2 as u8;
cast.lossy r0 into r3 as u8; // The bottom 8 bits of the r0 are extracted into a u8 and placed into r3
```

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-8)

| First     | Second    |
| --------- | --------- |
| `Address` | `Address` |
| `Boolean` | `Boolean` |
| `Field`   | `Field`   |
| `Group`   | `Group`   |
| `I8`      | `I8`      |
| `I16`     | `I16`     |
| `I32`     | `I32`     |
| `I64`     | `I64`     |
| `I128`    | `I128`    |
| `U8`      | `U8`      |
| `U16`     | `U16`     |
| `U32`     | `U32`     |
| `U64`     | `U64`     |
| `U128`    | `U128`    |
| `Scalar`  | `Scalar`  |

***

#### `commit.bhp256`[​](https://developer.aleo.org/guides/aleo/opcodes#commitbhp256) <a href="#commitbhp256" id="commitbhp256"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-11)

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 256-bit chunks in `first`, and some randomness in `second`, storing the commitment in `destination`. Randomness should always be a `Scalar` value, and the produced commitment will always be an `Address`, `Field`, or `Group` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 129 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-9)

| First     | Second   | Destination                 |
| --------- | -------- | --------------------------- |
| `Address` | `Scalar` | `Address`, `Field`, `Group` |
| `Boolean` | `Scalar` | `Address`, `Field`, `Group` |
| `Field`   | `Scalar` | `Address`, `Field`, `Group` |
| `Group`   | `Scalar` | `Address`, `Field`, `Group` |
| `I8`      | `Scalar` | `Address`, `Field`, `Group` |
| `I16`     | `Scalar` | `Address`, `Field`, `Group` |
| `I32`     | `Scalar` | `Address`, `Field`, `Group` |
| `I64`     | `Scalar` | `Address`, `Field`, `Group` |
| `I128`    | `Scalar` | `Address`, `Field`, `Group` |
| `U8`      | `Scalar` | `Address`, `Field`, `Group` |
| `U16`     | `Scalar` | `Address`, `Field`, `Group` |
| `U32`     | `Scalar` | `Address`, `Field`, `Group` |
| `U64`     | `Scalar` | `Address`, `Field`, `Group` |
| `U128`    | `Scalar` | `Address`, `Field`, `Group` |
| `Scalar`  | `Scalar` | `Address`, `Field`, `Group` |
| `Struct`  | `Scalar` | `Address`, `Field`, `Group` |

***

#### `commit.bhp512`[​](https://developer.aleo.org/guides/aleo/opcodes#commitbhp512) <a href="#commitbhp512" id="commitbhp512"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-12)

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 512-bit chunks in `first`, and some randomness in `second`, storing the commitment in `destination`. Randomness should always be a `Scalar` value, and the produced commitment will always be an `Address`, `Field`, or `Group` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 171 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-10)

| First     | Second   | Destination                 |
| --------- | -------- | --------------------------- |
| `Address` | `Scalar` | `Address`, `Field`, `Group` |
| `Boolean` | `Scalar` | `Address`, `Field`, `Group` |
| `Field`   | `Scalar` | `Address`, `Field`, `Group` |
| `Group`   | `Scalar` | `Address`, `Field`, `Group` |
| `I8`      | `Scalar` | `Address`, `Field`, `Group` |
| `I16`     | `Scalar` | `Address`, `Field`, `Group` |
| `I32`     | `Scalar` | `Address`, `Field`, `Group` |
| `I64`     | `Scalar` | `Address`, `Field`, `Group` |
| `I128`    | `Scalar` | `Address`, `Field`, `Group` |
| `U8`      | `Scalar` | `Address`, `Field`, `Group` |
| `U16`     | `Scalar` | `Address`, `Field`, `Group` |
| `U32`     | `Scalar` | `Address`, `Field`, `Group` |
| `U64`     | `Scalar` | `Address`, `Field`, `Group` |
| `U128`    | `Scalar` | `Address`, `Field`, `Group` |
| `Scalar`  | `Scalar` | `Address`, `Field`, `Group` |
| `Struct`  | `Scalar` | `Address`, `Field`, `Group` |

***

#### `commit.bhp768`[​](https://developer.aleo.org/guides/aleo/opcodes#commitbhp768) <a href="#commitbhp768" id="commitbhp768"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-13)

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 768-bit chunks in `first`, and some randomness in `second`, storing the commitment in `destination`. Randomness should always be a `Scalar` value, and the produced commitment will always be an `Address`, `Field`, or `Group` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 129 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-11)

| First     | Second   | Destination                 |
| --------- | -------- | --------------------------- |
| `Address` | `Scalar` | `Address`, `Field`, `Group` |
| `Boolean` | `Scalar` | `Address`, `Field`, `Group` |
| `Field`   | `Scalar` | `Address`, `Field`, `Group` |
| `Group`   | `Scalar` | `Address`, `Field`, `Group` |
| `I8`      | `Scalar` | `Address`, `Field`, `Group` |
| `I16`     | `Scalar` | `Address`, `Field`, `Group` |
| `I32`     | `Scalar` | `Address`, `Field`, `Group` |
| `I64`     | `Scalar` | `Address`, `Field`, `Group` |
| `I128`    | `Scalar` | `Address`, `Field`, `Group` |
| `U8`      | `Scalar` | `Address`, `Field`, `Group` |
| `U16`     | `Scalar` | `Address`, `Field`, `Group` |
| `U32`     | `Scalar` | `Address`, `Field`, `Group` |
| `U64`     | `Scalar` | `Address`, `Field`, `Group` |
| `U128`    | `Scalar` | `Address`, `Field`, `Group` |
| `Scalar`  | `Scalar` | `Address`, `Field`, `Group` |
| `Struct`  | `Scalar` | `Address`, `Field`, `Group` |

***

#### `commit.bhp1024`[​](https://developer.aleo.org/guides/aleo/opcodes#commitbhp1024) <a href="#commitbhp1024" id="commitbhp1024"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-14)

Computes a Bowe-Hopwood-Pedersen commitment on inputs of 1024-bit chunks in `first`, and some randomness in `second`, storing the commitment in `destination`. Randomness should always be a `Scalar` value, and the produced commitment will always be an `Address`, `Field`, or `Group` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 171 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-12)

| First     | Second   | Destination                 |
| --------- | -------- | --------------------------- |
| `Address` | `Scalar` | `Address`, `Field`, `Group` |
| `Boolean` | `Scalar` | `Address`, `Field`, `Group` |
| `Field`   | `Scalar` | `Address`, `Field`, `Group` |
| `Group`   | `Scalar` | `Address`, `Field`, `Group` |
| `I8`      | `Scalar` | `Address`, `Field`, `Group` |
| `I16`     | `Scalar` | `Address`, `Field`, `Group` |
| `I32`     | `Scalar` | `Address`, `Field`, `Group` |
| `I64`     | `Scalar` | `Address`, `Field`, `Group` |
| `I128`    | `Scalar` | `Address`, `Field`, `Group` |
| `U8`      | `Scalar` | `Address`, `Field`, `Group` |
| `U16`     | `Scalar` | `Address`, `Field`, `Group` |
| `U32`     | `Scalar` | `Address`, `Field`, `Group` |
| `U64`     | `Scalar` | `Address`, `Field`, `Group` |
| `U128`    | `Scalar` | `Address`, `Field`, `Group` |
| `Scalar`  | `Scalar` | `Address`, `Field`, `Group` |
| `Struct`  | `Scalar` | `Address`, `Field`, `Group` |

***

#### `commit.ped64`[​](https://developer.aleo.org/guides/aleo/opcodes#commitped64) <a href="#commitped64" id="commitped64"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-15)

Computes a Pedersen commitment up to a 64-bit input in `first`, and some randomness in `second`, storing the commitment in `destination`. Randomness should always be a `Scalar` value, and the produced commitment is an `Address`, `Field`, or `Group` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given `Struct` value exceeds the 64-bit limit.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-13)

| First     | Second   | Destination                 |
| --------- | -------- | --------------------------- |
| `Boolean` | `Scalar` | `Address`, `Field`, `Group` |
| `I8`      | `Scalar` | `Address`, `Field`, `Group` |
| `I16`     | `Scalar` | `Address`, `Field`, `Group` |
| `I32`     | `Scalar` | `Address`, `Field`, `Group` |
| `U8`      | `Scalar` | `Address`, `Field`, `Group` |
| `U16`     | `Scalar` | `Address`, `Field`, `Group` |
| `U32`     | `Scalar` | `Address`, `Field`, `Group` |
| `Struct`  | `Scalar` | `Address`, `Field`, `Group` |

***

#### `commit.ped128`[​](https://developer.aleo.org/guides/aleo/opcodes#commitped128) <a href="#commitped128" id="commitped128"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-16)

Computes a Pedersen commitment up to a 128-bit input in `first`, and some randomness in `second`, storing the commitment in `destination`. Randomness should always be a `Scalar` value, and the produced commitment is an `Address`, `Field`, or `Group` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given `Struct` value exceeds the 128-bit limit.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-14)

| First     | Second   | Destination                 |
| --------- | -------- | --------------------------- |
| `Boolean` | `Scalar` | `Address`, `Field`, `Group` |
| `I8`      | `Scalar` | `Address`, `Field`, `Group` |
| `I16`     | `Scalar` | `Address`, `Field`, `Group` |
| `I32`     | `Scalar` | `Address`, `Field`, `Group` |
| `I64`     | `Scalar` | `Address`, `Field`, `Group` |
| `U8`      | `Scalar` | `Address`, `Field`, `Group` |
| `U16`     | `Scalar` | `Address`, `Field`, `Group` |
| `U32`     | `Scalar` | `Address`, `Field`, `Group` |
| `U64`     | `Scalar` | `Address`, `Field`, `Group` |
| `Struct`  | `Scalar` | `Address`, `Field`, `Group` |

***

#### `div`[​](https://developer.aleo.org/guides/aleo/opcodes#div) <a href="#div" id="div"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-17)

Divides `first` by `second`, storing the outcome in `destination`. Halts on division by zero.

For integer types, this operation performs truncated division. Furthermore, a constraint is added to check for underflow. This underflow happens when dividing the minimum value of a signed integer type by `-1`. For example, `div -128i8 -1i8` would result in underflow, since `128` cannot be represented as an `i8`.

For cases where wrapping semantics are needed for integer types, see the [div.w](https://developer.aleo.org/guides/aleo/opcodes#div.w) instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-15)

| First   | Second  | Destination |
| ------- | ------- | ----------- |
| `Field` | `Field` | `Field`     |
| `I8`    | `I8`    | `I8`        |
| `I16`   | `I16`   | `I16`       |
| `I32`   | `I32`   | `I32`       |
| `I64`   | `I64`   | `I64`       |
| `I128`  | `I128`  | `I128`      |
| `U8`    | `U8`    | `U8`        |
| `U16`   | `U16`   | `U16`       |
| `U32`   | `U32`   | `U32`       |
| `U64`   | `U64`   | `U64`       |
| `U128`  | `U128`  | `U128`      |

***

#### `div.w`[​](https://developer.aleo.org/guides/aleo/opcodes#divw) <a href="#divw" id="divw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-18)

Divides `first` by `second`, wrapping around at the boundary of the type, and storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-16)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `I8`   | `I8`   | `I8`        |
| `I16`  | `I16`  | `I16`       |
| `I32`  | `I32`  | `I32`       |
| `I64`  | `I64`  | `I64`       |
| `I128` | `I128` | `I128`      |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `double`[​](https://developer.aleo.org/guides/aleo/opcodes#double) <a href="#double" id="double"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-19)

Doubles the input, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-17)

| Input   | Destination |
| ------- | ----------- |
| `Field` | `Field`     |
| `Group` | `Group`     |

***

#### `gt`[​](https://developer.aleo.org/guides/aleo/opcodes#gt) <a href="#gt" id="gt"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-20)

Checks if `first` is greater than `second`, storing the result in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-18)

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Field`  | `Field`  | `Boolean`   |
| `I8`     | `I8`     | `Boolean`   |
| `I16`    | `I16`    | `Boolean`   |
| `I32`    | `I32`    | `Boolean`   |
| `I64`    | `I64`    | `Boolean`   |
| `I128`   | `I128`   | `Boolean`   |
| `U8`     | `U8`     | `Boolean`   |
| `U16`    | `U16`    | `Boolean`   |
| `U32`    | `U32`    | `Boolean`   |
| `U64`    | `U64`    | `Boolean`   |
| `U128`   | `U128`   | `Boolean`   |
| `Scalar` | `Scalar` | `Boolean`   |

***

#### `gte`[​](https://developer.aleo.org/guides/aleo/opcodes#gte) <a href="#gte" id="gte"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-21)

Checks if `first` is greater than or equal to `second`, storing the result in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-19)

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Field`  | `Field`  | `Boolean`   |
| `I8`     | `I8`     | `Boolean`   |
| `I16`    | `I16`    | `Boolean`   |
| `I32`    | `I32`    | `Boolean`   |
| `I64`    | `I64`    | `Boolean`   |
| `I128`   | `I128`   | `Boolean`   |
| `U8`     | `U8`     | `Boolean`   |
| `U16`    | `U16`    | `Boolean`   |
| `U32`    | `U32`    | `Boolean`   |
| `U64`    | `U64`    | `Boolean`   |
| `U128`   | `U128`   | `Boolean`   |
| `Scalar` | `Scalar` | `Boolean`   |

***

#### `hash.bhp256`[​](https://developer.aleo.org/guides/aleo/opcodes#hashbhp256) <a href="#hashbhp256" id="hashbhp256"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-22)

Computes a Bowe-Hopwood-Pedersen hash on inputs of 256-bit chunks in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 129 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-20)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.bhp512`[​](https://developer.aleo.org/guides/aleo/opcodes#hashbhp512) <a href="#hashbhp512" id="hashbhp512"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-23)

Computes a Bowe-Hopwood-Pedersen hash on inputs of 512-bit chunks in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 171 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-21)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.bhp768`[​](https://developer.aleo.org/guides/aleo/opcodes#hashbhp768) <a href="#hashbhp768" id="hashbhp768"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-24)

Computes a Bowe-Hopwood-Pedersen hash on inputs of 768-bit chunks in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 129 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-22)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.bhp1024`[​](https://developer.aleo.org/guides/aleo/opcodes#hashbhp1024) <a href="#hashbhp1024" id="hashbhp1024"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-25)

Computes a Bowe-Hopwood-Pedersen hash on inputs of 1024-bit chunks in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given input is smaller than 171 bits.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-23)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.keccak256`[​](https://developer.aleo.org/guides/aleo/opcodes#hashkeccak256) <a href="#hashkeccak256" id="hashkeccak256"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-26)

Performs a Keccak hash on `first`, storing a 256-bit digest in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-24)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.keccak384`[​](https://developer.aleo.org/guides/aleo/opcodes#hashkeccak384) <a href="#hashkeccak384" id="hashkeccak384"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-27)

Performs a Keccak hash on `first`, storing a 384-bit digest in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-25)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.keccak512`[​](https://developer.aleo.org/guides/aleo/opcodes#hashkeccak512) <a href="#hashkeccak512" id="hashkeccak512"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-28)

Performs a Keccak hash on `first`, storing a 512-bit digest in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-26)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.ped64`[​](https://developer.aleo.org/guides/aleo/opcodes#hashped64) <a href="#hashped64" id="hashped64"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-29)

Computes a Pedersen hash up to a 64-bit input in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given `Struct` value exceeds the 64-bit limit.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-27)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.ped128`[​](https://developer.aleo.org/guides/aleo/opcodes#hashped128) <a href="#hashped128" id="hashped128"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-30)

Computes a Pedersen hash up to a 128-bit input in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

The instruction will halt if the given `Struct` value exceeds the 128-bit limit.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-28)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.psd2`[​](https://developer.aleo.org/guides/aleo/opcodes#hashpsd2) <a href="#hashpsd2" id="hashpsd2"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-31)

Calculates a Poseidon hash with an input rate of 2, from an input in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-29)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.psd4`[​](https://developer.aleo.org/guides/aleo/opcodes#hashpsd4) <a href="#hashpsd4" id="hashpsd4"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-32)

Calculates a Poseidon hash with an input rate of 4, from an input in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-30)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.psd8`[​](https://developer.aleo.org/guides/aleo/opcodes#hashpsd8) <a href="#hashpsd8" id="hashpsd8"></a>



**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-33)

Calculates a Poseidon hash with an input rate of 8, from an input in `first`, storing the hash in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-31)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.sha3_256`[​](https://developer.aleo.org/guides/aleo/opcodes#hashsha3_256) <a href="#hashsha3_256" id="hashsha3_256"></a>



**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-34)

Calculates a SHA3-256 hash, from an input in `first`, storing the 256-bit digest in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-32)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.sha3_384`[​](https://developer.aleo.org/guides/aleo/opcodes#hashsha3_384) <a href="#hashsha3_384" id="hashsha3_384"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-35)

Calculates a SHA3-384 hash, from an input in `first`, storing the 384-bit digest in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-33)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `hash.sha3_512`[​](https://developer.aleo.org/guides/aleo/opcodes#hashsha3_512) <a href="#hashsha3_512" id="hashsha3_512"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-36)

Calculates a SHA3-512 hash, from an input in `first`, storing the 512-bit digest in `destination`. The produced hash will always be an arithmetic (`U8`, `U16`, `U32`, `U64`, `U128`, `I8`, `I16`, `I32`,`I64`,`I128`, `Field`, `Group`, or `Scalar`) or `Address` value, as specified via `as` at the end of the instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-34)

| First     | Destination                                                                                               |
| --------- | --------------------------------------------------------------------------------------------------------- |
| `Address` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Boolean` | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Field`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Group`   | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `I128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U8`      | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U16`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U32`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U64`     | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `U128`    | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Scalar`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |
| `Struct`  | `Address`, `Field`, `Group`, `Scalar`, `I8`, `I16`, `I32`,`I64`,`I128`, `U8`, `U16`, `U32`, `U64`, `U128` |

***

#### `inv`[​](https://developer.aleo.org/guides/aleo/opcodes#inv) <a href="#inv" id="inv"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-37)

Computes the multiplicative inverse of the input, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-35)

| Input   | Destination |
| ------- | ----------- |
| `Field` | `Field`     |

***

#### `is.eq`[​](https://developer.aleo.org/guides/aleo/opcodes#iseq) <a href="#iseq" id="iseq"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-38)

Compares `first` and `second`, storing the result in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-36)

| First       | Second      | Destination |
| ----------- | ----------- | ----------- |
| `Address`   | `Address`   | `Boolean`   |
| `Boolean`   | `Boolean`   | `Boolean`   |
| `Field`     | `Field`     | `Boolean`   |
| `Group`     | `Group`     | `Boolean`   |
| `I8`        | `I8`        | `Boolean`   |
| `I16`       | `I16`       | `Boolean`   |
| `I32`       | `I32`       | `Boolean`   |
| `I64`       | `I64`       | `Boolean`   |
| `I128`      | `I128`      | `Boolean`   |
| `U8`        | `U8`        | `Boolean`   |
| `U16`       | `U16`       | `Boolean`   |
| `U32`       | `U32`       | `Boolean`   |
| `U64`       | `U64`       | `Boolean`   |
| `U128`      | `U128`      | `Boolean`   |
| `Scalar`    | `Scalar`    | `Boolean`   |
| `Signature` | `Signature` | `Boolean`   |
| `Struct`    | `Struct`    | `Boolean`   |
| `Record`    | `Record`    | `Boolean`   |

***

#### `is.neq`[​](https://developer.aleo.org/guides/aleo/opcodes#isneq) <a href="#isneq" id="isneq"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-39)

Returns true if `first` is not equal to `second`, storing the result in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-37)

| First       | Second      | Destination |
| ----------- | ----------- | ----------- |
| `Address`   | `Address`   | `Boolean`   |
| `Boolean`   | `Boolean`   | `Boolean`   |
| `Field`     | `Field`     | `Boolean`   |
| `Group`     | `Group`     | `Boolean`   |
| `I8`        | `I8`        | `Boolean`   |
| `I16`       | `I16`       | `Boolean`   |
| `I32`       | `I32`       | `Boolean`   |
| `I64`       | `I64`       | `Boolean`   |
| `I128`      | `I128`      | `Boolean`   |
| `U8`        | `U8`        | `Boolean`   |
| `U16`       | `U16`       | `Boolean`   |
| `U32`       | `U32`       | `Boolean`   |
| `U64`       | `U64`       | `Boolean`   |
| `U128`      | `U128`      | `Boolean`   |
| `Scalar`    | `Scalar`    | `Boolean`   |
| `Signature` | `Signature` | `Boolean`   |
| `Struct`    | `Struct`    | `Boolean`   |
| `Record`    | `Record`    | `Boolean`   |

***

#### `lt`[​](https://developer.aleo.org/guides/aleo/opcodes#lt) <a href="#lt" id="lt"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-40)

Checks if `first` is less than `second`, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-38)

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Field`  | `Field`  | `Boolean`   |
| `I8`     | `I8`     | `Boolean`   |
| `I16`    | `I16`    | `Boolean`   |
| `I32`    | `I32`    | `Boolean`   |
| `I64`    | `I64`    | `Boolean`   |
| `I128`   | `I128`   | `Boolean`   |
| `U8`     | `U8`     | `Boolean`   |
| `U16`    | `U16`    | `Boolean`   |
| `U32`    | `U32`    | `Boolean`   |
| `U64`    | `U64`    | `Boolean`   |
| `U128`   | `U128`   | `Boolean`   |
| `Scalar` | `Scalar` | `Boolean`   |

***

#### `lte`[​](https://developer.aleo.org/guides/aleo/opcodes#lte) <a href="#lte" id="lte"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-41)

Checks if `first` is less than or equal to `second`, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-39)

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Field`  | `Field`  | `Boolean`   |
| `I8`     | `I8`     | `Boolean`   |
| `I16`    | `I16`    | `Boolean`   |
| `I32`    | `I32`    | `Boolean`   |
| `I64`    | `I64`    | `Boolean`   |
| `I128`   | `I128`   | `Boolean`   |
| `U8`     | `U8`     | `Boolean`   |
| `U16`    | `U16`    | `Boolean`   |
| `U32`    | `U32`    | `Boolean`   |
| `U64`    | `U64`    | `Boolean`   |
| `U128`   | `U128`   | `Boolean`   |
| `Scalar` | `Scalar` | `Boolean`   |

***

#### `mod`[​](https://developer.aleo.org/guides/aleo/opcodes#mod) <a href="#mod" id="mod"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-42)

Takes the modulus of `first` with respect to `second`, storing the outcome in `destination`. Halts if `second` is zero.

The semantics of this operation are consistent with the mathematical definition of modulo operation.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-40)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `mul`[​](https://developer.aleo.org/guides/aleo/opcodes#mul) <a href="#mul" id="mul"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-43)

Multiplies `first` with `second`, storing the outcome in `destination`.

For integer types, a constraint is added to check for overflow/underflow. For cases where wrapping semantics are needed for integer types, see the mul.w instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-41)

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Field`  | `Field`  | `Field`     |
| `Group`  | `Scalar` | `Group`     |
| `Scalar` | `Group`  | `Group`     |
| `I8`     | `I8`     | `I8`        |
| `I16`    | `I16`    | `I16`       |
| `I32`    | `I32`    | `I32`       |
| `I64`    | `I64`    | `I64`       |
| `I128`   | `I128`   | `I128`      |
| `U8`     | `U8`     | `U8`        |
| `U16`    | `U16`    | `U16`       |
| `U32`    | `U32`    | `U32`       |
| `U64`    | `U64`    | `U64`       |
| `U128`   | `U128`   | `U128`      |

***

#### `mul.w`[​](https://developer.aleo.org/guides/aleo/opcodes#mulw) <a href="#mulw" id="mulw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-44)

Multiplies `first` with `second`, wrapping around at the boundary of the type, and storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-42)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `I8`   | `I8`   | `I8`        |
| `I16`  | `I16`  | `I16`       |
| `I32`  | `I32`  | `I32`       |
| `I64`  | `I64`  | `I64`       |
| `I128` | `I128` | `I128`      |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `nand`[​](https://developer.aleo.org/guides/aleo/opcodes#nand) <a href="#nand" id="nand"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-45)

Returns false only if `first` and `second` are true, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-43)

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Boolean` | `Boolean` | `Boolean`   |

***

#### `neg`[​](https://developer.aleo.org/guides/aleo/opcodes#neg) <a href="#neg" id="neg"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-46)

Negates `first`, storing the outcome in `destination`.

For signed integer types, calling `neg` on the minimum value is an invalid operation. For example, the input `-128i8` would not be valid since `128` cannot be represented as an `i8`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-44)

| Input   | Destination |
| ------- | ----------- |
| `Field` | `Field`     |
| `Group` | `Group`     |
| `I8`    | `I8`        |
| `I16`   | `I16`       |
| `I32`   | `I32`       |
| `I64`   | `I64`       |
| `I128`  | `I128`      |

***

#### `nor`[​](https://developer.aleo.org/guides/aleo/opcodes#nor) <a href="#nor" id="nor"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-47)

Returns true when neither `first` nor `second` is true, storing the outcome in `destination`.

**Supported Type**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-type)

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Boolean` | `Boolean` | `Boolean`   |

***

#### `not`[​](https://developer.aleo.org/guides/aleo/opcodes#not) <a href="#not" id="not"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-48)

Perform a NOT operation on an integer (bitwise) or boolean input, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-45)

| Input     | Destination |
| --------- | ----------- |
| `Boolean` | `Boolean`   |
| `I8`      | `I8`        |
| `I16`     | `I16`       |
| `I32`     | `I32`       |
| `I64`     | `I64`       |
| `I128`    | `I128`      |
| `U8`      | `U8`        |
| `U16`     | `U16`       |
| `U32`     | `U32`       |
| `U64`     | `U64`       |
| `U128`    | `U128`      |

***

#### or[​](https://developer.aleo.org/guides/aleo/opcodes#or) <a href="#or" id="or"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-49)

Performs an OR operation on integer (bitwise) or boolean `first` and `second`, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-46)

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Boolean` | `Boolean` | `Boolean`   |
| `I8`      | `I8`      | `I8`        |
| `I16`     | `I16`     | `I16`       |
| `I32`     | `I32`     | `I32`       |
| `I64`     | `I64`     | `I64`       |
| `I128`    | `I128`    | `I128`      |
| `U8`      | `U8`      | `U8`        |
| `U16`     | `U16`     | `U16`       |
| `U32`     | `U32`     | `U32`       |
| `U64`     | `U64`     | `U64`       |
| `U128`    | `U128`    | `U128`      |

***

#### position[​](https://developer.aleo.org/guides/aleo/opcodes#position) <a href="#position" id="position"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-50)

The position declaration, e.g. `position <name>`, which indicates a location `name` in the program to branch execution to.\
Positions must be a lowercase alphanumeric string.

***

#### `pow`[​](https://developer.aleo.org/guides/aleo/opcodes#pow) <a href="#pow" id="pow"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-51)

Raises `first` to the power of `second`, storing the outcome in `destination`.

For integer types, a constraint is added to check for overflow/underflow. For cases where wrapping semantics are needed for integer types, see the pow.w instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-47)

`Magnitude` can be a `U8`, `U16`, or `U32`.

| First   | Second      | Destination |
| ------- | ----------- | ----------- |
| `Field` | `Field`     | `Field`     |
| `I8`    | `Magnitude` | `I8`        |
| `I16`   | `Magnitude` | `I16`       |
| `I32`   | `Magnitude` | `I32`       |
| `I64`   | `Magnitude` | `I64`       |
| `I128`  | `Magnitude` | `I128`      |
| `U8`    | `Magnitude` | `U8`        |
| `U16`   | `Magnitude` | `U16`       |
| `U32`   | `Magnitude` | `U32`       |
| `U64`   | `Magnitude` | `U64`       |
| `U128`  | `Magnitude` | `U128`      |

***

#### `pow.w`[​](https://developer.aleo.org/guides/aleo/opcodes#poww) <a href="#poww" id="poww"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-52)

Raises `first` to the power of `second`, wrapping around at the boundary of the type, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-48)

`Magnitude` can be a `U8`, `U16`, or `U32`.

| First  | Second      | Destination |
| ------ | ----------- | ----------- |
| `I8`   | `Magnitude` | `I8`        |
| `I16`  | `Magnitude` | `I16`       |
| `I32`  | `Magnitude` | `I32`       |
| `I64`  | `Magnitude` | `I64`       |
| `I128` | `Magnitude` | `I128`      |
| `U8`   | `Magnitude` | `U8`        |
| `U16`  | `Magnitude` | `U16`       |
| `U32`  | `Magnitude` | `U32`       |
| `U64`  | `Magnitude` | `U64`       |
| `U128` | `Magnitude` | `U128`      |

***

#### `rand.chacha`[​](https://developer.aleo.org/guides/aleo/opcodes#randchacha) <a href="#randchacha" id="randchacha"></a>

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-53)

The `rand.chacha` opcode is used to generate random values within the `finalize` scope. It supports a wide range of types for the random value.

**Example Usage**[**​**](https://developer.aleo.org/guides/aleo/opcodes#example-usage-2)

```
rand.chacha into r0 as field;
rand.chacha r0 into r1 as field;
rand.chacha r0 r1 into r2 as field;
rand.chacha 1u8 2i16 into r27 as u32;
```

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-49)

Single can be any of the following types `Address`, `Boolean`, `Field`, `Group`, `I8`, `I16`, `I32`, `I64`, `I128`, `U8`, `U16`, `U32`, `U64`, `U128`, or `Scalar`. Composite data types such as structs and mappings are not allowed.

| First    | Second   | Destination |
| -------- | -------- | ----------- |
| `Single` | `Single` | `Single`    |

***

#### `rem`[​](https://developer.aleo.org/guides/aleo/opcodes#rem) <a href="#rem" id="rem"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-54)

Computes the truncated remainder of `first` divided by `second`, storing the outcome in `destination`. Halts on division by zero.

A constraint is added to check for underflow. This underflow happens when the associated division operation, div, underflows.

For cases where wrapping semantics are needed for integer types, see the rem.w instruction.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-50)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `I8`   | `I8`   | `I8`        |
| `I16`  | `I16`  | `I16`       |
| `I32`  | `I32`  | `I32`       |
| `I64`  | `I64`  | `I64`       |
| `I128` | `I128` | `I128`      |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `rem.w`[​](https://developer.aleo.org/guides/aleo/opcodes#remw) <a href="#remw" id="remw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-55)

Computes the truncated remainder of `first` divided by `second`, wrapping around at the boundary of the type, and storing the outcome in destination.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-51)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `I8`   | `I8`   | `I8`        |
| `I16`  | `I16`  | `I16`       |
| `I32`  | `I32`  | `I32`       |
| `I64`  | `I64`  | `I64`       |
| `I128` | `I128` | `I128`      |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `sign.verify`[​](https://developer.aleo.org/guides/aleo/opcodes#signverify) <a href="#signverify" id="signverify"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-56)

Verifies the signature `first` against the address public key `second` and the message `third`, storing the outcome in `destination`.

**Example Usage**[**​**](https://developer.aleo.org/guides/aleo/opcodes#example-usage-3)

```
sign.verify r0 r1 r2 into r3;
```

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-52)

| First       | Second    | Third     | Destination |
| ----------- | --------- | --------- | ----------- |
| `Signature` | `Address` | `Message` | `Boolean`   |

***

#### `shl`[​](https://developer.aleo.org/guides/aleo/opcodes#shl) <a href="#shl" id="shl"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-57)

Shifts `first` left by `second` bits, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-53)

`Magnitude` can be a `U8`, `U16`, or `U32`.

| First  | Second      | Destination |
| ------ | ----------- | ----------- |
| `I8`   | `Magnitude` | `I8`        |
| `I16`  | `Magnitude` | `I16`       |
| `I32`  | `Magnitude` | `I32`       |
| `I64`  | `Magnitude` | `I64`       |
| `I128` | `Magnitude` | `I128`      |
| `U8`   | `Magnitude` | `U8`        |
| `U16`  | `Magnitude` | `U16`       |
| `U32`  | `Magnitude` | `U32`       |
| `U64`  | `Magnitude` | `U64`       |
| `U128` | `Magnitude` | `U128`      |

***

#### `shl.w`[​](https://developer.aleo.org/guides/aleo/opcodes#shlw) <a href="#shlw" id="shlw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-58)

Shifts `first` left by `second` bits, wrapping around at the boundary of the type, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-54)

`Magnitude` can be a `U8`, `U16`, or `U32`.

| First  | Second      | Destination |
| ------ | ----------- | ----------- |
| `I8`   | `Magnitude` | `I8`        |
| `I16`  | `Magnitude` | `I16`       |
| `I32`  | `Magnitude` | `I32`       |
| `I64`  | `Magnitude` | `I64`       |
| `I128` | `Magnitude` | `I128`      |
| `U8`   | `Magnitude` | `U8`        |
| `U16`  | `Magnitude` | `U16`       |
| `U32`  | `Magnitude` | `U32`       |
| `U64`  | `Magnitude` | `U64`       |
| `U128` | `Magnitude` | `U128`      |

***

#### `shr`[​](https://developer.aleo.org/guides/aleo/opcodes#shr) <a href="#shr" id="shr"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-59)

Shifts `first` right by `second` bits, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-55)

`Magnitude` can be a `U8`, `U16`, or `U32`.

| First  | Second      | Destination |
| ------ | ----------- | ----------- |
| `I8`   | `Magnitude` | `I8`        |
| `I16`  | `Magnitude` | `I16`       |
| `I32`  | `Magnitude` | `I32`       |
| `I64`  | `Magnitude` | `I64`       |
| `I128` | `Magnitude` | `I128`      |
| `U8`   | `Magnitude` | `U8`        |
| `U16`  | `Magnitude` | `U16`       |
| `U32`  | `Magnitude` | `U32`       |
| `U64`  | `Magnitude` | `U64`       |
| `U128` | `Magnitude` | `U128`      |

***

#### `shr.w`[​](https://developer.aleo.org/guides/aleo/opcodes#shrw) <a href="#shrw" id="shrw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-60)

Shifts `first` right by `second` bits, wrapping around at the boundary of the type, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-56)

`Magnitude` can be a `U8`, `U16`, or `U32`.

| First  | Second      | Destination |
| ------ | ----------- | ----------- |
| `I8`   | `Magnitude` | `I8`        |
| `I16`  | `Magnitude` | `I16`       |
| `I32`  | `Magnitude` | `I32`       |
| `I64`  | `Magnitude` | `I64`       |
| `I128` | `Magnitude` | `I128`      |
| `U8`   | `Magnitude` | `U8`        |
| `U16`  | `Magnitude` | `U16`       |
| `U32`  | `Magnitude` | `U32`       |
| `U64`  | `Magnitude` | `U64`       |
| `U128` | `Magnitude` | `U128`      |

***

#### `square`[​](https://developer.aleo.org/guides/aleo/opcodes#square) <a href="#square" id="square"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-61)

Squares the input, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-57)

| Input   | Destination |
| ------- | ----------- |
| `Field` | `Field`     |

***

#### `sqrt`[​](https://developer.aleo.org/guides/aleo/opcodes#sqrt) <a href="#sqrt" id="sqrt"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-62)

Computes the square root of the input, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-58)

| Input   | Destination |
| ------- | ----------- |
| `Field` | `Field`     |

***

#### `sub`[​](https://developer.aleo.org/guides/aleo/opcodes#sub) <a href="#sub" id="sub"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-63)

Computes `first - second`, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-59)

| First   | Second  | Destination |
| ------- | ------- | ----------- |
| `Field` | `Field` | `Field`     |
| `Group` | `Group` | `Group`     |
| `I8`    | `I8`    | `I8`        |
| `I16`   | `I16`   | `I16`       |
| `I32`   | `I32`   | `I32`       |
| `I64`   | `I64`   | `I64`       |
| `I128`  | `I128`  | `I128`      |
| `U8`    | `U8`    | `U8`        |
| `U16`   | `U16`   | `U16`       |
| `U32`   | `U32`   | `U32`       |
| `U64`   | `U64`   | `U64`       |
| `U128`  | `U128`  | `U128`      |

***

#### `sub.w`[​](https://developer.aleo.org/guides/aleo/opcodes#subw) <a href="#subw" id="subw"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-64)

Computes `first - second`, wrapping around at the boundary of the type, and storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-60)

| First  | Second | Destination |
| ------ | ------ | ----------- |
| `I8`   | `I8`   | `I8`        |
| `I16`  | `I16`  | `I16`       |
| `I32`  | `I32`  | `I32`       |
| `I64`  | `I64`  | `I64`       |
| `I128` | `I128` | `I128`      |
| `U8`   | `U8`   | `U8`        |
| `U16`  | `U16`  | `U16`       |
| `U32`  | `U32`  | `U32`       |
| `U64`  | `U64`  | `U64`       |
| `U128` | `U128` | `U128`      |

***

#### `ternary`[​](https://developer.aleo.org/guides/aleo/opcodes#ternary) <a href="#ternary" id="ternary"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-65)

Selects `first`, if `condition` is true, otherwise selects `second`, storing the result in `destination`.

Example: `ternary r0 r1 r2 into r3`, where `r0` is the condition, `r1` is first, `r2` is second, and `r3` is the destination.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-61)

| Condition | First       | Second      | Destination |
| --------- | ----------- | ----------- | ----------- |
| `Boolean` | `Boolean`   | `Boolean`   | `Boolean`   |
| `Boolean` | `Field`     | `Field`     | `Field`     |
| `Boolean` | `Group`     | `Group`     | `Group`     |
| `Boolean` | `I8`        | `I8`        | `I8`        |
| `Boolean` | `I16`       | `I16`       | `I16`       |
| `Boolean` | `I32`       | `I32`       | `I32`       |
| `Boolean` | `I64`       | `I64`       | `I64`       |
| `Boolean` | `I128`      | `I128`      | `I128`      |
| `Boolean` | `U8`        | `U8`        | `U8`        |
| `Boolean` | `U16`       | `U16`       | `U16`       |
| `Boolean` | `U32`       | `U32`       | `U32`       |
| `Boolean` | `U64`       | `U64`       | `U64`       |
| `Boolean` | `U128`      | `U128`      | `U128`      |
| `Boolean` | `Scalar`    | `Scalar`    | `Scalar`    |
| `Boolean` | `Signature` | `Signature` | `Signature` |

***

#### `xor`[​](https://developer.aleo.org/guides/aleo/opcodes#xor) <a href="#xor" id="xor"></a>

Back to Top

**Description**[**​**](https://developer.aleo.org/guides/aleo/opcodes#description-66)

Performs a XOR operation on integer (bitwise) or boolean `first` and `second`, storing the outcome in `destination`.

**Supported Types**[**​**](https://developer.aleo.org/guides/aleo/opcodes#supported-types-62)

| First     | Second    | Destination |
| --------- | --------- | ----------- |
| `Boolean` | `Boolean` | `Boolean`   |
| `I8`      | `I8`      | `I8`        |
| `I16`     | `I16`     | `I16`       |
| `I32`     | `I32`     | `I32`       |
| `I64`     | `I64`     | `I64`       |
| `I128`    | `I128`    | `I128`      |
| `U8`      | `U8`      | `U8`        |
| `U16`     | `U16`     | `U16`       |
| `U32`     | `U32`     | `U32`       |
| `U64`     | `U64`     | `U64`       |
| `U128`    | `U128`    | `U128`      |
