Editorial illustration for Kaspa CheckSigFromStack Opcodes: Signature Verification Inside Scripts
Kaspa CheckSigFromStack Opcodes: Signature Verification Inside Scripts
April 6, 2026
Editorial illustration for Kaspa Wallet Functionality in Python: What the New API Exposed
Kaspa Wallet Functionality in Python: What the New API Exposed
April 14, 2026

Kaspa Script Pricing: Compute Budgets for Version-1 Transactions


KaspaBuy
July 16, 2026

Kaspa script pricing became more granular in Rusty Kaspa PR #884, which added a per-input compute_budget for version-1 transactions and metered script execution in internal script units. The April 10, 2026 merge targeted the covpp-reset2 development branch. A compute budget limits execution; it is not a user-selected fee rate or a mainnet activation notice.

Key takeaways

  • Version-1 inputs use a 16-bit ComputeBudget; version-0 inputs retain the legacy 8-bit SigopCount path.
  • One compute-budget unit was defined as 100 grams, with 100 internal script units per gram in this implementation.
  • Each input received a 9,999-script-unit fixed allowance, one unit below a full 10,000-unit budget step.
  • Script execution is checked independently against the budget committed by each input.
  • The branch merge implemented accounting rules but did not itself activate version-1 transactions on mainnet.

What changed in Kaspa script pricing?

The official Rusty Kaspa PR #884 introduced typed units for compute budgets, grams, script units, and legacy signature-operation counts. A transaction input now carries a TxInputMass variant: SigopCount for version 0 or ComputeBudget for version 1. Validation rejects a compute-budget field in v0 and a sig-op-count field in v1.

The change also moved beyond counting only signatures. The script engine tracks work performed by stack operations, cryptographic operations, and specialized verification paths. Literal data embedded in a script is not charged again when pushed because its bytes are already represented in script size; dynamically created or copied stack data can consume execution units.

How does a version-1 compute budget work?

At the merged constants, one budget unit equals 100 grams, and one gram equals 100 script units. That produces 10,000 script units per budget step. The code grants a fixed 9,999-unit allowance per input, so an execution needing exactly 10,000 units still requires budget 1 rather than slipping into budget 0.

The validator constructs a script engine for each populated input with that input’s allowed units. If execution exceeds the limit, it returns an ExceededScriptUnitsLimit error. Tests explicitly cover one input exceeding budget zero and multiple inputs that each remain within their own limits. A transaction therefore cannot pool unused allowance from one input to rescue an over-budget script in another.

Is compute budget the same as a transaction fee?

No. The compute budget is a committed resource ceiling used during validation. The code converts budget units into mass-related units, so it can influence the resource mass against which fees and relay policy are evaluated. The actual fee still depends on transaction economics and the applicable fee rate; a budget value is not a price quote denominated in KAS.

Overstating the budget can increase the transaction’s accounted resource requirement even when the script uses less. Understating it can make a valid-looking transaction fail execution. Wallets and generators need to estimate the smallest budget that safely covers the script path, while preserving room for the exact path that can be selected at validation time.

Why was granular opcode accounting needed?

A signature count is a coarse proxy once a scripting system supports richer stack manipulation, hashing, zero-knowledge verification, and covenant logic. Two scripts with the same number of signatures can demand very different amounts of computation or memory movement. PR #884 adds a common unit system so heterogeneous operations can consume a bounded allowance.

This is defensive resource accounting. It aims to make validation cost explicit and limit denial-of-service exposure; it does not make expensive computation free or guarantee that every proposed contract is economical. The preceding Kaspa CheckSigFromStack opcode guide covers one signature primitive that must fit inside such limits.

What must integrators preserve?

Serializers, RPC schemas, signing tools, partially signed transaction formats, and wallets must preserve the input’s correct mass variant. A converter that silently substitutes a zero, drops compute_budget, or sends both legacy and v1 fields can change validation behavior or cause a version-specific rejection.

PR #884 touched consensus, RPC, gRPC, P2P conversion, wallet mass estimation, PSKT conversion, and integration tests because the field crosses multiple boundaries. Node portability is separate from transaction compatibility; see the Rusty Kaspa musl toolchain guide for Linux build concerns.

Was this pricing model active on mainnet on April 10?

The GitHub evidence does not support that claim. PR #884 merged 71 commits into covpp-reset2, a feature-integration branch. Its code and tests demonstrate an implementation under development. Mainnet use would additionally require integration into a released node, transaction-version activation, network parameters, and an official activation event.

The work also did not establish a throughput increase, a lower KAS fee, or a KAS price target. Resource accounting is protocol safety infrastructure, not a market forecast.

Frequently asked questions

Why use a 16-bit compute budget?

The merged type is a u16, allowing finer and wider resource commitments than the legacy u8 sig-op count. The source does not imply that every value is practical.

Does budget zero allow no script work?

Not exactly. The implementation included a 9,999-script-unit fixed per-input allowance, but execution at the next 10,000-unit boundary requires budget 1.

Can one input borrow another input’s unused budget?

No. The validation tests and engine construction apply the allowed script units separately to each input.

Should users manually choose this value?

Normally a compatible wallet or transaction generator should estimate it. Users should not invent values without understanding the exact software and network rules.

Source and verification note

This article is based on merged kaspanet/rusty-kaspa PR #884, its mass-unit implementation, and transaction validation code. The sources establish the units, per-input enforcement, version split, branch, and merge date. They do not prove mainnet activation, stable parameter permanence, fee savings, throughput gains, application safety, or any KAS price outcome.

Related Posts

Kaspa Script Pricing: Compute Budgets for Version-1 Transactions
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.
Read more