
A trading pool on Kaspa could one day ask a separate contract what fee to charge for a swap, and rely on the answer without ever running that contract's code. Michael Sutton has put the idea up for discussion on Kas-Smiths, the forum where Kaspa standards are discussed (forum post). It's still an idea under discussion, and Argent, the language for apps made of several contracts, doesn't support it yet. The longer guide Sutton has since written is a proposal that hasn't been merged into the Kaspa documentation (pull request).
The contracts here are covenants, which already run on the Kaspa main network. Sutton wants a covenant written today to be able to use a service that someone else writes later, once it can identify and trust that service. Programmers call this dynamic dispatch, because the contract that answers isn't fixed when the caller is written.
The forum post was "technically written with sol and neon", two AI models, but Sutton takes "full blame for the ideas".
A pool that asks for its fee
Sutton's main example is a trading pool. Picture two pools that run the same swap code and trade the same two tokens, each with a fee service picked when the pool was created. One charges a flat fee. The other charges more when a swap would push its two tokens further out of balance. How much more could also depend on how much prices have been swinging, a figure the fee service keeps updated.
The numbers below are made up, since Sutton's post gives none. Say a trader swaps tokens worth $1,000. The flat pool takes 0.30 percent, which is $3. The second pool asks its fee service. For a swap that evens the pool out, the service might answer 0.30 percent, so the fee is also $3. For a swap that tips it further, the answer might be 0.80 percent, and the fee is $8.
This builds on the example exchange written for Argent. That example reuses one piece of pool code for different tokens, trades at a fixed price and charges no trading fee (example exchange).
Fees are only one kind of question. Sutton names others.
- A vault could ask whether one particular withdrawal is approved. The answer then has to name that withdrawal, so nobody can reuse it for another.
- A price service could check a signed price report once and give the checked price to several vaults in the same transaction. One answer can serve several contracts when it applies to all of them.
- One contract could check a block's time against the record each block keeps for zero-knowledge apps, then pass the confirmed time to the others (KIP-21).
Reading already works, asking doesn't
Kaspa contracts can already look at each other. In July, during the discussion of the KCC-20 token standard, Sutton described what Argent calls open ICC (KCC-20 discussion). ICC is short for Inter-Covenant Communication.
In open ICC, one covenant checks how another's public data changes, without knowing the other's code in advance. The two only have to agree on the shape of that data. Open ICC is among the parts Argent already has. Argent itself is "not yet release-ready" and still needs "further audit and hardening before general production use" (Argent).
Sutton likens that to reading raw storage. Often a contract wants a computed answer instead, worked out by the other contract's own rules. "Sometimes what you want from another covenant is an answer to a question about this transaction," he wrote. Two services could even hold the same data and still give different answers, because their rules differ.
The idea is for covenants on Kaspa itself, "improved composability between L1 apps", as Sutton put it on X (reply). Vprogs still can't call each other (earlier report), and this idea doesn't change that.
Two checks, no call
On Kaspa a contract never acts by itself. Whoever builds a transaction proposes the result, and each contract's script checks that the proposal follows its rules. Sutton's example is a counter. The transaction carries the counter's new value, and the script checks that it's the old value plus one. He calls the pattern "propose the result, then verify it".
His idea uses the same pattern for a question between two contracts. Take the pool and its fee service. The trader's wallet, or whatever software builds the transaction, spends the pool's coins and the fee service's coin together. It also attaches a short record for the fee service. The record holds the question, here the pool's balances, the direction of the swap and its size. It also holds a proposed answer, the fee.
Every node that checks the transaction runs both scripts. The pool's script checks that the record belongs to the fee service it picked and that the question matches the swap in front of it. Then it applies the fee, while still enforcing its own rule for the balances and the trader's minimum payout. The fee service's script works the fee out itself from the same question and its own data, and checks that it gets the same number.
If the wallet writes in a fee the service wouldn't charge, the service's check fails. If the record describes a different swap, the pool's check fails. Either way the whole transaction is rejected and no coins move. In Sutton's words, "There's no runtime call stack between them." Neither contract runs the other's code. Each one checks the same finished transaction.
The fee service has to check every answer filed under its name. If its coin is spent for another job, such as an admin change, it must carry no record at all. That stops anyone from passing off such a spend as an answer the service never gave.
Sutton points to Uniswap v4 as a similar case, live on Ethereum and other networks since January 2025 (Uniswap). A pool there can pick a hook that returns the fee for each swap (Uniswap fees). There, the hook's code is called while the swap is being processed (Uniswap code). Under Sutton's idea, the two Kaspa contracts only check the same written answer.
A reader on X asked what the plan was for reentrancy "before people start chaining these" (question). Sutton answered that this is "more like a read/compute-over-read service", and that "writes have a different pattern and are protected from reentrancy naturally by the utxo model" (answer).
A broken proof checker brought it back
The flaw found in RISC Zero's proof system exposed a weak spot in covenants that check such proofs (earlier report). Sutton noted the trade-off. A covenant built around one fixed key for checking proofs needs nobody trusted with upgrades. But it has no clean way to change that key when the proof system ships a fix (write-up). For apps that accept limited upgrade rules, he suggested an opt-in "verifier router", a separate covenant spent alongside an app's transaction to approve which proof-checking settings are in use.
Hans Moog had written that the aim is to let developers "choose their own verification circuits and update them independently of the base layer" (post). That would mean no hard fork each time an outside library is patched.
The day after Sutton's post, Hans Moog quoted it.
Sutton replied "yup that triggered me (re)exploring this idea" (reply). He added that "reading specific keys from a remote covenant (eg a registry-like service)" can already be done in Argent, by reading that contract's stored state. In his guide he draws the same line. A router that only stores the current key needs no dynamic dispatch, and a plain read is "both simpler and safer". Asking helps when a router checks a proof once and serves the result to several apps in one transaction.
Sutton also notes a limit. A router's coin can be spent only once per block, about ten times a second, so a busy router would run as several copies. A fix would then have to reach every copy, or old copies would need an expiry time.
Where the answers go
The record has to sit somewhere every script in the transaction can read. Sutton names two main places, the transaction's payload and the service's own signature script, and covenant scripts can read both (KIP-17).
In the forum post, Sutton put the records in the payload. One transaction has only one payload, so contracts written by strangers would all need to agree on its layout, down to which bytes hold each question and answer. He thought a new KCC standard would help, with a header at the front of the payload, a version number and a table of contents. Asked on X whether there was a KCC number to follow, he answered "i'm floating the idea around first" (reply).
Then Ross suggested the other place, replying that a trading design they're building uses this pattern (reply). In it, one input checks a signed price once and serves it to the others. Each service keeps its answers at the front of its own signature script, where its own script checks them, and the caller reads them from there (reply). Sutton answered "i think i'll adopt this scheme so there will be no urgent need for a kcc" (reply).
He has since added both options to his guide (post). The signature script keeps each service's answers with its own coin, with no shared field to fight over and no table of contents. It needs care, though. The record must come first and have a fixed length. Every other way of spending the service's coin must leave that spot empty, so an attacker can't make ordinary spending data look like an answer. In Argent, the compiler would handle that. The payload stays possible, but it would still need a shared KCC.
Sutton has asked Ross to write the scheme up in the forum thread. Ross asked for "a few days" first.



