Why can't Kaspa covenant scripts use general loops?

Kaspa's script engine does not support general-purpose loops, so covenant scripts must work around this limitation by unrolling logic manually. In practice this means the script writer sets a maximum number of authorized outputs up front, then writes out the verification check for each possible index one by one — index 0, index 1, index 2, and so on up to the bound — rather than looping over them dynamically. This design keeps scripts simple and their execution time predictable, which is important for a network that processes blocks very quickly; a script that could loop indefinitely would be a denial-of-service risk.

Not financial advice. This content is for education only. Nothing here is financial advice.

Learn more ›