Smart Contracts
Smart contracts and programmability on Kaspa.
-
Can a Kaspa smart contract own a KCC20 token?
Yes — a KCC20 token can be owned not just by a wallet, but by another covenant entirely. KCC20 tracks ownership through two state fields: ownerIdentifier (the a
-
Do Kaspa Covenants require a separate smart contract layer?
No — Kaspa Covenants express asset logic directly on Kaspa L1 without an external execution environment. In many blockchain systems, programmable rules around a
-
Does every Kaspa transaction output require a covenant?
No — covenant validation only applies to outputs that explicitly include one. Kaspa's KIP-0020 defines two paths for each transaction output: if the covenant fi
-
How are NFTs different from cryptocurrencies?
Fungibility: Cryptocurrencies are fungible, meaning one unit is interchangeable with another. For instance, one Kaspa is equivalent to any other Kaspa in terms
-
How can Kaspa scripts attach state to UTXOs?
Kaspa scripts can implicitly attach data — called state — to a UTXO and enforce that the data changes correctly every time that coin is spent. Normally a UTXO i
-
How do I create and deploy a Kaspa NFT?
Video Tutorial 1: Whether you’re an artist, developer, or NFT enthusiast, this video will guide you through the process of choosing your NFT design strategy, le
-
How do I interactively debug a Silverscript covenant on Kaspa?
Silverscript ships with sil-debug, a built-in CLI tool that lets you step through a covenant script and inspect it line by line before it ever touches the netwo
-
How do I mint KRC-20 tokens?
Video Tutorials for minting KRC-20 tokens: KRC-20 Minting Guide Mint Crypto on KRC-20 Like a PRO... Kinda How to Mint KRC20 Tokens on Telegram and Kasware How T
-
How do I test a Silverscript covenant before deploying to Kaspa testnet?
Use sil-debug to verify your covenant's state transitions locally before sending anything to testnet. You launch it with: cargo run -p cli-debugger -- [file] --
-
How do Kaspa covenants control how a UTXO can be spent?
A Kaspa covenant is a script that controls not just who can spend a UTXO, but how it must be spent. In a standard transaction, a script usually only verifies a
-
How do Kaspa covenants enable trustless L1-L2 bridges?
Kaspa covenants can be paired with KIP-16's zero-knowledge proof verification to move assets between Kaspa's main chain and a secondary network without relying
-
How do Kaspa covenants support stateful applications on-chain?
Kaspa covenants allow developers to encode application state directly inside UTXOs and enforce valid state transitions through covenant scripts. A UTXO is norma
-
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
-
How do Kaspa's covenant IDs prevent forged covenant UTXOs from being created?
Kaspa's covenant IDs block forgery at the consensus level — a fake covenant UTXO cannot be created in the first place, not merely rendered unspendable after the
-
How do KIP17 covenants enforce rules on Kaspa spending transactions?
KIP17 covenants work by letting a script verify the full structure of the transaction that spends a coin. The spender provides the previous transaction as witne
-
How do KRC-20s differ from ERC-20s?
KRC-20 tokens and ERC-20 tokens share a similar foundation in terms of token standards for fungible tokens, but they differ significantly due to their underlyin
-
How do smart contracts work?
Smart contracts are digital agreements encoded directly into blockchain networks like Ethereum, Binance Smart Chain, and Solana. Here’s how they function: Prede
-
How do vProgs interact with each other on Kaspa?
vProgs achieve synchronous composability with each other without any vProg needing to trust another. Each vProg is an independent state machine that runs its ow
-
How does a Kaspa covenant script confirm a previous transaction is genuine?
A Kaspa covenant script confirms a previous transaction is genuine by requiring the spender to attach a full copy of it as witness data, then hashing that copy
-
How does a Kaspa threshold script allow two different spending conditions?
A Kaspa threshold script defines two separate rules for who can spend a locked balance and how. First, the owner can spend freely at any time by supplying a val
-
How does enabling transaction payloads advance Kaspa's smart contract capabilities?
Kaspa's hardfork lifting the empty-payload restriction on native transactions is the network's first concrete step toward second-layer smart contract support. B
-
How does Kaspa contain a security flaw in one ZK precompile so it cannot affect the rest of the network?
Kaspa's OpZkPrecompile architecture is explicitly designed so that a vulnerability inside one precompile is isolated and cannot spread to the broader system. Ea
-
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 `
-
How does Kaspa let scripts find and count authorized outputs?
Kaspa's script engine provides two dedicated opcodes — OpAuthOutputCount and OpAuthOutputIdx — that give a script dynamic visibility into which outputs a given
-
How does Kaspa prevent a UTXO from forging a covenant ID?
Under KIP20, an output can only carry a specific covenant ID under one of two conditions: it either continues an already-existing covenant that holds that ID, o
-
How does Kaspa stop someone from faking covenant membership?
Kaspa's consensus rules allow an output to carry a `covenant_id` only if it genuinely continues an existing covenant or correctly genesis-initializes a brand-ne
-
How does Kaspa's covenant model advance state one step at a time?
In Kaspa's covenant model, each protected output can only move forward by exactly one valid state transition, triggered by a spend transaction that satisfies th
-
How does Kaspa's covenant system keep state inside a UTXO?
Kaspa covenants allow a state machine to live entirely inside a UTXO and its script, with no external coordination needed. In most blockchain systems, tracking
-
How does Kaspa's design avoid state bloat?
Kaspa's L1 verifies ZK proofs rather than re-executing contract code, which eliminates the state bloat that builds up on chains where every node must re-ru
-
How does Kaspa's KIP-0020 attach a covenant to a transaction output?
In Kaspa's KIP-0020, each transaction output can optionally carry a covenant binding — a small data structure that declares which covenant governs the output an
-
How does Kaspa's Mecenas covenant enforce its recurring payment rules?
Kaspa's Mecenas covenant enforces three specific rules on every withdrawal: the recipient receives exactly the defined payment amount, the remaining funds stay
-
How does Kaspa's Mecenas covenant keep recurring payment rules alive across withdrawals?
Every withdrawal from a Kaspa Mecenas covenant automatically moves the remaining funds into a new covenant output that carries the exact same rules forward. The
-
How does Kaspa's off-chain-on-chain architecture address gas fees?
Kaspa's L2 approach uses an off-chain-on-chain architecture that is designed to circumvent gas issues and Turing completeness constraints common to other smart
-
How does Kaspa's OpZkPrecompile opcode allow new proof systems to be added without changing core code?
Kaspa's OpZkPrecompile uses a tag-based dispatch system so new zero-knowledge proof systems can be integrated simply by defining a new tag identifier, with no c
-
How does Kaspa's shared secret script support two types of UTXO spending?
Kaspa's shared secret script locks a UTXO so it can be spent in exactly two ways: by the original owner, or by an authorized borrower who meets a strict set of
-
How does KCC20 control how many tokens can exist?
KCC20 enforces token supply rules automatically through its contract logic, using a flag called isMinter. Each KCC20 covenant output is classified as either a m
-
How does KIP-10 support smart contracts and conditional spending on Kaspa?
KIP-10 explicitly targets smart contracts and conditional spending as two of its core goals. A smart contract is a piece of code that automatically enforces the
-
How does KIP-20 prevent forged covenant state in Kaspa?
KIP-20 makes it impossible to create a coin that falsely claims to belong to a Kaspa covenant unless that coin is genuinely the covenant's starting point or a v
-
How does Silverscript express time in contract logic?
Silverscript lets you write time durations in plain English words — seconds, minutes, hours, days, and weeks — and compiles them into the correct timelock value
-
How does Silverscript handle KAS denominations in smart contracts?
Silverscript has built-in units for Kaspa's currency denominations, so you can write amounts in plain terms rather than raw numbers. Kaspa's smallest unit is th
-
How does Silverscript verify signatures in a Kaspa contract?
Silverscript provides two built-in functions for signature verification: checkSig(sig, pubkey) for single Schnorr signatures, and checkMultiSig for threshold si
-
How does the Crescendo Hardfork position Kaspa for smart contracts?
The Crescendo Hardfork increases Kaspa's capacity and speed specifically to support anticipated demand from emerging technologies, including smart contract laye
-
Igra Labs
Igra Labs [sp_easyaccordion id="730"]
-
Is Silverscript ready for mainnet use?
Not yet — as of the Toccata mainnet launch, Silverscript is experimental and valid only on testnet 12, with mainnet support actively in development. Tooling is
-
KaspaEVM
KaspaEVM [sp_easyaccordion id="753"]
-
Kasplex
Kasplex [sp_easyaccordion id="726"]
-
Smart Contracts Information
Smart Contracts Information [sp_easyaccordion id="687"]
-
Sparkle
Sparkle [sp_easyaccordion id="722"]
-
What applications can Kaspa covenants enable?
Kaspa covenants can enable fungible and non-fungible tokens, smart vaults with timelocks, stateful applications, and trustless Layer 1 to Layer 2 bridges. These
-
What are covenant declaration macros in Silverscript?
Silverscript uses Rust-style attribute macros to declare how a covenant behaves on the Kaspa blockchain. A covenant is a rule baked into a transaction that cont
-
What are covenants on Kaspa L1?
Covenants on Kaspa L1 are a way to attach rules and state directly to an asset output, controlling exactly how it can be spent now and in the future. In a stand
-
What are dApps?
A decentralized application (dApp) is a software application that runs on a blockchain or peer-to-peer network, leveraging its decentralized infrastructure inst
-
What are Kaspa Covenants best suited for?
Kaspa Covenants are best suited for products where the rules governing asset movement are the core of what is being built. These include vaults and treasury con
-
What are Kaspa NFTs?
Kaspa NFTs refer to Non-Fungible Tokens (NFTs). These are also called KRC-721s. They are created and traded on Kspr Bot (on Telegram ) and Kaspa.com . These NFT
-
What are KIP-17 and KIP-20 in the Covenants++ upgrade?
KIP-17 and KIP-20 are two of the three upgrades activated by the Covenants++ hardfork. KIP-17 adds covenant opcodes — special instructions that give a transacti
-
What are KRC-20 tokens?
KRC-20 tokens are fungible tokens on Kaspa BlockDAG. They follow a standard that defines a set of rules for tokens to interact within the ecosystem. KRC-20 prov
-
What are the introspection opcodes proposed in Kaspa's KIP-20?
Introspection opcodes are special script commands proposed in KIP-20 that let Kaspa's script engine examine covenant-related inputs and outputs inside the trans
-
What are the two modes for Silverscript covenant declarations?
Silverscript covenant declarations can run in either Verification mode or Transition mode. Verification mode is the default: it automatically reads the current
-
What are vProgs (Verifiable Programs)?
vProgs, short for Verifiable Programs, are Kaspa's published protocol specification for running program logic off the main chain while keeping it verifiabl
-
What can Kaspa covenant scripts enforce after KIP17?
After KIP17, Kaspa covenant scripts can verify that an outgoing transaction preserves specific rules about amounts, scripts, and state. A covenant is a constrai
-
What can Kaspa fan-out covenants be used for?
Fan-out covenants in Kaspa's Silverscript are useful for distributing funds to multiple recipients, splitting token supply, or forking a pipeline into parallel
-
What can smart contracts do?
Decentralized Finance (DeFi) Platforms DeFi platforms utilize smart contracts to offer financial services like lending, borrowing, and trading without tradition
-
What cryptographic functions are available in Kaspa's Silverscript?
Silverscript gives covenant developers four built-in cryptographic functions: blake2b, sha256, checkSig, and checkMultiSig. These were introduced by KIP17 — a K
-
What cryptographic hash functions can Silverscript contracts use?
Silverscript contracts can call two built-in hash functions: blake2b(data), which returns a 32-byte Blake2b hash, and sha256(data), which returns a SHA-256 hash
-
What do KIP-17 and KIP-20 add to Kaspa?
KIP-17 adds covenant opcodes that give transactions the ability to inspect their own contents — a feature called transaction introspection. KIP-20 introduces co
-
What does the Covenants++ hardfork add to Kaspa?
The Covenants++ hardfork activates three protocol upgrades — KIP-16, KIP-17, and KIP-20 — in a single event. KIP-16 brings zero-knowledge proof verification int
-
What happens to a Kaspa transaction output that has no covenant attached?
A Kaspa transaction output with no covenant field is simply not covenant-bound — it behaves like a standard output with no extra spending restrictions. In KIP-0
-
What Input/Output Query Opcodes does KIP-0010 add to Kaspa?
KIP-0010 proposes four new opcodes that allow Kaspa scripts to read the amounts and script public keys of a transaction's inputs and outputs. An opcode is a low
-
What is a canonical bridge?
A canonical bridge is how your Kaspa enters and exits the layer 2. Simplified, it is an address owned and controlled by the L2, creating a bridgedKAS within the
-
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
-
What is a covenant ID in Kaspa's KIP20?
A covenant ID is a consensus-tracked 32-byte identifier introduced by KIP20 that UTXOs carry to establish a stable lineage for covenant state. In Kaspa, UTXOs (
-
What is a covenant identifier (covenant_id) in Kaspa?
A covenant identifier (`covenant_id`) is a consensus-tracked, 32-byte label that Kaspa attaches to UTXOs so a set of coins carries a stable, network-verified li
-
What is a smart contract?
A smart contract is a computer program or a transaction protocol that is intended to automatically execute, control or document events and actions according to
-
What is a stateful covenant in Kaspa, and how does it work?
A stateful covenant in Kaspa is a locking script that not only controls who can spend a coin, but also enforces that a piece of data attached to the transaction
-
What is an authorized output in Kaspa's covenant system?
An authorized output is a transaction output that a specific input has explicitly sanctioned as a valid continuation of its covenant. In Kaspa's script engine,
-
What is Covenant ID ownership in Kaspa's scripting system?
Covenant ID ownership is the way one Kaspa contract establishes authority over another. A covenant is a self-enforcing script that controls how an output on the
-
What is DeFi?
DeFi, short for Decentralized Finance , refers to an ecosystem of financial applications and services built on blockchain technology that operate without tradit
-
What is EVM Compatibility?
EVM stands for Ethereum Virtual Machine. It powers Ethereum smart contracts. Once smart contracts arrive, Kaspa will be able to run Ethereum dApps better than E
-
What is IgraLabs doing with Kaspa?
They're building an EVM-compatible programmability layer on top of Kaspa BlockDAG. Igra's endgame is to deliver a platform that combines Bitcoin-grade security
-
What is Inline ZK in Kaspa, and when should developers use it?
Inline ZK is a Kaspa programmability option where each user action computes its own result and proof locally, then submits an execution proof to Kaspa for verif
-
What is Kaspa's architectural philosophy for smart contracts?
Kaspa is building verification-oriented programmability directly into its base layer (L1) as a core design decision from the start. In blockchain architecture,
-
What is Kasplex?
Kasplex is a non-profit organization that focuses on making it easy for developers, artists, and influencers to launch projects on Kaspa. The project consists o
-
What is Kii?
The Kaspa Industrial Initiative (Kii) is a foundation committed to leveraging Kaspa’s high-performance Directed Acyclic Graph (DAG)-based Distributed Ledger Tec
-
What is KIP-16 and how does ZK proof verification work in Kaspa?
KIP-16 adds zero-knowledge (ZK) proof verification as a consensus-level opcode in Kaspa. A ZK proof is a cryptographic technique that lets one party prove a sta
-
What is NFT digital art?
NFT digital art refers to artwork that exists in a digital format and is tokenized using Non-Fungible Tokens (NFTs) on a blockchain. Here are the key aspects: T
-
What is SilverScript?
SilverScript is Kaspa's first high-level smart contract language, already implemented and running on Testnet 12 today. Its compiler is open-source and ship
-
What is Silverscript for Kaspa?
Silverscript is the primary tool for writing Kaspa covenants — programmable rules that govern how coins can be spent. It is a high-level language, meaning devel
-
What is Sparkle?
The Sparkle Project is a Rust-WASM SDK for Kaspa, designed to support seamless, cross-platform development. This SDK not only enhances accessibility for develop
-
What is state bloat and how do vProgs address it?
State bloat is the problem that occurs when every node in a network must re-run every computation, causing the chain's data footprint to grow continuously.
-
What is the 'additive-only spending' pattern in Kaspa?
Kaspa's scripting system can lock a coin balance so that it can only grow — never be drained — unless the original owner signs off. This works through a script
-
What is the Covenants++ hardfork?
Covenants++ is a Kaspa hardfork that activates three protocol upgrades — KIP-16, KIP-17, and KIP-20 — simultaneously in a single network upgrade. A hardfork mea
-
What is the Mecenas contract in Kaspa's Silverscript?
The Mecenas contract is a recurring payment covenant built in Silverscript, Kaspa's covenant scripting language. A covenant is a set of rules written directly i
-
What is the N:M merge pattern in Silverscript covenants?
The N:M merge pattern lets a Silverscript covenant accept multiple inputs and produce multiple outputs in a single transaction. In most blockchain scripts, each
-
What is the OpCat opcode in Kaspa's KIP17?
OpCat is a new opcode (0x7e) introduced in Kaspa's KIP17 that concatenates two byte strings inside a script. Alongside OpSubstr (0x7f), which extracts substring
-
What is the benefit of having a Kaspa NFT?
The primary points of having a Kaspa NFT (Non-Fungible Token) include: Proof of Ownership and Authenticity : NFTs serve as unique digital certificates of owners
-
What is the Singleton covenant pattern in Kaspa?
The Singleton pattern is a special covenant rule in Kaspa that guarantees exactly one authorized output is produced per transition, keeping precisely one UTXO w
-
What is transaction introspection in Kaspa's KIP17?
Transaction introspection in KIP17 means Kaspa scripts can read details from the transaction that is trying to spend them — things like the transaction version,
-
What is Verification mode in Silverscript?
Verification mode is the default execution mode for Silverscript covenant declarations — it automatically reads the current transaction state so the developer o
-
What kinds of projects are a good fit for Kaspa's Inline ZK option?
Inline ZK is well-suited to four use-case categories: privacy-preserving actions, proof-verified workflows, custom account models, and applications that want to
-
What kinds of smart contracts does SilverScript support?
SilverScript's open-source compiler ships with over 80 working contract examples covering a broad range of use cases. The examples include vaults, smart wa
-
What limits apply to reading transaction payload data in a Kaspa script?
The OpTxPayloadSubstr opcode lets a Kaspa script read a slice of the transaction's payload, but it enforces strict bounds. The opcode takes a start index and an
-
What new hash opcodes does KIP-0017 add to Kaspa's scripting layer?
KIP-0017 introduces three new cryptographic hash opcodes into Kaspa's scripting engine: OpBlake2bWithKey, OpBlake3, and OpBlake3WithKey. An opcode is a single l
-
What new scripting capabilities does KIP-10 add to Kaspa?
KIP-10 proposes new opcodes that let Kaspa scripts read transaction data directly and work with larger numbers, unlocking more advanced transaction types. In a
-
What new scripting operations does Kaspa's KIP-17 add?
KIP-17 proposes ten new opcodes for Kaspa's scripting language, adding string manipulation, bitwise logic, arithmetic, and zero-knowledge proof verification. In
-
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
-
What opcodes let Kaspa scripts inspect a transaction's input and output count?
Kaspa's scripting layer provides three opcodes that let a script examine the structure of the transaction it belongs to: OpTxInputCount, OpTxOutputCount, and Op
-
What problem does KIP-20 solve for Kaspa covenant applications?
KIP-20 removes the heavy overhead that Kaspa covenant applications previously needed just to prove their own identity across transactions. Before KIP-20, covena
-
What programming model will Kaspa's vProgs environment use?
Kaspa's vProgs execution environment will use a programming model that resembles Solana's account model, with explicit read/write declarations. This m
-
What real-world operations use Silverscript's N:M covenant pattern?
Silverscript's N:M pattern is the building block behind token merging, vote aggregation, and multi-party escrow settlement on Kaspa. Token merging lets a user c
-
What shorthand macros does Silverscript provide for common covenant patterns?
Silverscript offers two shorthand macros for the most common covenant shapes so developers don't have to write the full parameter list every time. The first, #[
-
What smart contract architecture does Kaspa enable for Layer 2s?
Kaspa's design enables a new smart contract architecture that combines the simplicity of zk-rollups with the responsiveness and security of on-chain execution.
-
What smart contracts are under development?
Some developers are working to bring EVM to Kaspa, while others are working to build the infrastructure to bring ANY SC to Kaspa. Core developers are working on
-
What three conditions must an authorized borrower meet in a Kaspa shared secret script?
An authorized borrower must satisfy all three of these conditions at once to spend a UTXO locked by a Kaspa shared secret script. First, they must know a pre-de
-
What use cases do Kaspa covenants enable?
Kaspa covenants unlock five broad categories of on-chain capability by letting scripts enforce rules on how UTXOs can be spent. According to KIP-0017, those cat
-
What VM is being evaluated for Kaspa's vProgs execution?
Cairo, developed by StarkWare, is being evaluated as the likely first virtual machine for Kaspa's vProgs smart contract execution. It was chosen because it
-
When should a Silverscript covenant use Transition mode instead of Verification mode?
Use Transition mode when the new state cannot be inferred from the existing transaction state alone — for example, when a script must decrement an issuance allo
-
Where can I buy and sell KRC-20 Tokens?
You can buy, sell, and trade them on the KRC-20 Marketplace on Kaspa.com or Kspr Bot (on Telegram).
-
Where can I monitor the KRC-20s?
Check out the KRC-20 Token Dashboard, trending tokens, top gainers, top markets, top transferred, and a full list of all KRC-20 tokens deployed on Kaspa. You wi
-
Where is the NFT Marketplace?
Trade NFTs Now: http://kaspa.com/nft/marketplace Kaspa.com NFT Marketplace is LIVE! They made KRC-721 NFT trading (BUY/SELL) as smooth and easy as it gets—for y
-
Which transaction fields can a Kaspa script read using introspection opcodes?
KIP-0017 introduces five opcodes that let a Kaspa script read specific fields from its own transaction at validation time. In most scripting systems, a script r
-
Why can't Silverscript developers call the keyed Blake2b variant directly?
The blake2b() function available in Silverscript user code is strictly the unkeyed variant — a mode that hashes data without a secret key mixed in. The keyed Bl
-
Why do general-execution L2s on Kaspa need ZK-proofs for state commitments?
General-execution L2 networks — those running arbitrary smart-contract logic on an account-based model — cannot easily produce a cryptographic commitment to the
-
Why do Kaspa's keyed hash opcodes enforce strict key-length limits?
Kaspa's two keyed hash opcodes require keys of specific lengths because the underlying algorithms are mathematically designed to work only within those bounds.
-
Why does Kaspa pair covenant rules with dedicated authoring tools?
Kaspa's design pairs its covenant rules and introspection opcodes with authoring tools specifically to reduce the risk of developers accidentally writing insecu
-
Why does Kaspa use a dedicated hash domain for covenant IDs?
Kaspa keeps its covenant identifier hash — called CovenantIDHash — completely isolated from every other hash used in the protocol, a practice called domain sepa
-
Why don't Kaspa covenant scripts need canonical transaction encoding to verify lineage?
Because Kaspa's covenant IDs embed a unique outpoint in their cryptographic hash, covenant scripts can confirm their ancestry without encoding or re-hashing the
-
Why is Cairo being evaluated as Kaspa's first smart-contract VM?
Cairo, developed by StarkWare, is being evaluated as the likely first VM to run Kaspa's vProgs because its Sierra bytecode format uniquely provides provabl
-
Why test Kaspa covenant state transitions locally before deploying to testnet?
Testing covenant state transitions locally with sil-debug confirms that your script produces the expected output before it ever reaches the Kaspa testnet. A "st
-
Why was tracking covenant state expensive in Kaspa before KIP20?
Before KIP20 covenant IDs, proving a UTXO belonged to a specific covenant instance required attaching parent and grandparent transactions as witness data inside