What opcodes let a Kaspa covenant script inspect its own inputs and outputs?
Kaspa's script engine provides four dedicated opcodes that allow a covenant script to discover which transaction inputs and outputs share its own covenant ID. A covenant in Kaspa is a programmable spending rule identified by a unique covenant_id. The opcodes OpCovInputCount (0xd0) and OpCovInputIdx (0xd1) let the script ask how many inputs belong to its covenant and retrieve each one by index; OpCovOutputCount (0xd2) and OpCovOutputIdx (0xd3) answer the same questions for outputs. This matters because it gives a covenant script the ability to reason about its own role within a transaction — a foundational building block for constructing multi-party or conditional on-chain agreements in Kaspa.