Updated: 2/23/2026
Covenants++ Opcodes
Reference table for all Kaspa covenant-related opcodes — introspection, covenant IDs, and script utilities.Kaspa’s covenant related opcodes enable introspection and other necessary script features. These have been added through KIP-10 and KIP-17.
| Opcode | Hex | Notes |
|---|---|---|
| OpBlake2bWithKey | 0xa7 | Pops 2 items off the stack - key and data. Creates a 32 byte keyed hash using blake2b. Pushes the hash onto the stack. |
| OpTxVersion | 0xb2 | Pushes the transaction’s version onto the stack. |
| OpTxInputCount | 0xb3 | Pushes number of transaction inputs onto the stack. |
| OpTxOutputCount | 0xb4 | Pushes number of transaction outputs onto the stack. |
| OpTxLockTime | 0xb5 | Pushes the transaction’s lock time onto the stack. |
| OpTxSubnetId | 0xb6 | Pushes the transaction’s subnetwork ID onto the stack. |
| OpTxGas | 0xb7 | Pushes the transaction’s gas onto the stack. |
| OpTxPayloadSubstr | 0xb8 | Pops 2 items off the stack - start and end. Pushes the substring of payload from start to end onto the stack. |
| OpTxInputIndex | 0xb9 | Pushes this transaction input’s index onto the stack. |
| OpOutpointTxId | 0xba | Pops 1 item off the stack as idx. Of the input at idx, pushes the previous outpoint’s transaction ID onto the stack. |
| OpOutpointIndex | 0xbb | Pops 1 item off the stack as idx. Of the input at idx, pushes the previous outpoint’s index onto the stack. |
| OpTxInputScriptSigSubstr | 0xbc | Pops 3 items off the stack - idx, start, and end. Of the input at idx, pushes the substring of signature_script from start to end onto the stack. |
| OpTxInputSeq | 0xbd | Pops 1 item off the stack as idx. Of the input at idx, pushes the sequence field as little-endian bytes onto the stack. |
| OpTxInputAmount | 0xbe | Pops 1 item off the stack as idx. Of the input at idx, pushes the UTXO’s amount onto the stack. |
| OpTxInputSpk | 0xbf | Pops 1 item off the stack as idx. Of the input at idx, pushes the UTXO’s script public key (including version prefix) onto the stack. |
| OpTxInputDaaScore | 0xc0 | Pops 1 item off the stack as idx. Of the input at idx, pushes the UTXO’s DAA score onto the stack. |
| OpTxInputIsCoinbase | 0xc1 | Pops 1 item off the stack as idx. Of the input at idx, pushes the UTXO’s is coinbase flag onto the stack. |
| OpTxOutputAmount | 0xc2 | Pops 1 item off the stack as idx. Of the output at idx, pushes the output’s value (amount) onto the stack. |
| OpTxOutputSpk | 0xc3 | Pops 1 item off the stack as idx. Of the output at idx, pushes the output’s value script public key (including version prefix) onto the stack. |
| OpTxPayloadLen | 0xc4 | Pushes the transaction’s payload length onto the stack. |
| OpTxInputSpkLen | 0xc5 | Pops 1 item off the stack as idx. Of the input at idx, pushes the script public key’s byte length (including version prefix) onto the stack. |
| OpTxInputSpkSubstr | 0xc6 | Pops 3 items off the stack - idx, start, and end. Of the input at idx, pushes the substring of the UTXO’s script public key from start to end onto the stack. |
| OpTxOutputSpkLen | 0xc7 | Pops 1 item off the stack as idx. Of the output at idx, pushes the script public key’s bytes length (including version prefix) onto the stack. |
| OpTxOutputSpkSubstr | 0xc8 | Pops 3 items off the stack - idx, start, and end. Of the output at idx, pushes the substring of the script public key from start to end onto the stack. |
| OpTxInputScriptSigLen | 0xc9 | Pops 1 item off the stack as idx. Of the input at idx, pushes the signature script’s length onto the stack. |
| OpAuthOutputCount | 0xcb | Pops 1 item off the stack as input_idx. Of the input at input_idx, pushes the number of outputs authorized via covenant binding onto the stack. |
| OpAuthOutputIdx | 0xcc | Pops 2 items off the stack - input_idx and k. Finds the k-th output that has a covenant binding pointing to the input at input_idx. Pushes the output’s actual index onto the stack. |
| OpNum2Bin | 0xcd | Pops 2 items off the stack, treating values as size and num. size must be at most 8 bytes. Serializes num into exactly size bytes. |
| OpBin2Num | 0xce | Pops 1 item off the stack, deserializes it as an i64, and pushes it back onto the stack as minimally encoded bytes. |
| OpInputCovenantId | 0xcf | Pops 1 item off the stack as idx. Of the input at idx, pushes the UTXO’s covenant ID onto the stack, or an empty byte vector if the UTXO does not have a covenant ID. |
| OpCovInputCount | 0xd0 | Pops 1 item off the stack as covenant_id. Pushes the number of inputs with this covenant id onto the stack. |
| OpCovInputIdx | 0xd1 | Pops 2 items off the stack - k and covenant_id. Finds the k-th transaction input with covenant_id and pushes the input’s actual index onto the stack. |
| OpCovOutCount | 0xd2 | Pops 1 item off the stack as covenant_id. Pushes the number of outputs with this covenant id onto the stack. |
| OpCovOutputIdx | 0xd3 | Pops 2 items off the stack - k and covenant_id. Finds the k-th transaction output with covenant_id and pushes the output’s actual index onto the stack. |
| OpChainblockSeqCommit | 0xd4 | Pops 1 item off the stack as block (32 byte block hash). Checks if block is a chain block from the POV of the current selected parent. If block has been pruned, is not a chain block, is from pre-covenant activation, or is beyond an allowed depth (currently finality depth), a script error is raised. The block’s accepted ID merkle root is retrieved and pushed onto the stack as the sequence commitment. |