What does the OpInputCovenantId opcode do in Kaspa's script engine?

OpInputCovenantId (0xcf) is a Kaspa script opcode that retrieves the covenant ID associated with a specific transaction input. It takes an index off the stack, looks up the corresponding UTXO's covenant ID, and pushes the result: if no covenant ID exists for that input, it pushes a 32-byte ZERO_HASH; otherwise it pushes the actual 32-byte covenant ID. This matters for beginners because it shows how Kaspa's scripting layer can inspect the history and identity of coins being spent — a building block for smart contract-like rules that restrict or track how funds move.

Learn more ›