Table of Contents

Enum ArkadeOpcode

Namespace
NArk.Arkade.Scripts
Assembly
NArk.Arkade.dll

Arkade Script extension opcodes — the introspection / byte-string / asset / EC helpers that ArkadeScript adds on top of standard Bitcoin Script.

public enum ArkadeOpcode : byte

Fields

OP_BIN2NUM = 216

0xd8 — Normalise a byte string into a minimally-encoded BigNum.

OP_CHECKSIGFROMSTACK = 204

0xcc — Verify a Schnorr signature against an arbitrary message + pubkey.

OP_DIGEST = 195

0xc3 — Compute a digest of the top stack element.

OP_ECADD = 224

0xe0 — Add two affine points on the selected curve ((0,0) is the point at infinity).

OP_ECMUL = 225

0xe1 — Multiply an affine point by a scalar on the selected curve.

OP_ECMULSCALARVERIFY = 227

0xe3 — Verify Q = k·P on secp256k1 (k a 32-byte scalar, P/Q compressed pubkeys).

OP_ECPAIRING = 226

0xe2 — Verify that the product of alt_bn128 pairings is the identity in GT.

OP_FINDASSETGROUPBYASSETID = 232

0xe8 — Find an asset group by asset ID.

OP_INSPECTASSETGROUP = 235

0xeb — Push the full asset group struct by index.

OP_INSPECTASSETGROUPASSETID = 230

0xe6 — Push the asset ID of an asset group by index.

OP_INSPECTASSETGROUPCTRL = 231

0xe7 — Push the control-asset reference of an asset group by index.

OP_INSPECTASSETGROUPMETADATAHASH = 233

0xe9 — Push the metadata-Merkle-root of an asset group by index.

OP_INSPECTASSETGROUPNUM = 234

0xea — Push the number of inputs/outputs in an asset group by index.

OP_INSPECTASSETGROUPSUM = 236

0xec — Push the per-asset-group sum of inputs/outputs.

OP_INSPECTINASSETAT = 241

0xf1 — Push an asset attached to an input by (input index, asset index).

OP_INSPECTINASSETCOUNT = 240

0xf0 — Push the count of assets attached to an input by index.

OP_INSPECTINASSETLOOKUP = 242

0xf2 — Look up an asset attached to an input by asset ID.

OP_INSPECTINPUTARKADESCRIPTHASH = 200

0xc8 — Push the ArkadeScript hash of an input by index.

OP_INSPECTINPUTARKADEWITNESSHASH = 206

0xce — Push the ArkadeScriptWitness hash of an input by index.

OP_INSPECTINPUTOUTPOINT = 199

0xc7 — Push the outpoint of an input by index.

OP_INSPECTINPUTPACKET = 245

0xf5 — Look up a packet by type in the Arkade tx spent by input input_index; push (content, 1) or (empty, 0).

OP_INSPECTINPUTSCRIPTPUBKEY = 202

0xca — Push the scriptPubKey of an input by index.

OP_INSPECTINPUTSEQUENCE = 203

0xcb — Push the nSequence of an input by index.

OP_INSPECTINPUTVALUE = 201

0xc9 — Push the value (sats) of an input by index.

OP_INSPECTLOCKTIME = 211

0xd3 — Push the transaction nLockTime.

OP_INSPECTNUMASSETGROUPS = 229

0xe5 — Push the number of asset groups in the current Arkade transaction.

OP_INSPECTNUMINPUTS = 212

0xd4 — Push the number of inputs.

OP_INSPECTNUMOUTPUTS = 213

0xd5 — Push the number of outputs.

OP_INSPECTOUTASSETAT = 238

0xee — Push an asset attached to an output by (output index, asset index).

OP_INSPECTOUTASSETCOUNT = 237

0xed — Push the count of assets attached to an output by index.

OP_INSPECTOUTASSETLOOKUP = 239

0xef — Look up an asset attached to an output by asset ID.

OP_INSPECTOUTPUTSCRIPTPUBKEY = 209

0xd1 — Push the scriptPubKey of an output by index.

OP_INSPECTOUTPUTVALUE = 207

0xcf — Push the value (sats) of an output by index.

OP_INSPECTPACKET = 244

0xf4 — Look up a packet by type in the current tx's extension; push (content, 1) on hit or (empty, 0).

OP_INSPECTVERSION = 210

0xd2 — Push the transaction nVersion.

OP_MERKLEBRANCHVERIFY = 179

0xb3 — Verify a Merkle branch (repurposed NOP4 slot).

OP_MODEXP = 218

0xda — Modular exponentiation: push base^exp mod modulus in [0, modulus) (operands ≤ 64 bytes).

OP_NUM2BIN = 215

0xd7 — Pad a BigNum to exactly size bytes; fails if it doesn't fit or size is out of range.

OP_PUSHCURRENTINPUTINDEX = 205

0xcd — Push the index of the input currently being executed.

OP_REVERSEBYTES = 217

0xd9 — Reverse the byte order of the top stack element.

OP_SHA256FINALIZE = 198

0xc6 — Finalise a streaming SHA-256 state, push the digest.

OP_SHA256INITIALIZE = 196

0xc4 — Initialise a streaming SHA-256 state.

OP_SHA256UPDATE = 197

0xc5 — Feed bytes into a streaming SHA-256 state.

OP_SIGHASH = 246

0xf6 — Push the Arkade tapscript sighash (non-BIP342) of the current input under a sighash flag.

OP_TWEAKVERIFY = 228

0xe4 — Verify a tweaked public key: internal + hash · G ?= tweaked.

OP_TXID = 243

0xf3 — Push the txid of the current transaction.

OP_TXWEIGHT = 214

0xd6 — Push the transaction weight.

Remarks

Byte values track the deployed Arkade VM in arkade-os/emulator (pkg/arkade/opcode.go) — the service that actually executes these opcodes, and therefore the authority on what each byte means. Values match the ts-sdk ARKADE_OP table (emulator v0.0.4).

The values fall in 0xb3 (repurposed NOP4 slot) and 0xc30xf6, with 0xd0 and 0xdb0xdf unassigned; standard Bitcoin opcodes are emitted via NBitcoin's NBitcoin.Op type and are NOT re-declared here.