How do Kaspa smart contracts communicate with each other on L1?
On Kaspa's Layer 1, contracts communicate through Covenant IDs — a mechanism that lets one contract verify and govern another within the same transaction. Each covenant (a self-enforcing contract) can hold another covenant's ID as a stored state field. When a transaction involves both contracts, the governed contract checks that an input matching the governing contract's Covenant ID is present in that same transaction. This cross-contract check uses a function called validateOutputStateWithTemplate to confirm which contract controls which output. For a beginner, this matters because it means Kaspa can support multi-contract protocols — systems where several contracts work together — directly on its base layer, without needing a separate shared execution environment like Ethereum's EVM.