How does Kaspa let a script enforce rules about how much KAS is sent?

Two KIP-10 opcodes give Kaspa scripts direct on-chain access to transaction amounts: `OpTxInputAmount(idx)` returns the value of the UTXO being spent by input `idx`, and `OpTxOutputAmount(idx)` returns the value assigned to output `idx`. By reading both numbers inside the script itself, a coin can enforce rules such as "the output amount must not exceed the input amount minus an agreed fee" — all verified by every node on the network, with no third party involved. For a beginner, this is significant because it means spending conditions can be baked directly into a Kaspa coin at the time it is created, not bolted on afterward.

Learn more ›