What is a covenant_id in Kaspa and why does it stay stable?
A covenant_id is a consensus-assigned identifier that keeps a Kaspa covenant recognizable even as its locking script changes over time. A covenant in Kaspa is a programmable spending rule — a set of conditions that governs how a coin can be moved. Before KIP-20, a covenant's identity was tied to its script_public_key, meaning the identifier changed whenever the covenant transitioned to a new state and updated its script. The stable covenant_id introduced by KIP-20 stays constant across those transitions, so the network can always recognize a coin as belonging to a particular covenant without tracing back through its full transaction history. For a beginner, this matters because it makes long-running Kaspa applications — ones that need to remember their own history — far simpler and cheaper to build reliably.