What Input/Output Query Opcodes does KIP-0010 add to Kaspa?

KIP-0010 proposes four new opcodes that allow Kaspa scripts to read the amounts and script public keys of a transaction's inputs and outputs. An opcode is a low-level instruction inside a script — think of it as a verb in a very simple programming language that runs on the blockchain. The four opcodes are: OpTxInputAmount (0xbe), which returns how much KAS a specified input carries; OpTxInputSpk (0xbf), which returns that input's script public key (the locking condition attached to those coins); OpTxOutputAmount (0xc2), which returns how much KAS a specified output sends; and OpTxOutputSpk (0xc3), which returns that output's script public key. For a beginner, this matters because it means Kaspa scripts can inspect the actual values and locking conditions of inputs and outputs within the same transaction, making that information available to on-chain script logic.

Learn more ›