SilverScript covenant declarations compiling into structured Kaspa UTXO entrypoints
SilverScript Covenant Declarations: A Developer Migration Guide
May 19, 2026
KIP-21 inactivity shortcut connecting distant Kaspa sequencing commitments across an inactive lane
KIP-21 Inactivity Shortcut: Making Kaspa Lane Proofs Practical
May 27, 2026

SilverScript Compiler Versions: Why Compiled Contracts Record Them


KaspaBuy
July 16, 2026

SilverScript PR #124 added compiler_version to every CompiledContract. The field travels with the compiled JSON beside the contract name, script bytecode, AST, and ABI. This small provenance change helps developers reproduce builds, diagnose mismatched artifacts, invalidate stale caches, and communicate clearly about which experimental compiler produced a Kaspa contract.

Key takeaways

  • Compiled SilverScript artifacts now identify the compiler version that produced them.
  • The field is metadata for provenance; it is not a consensus activation flag.
  • Wallets, debuggers, deployment tools, and support logs can use it to detect mismatches.
  • Version metadata does not prove that source code is safe or that two builds are byte-for-byte reproducible.
  • Teams should store source revision, dependencies, build options, and hashes alongside the compiler version.

What did SilverScript PR #124 add?

The merged SilverScript pull request #124 added a string field named compiler_version to the CompiledContract structure. The compiler fills it from its COMPILER_VERSION constant when building the artifact.

The tutorial was updated to list the new property in compiled JSON output and to print it in the example program. Tests now assert that a compiled contract reports the same version as the compiler constant. In total, the focused patch changed five files with 15 additions and two deletions.

Before this field, a saved artifact could show its contract name, bytecode, abstract syntax tree, and ABI without directly stating which compiler produced them. A file name or surrounding build log might contain the answer, but the artifact was not self-identifying.

Why does compiler provenance matter for Kaspa contracts?

Compilers transform readable source into lower-level instructions. As an experimental language evolves, two compiler versions may lower the same source differently, fix a bug, rename generated entrypoints, or add validation. When a wallet or deployment tool sees only the resulting bytes, it can be difficult to determine whether a difference is intentional.

Embedding the version helps answer practical questions:

  • Was this artifact rebuilt after a compiler update?
  • Is a debugger reading an ABI generated by the version it supports?
  • Did a deployment pipeline accidentally reuse a cached file?
  • Can a bug report identify the relevant compiler behavior?
  • Should a migration tool recompile the source before comparison?

These questions became especially relevant alongside the SilverScript covenant declaration changes, which revised generated entrypoints and compiler fixtures. Artifact metadata gives teams a first clue when source and generated output appear out of step.

Is compiler_version a security guarantee?

No. A version string says which release claims to have produced the artifact. It does not prove who ran the compiler, whether the binary was modified, whether dependencies were pinned, or whether the contract logic is correct.

A stronger artifact record also includes:

  • the SilverScript repository commit or signed release tag;
  • hashes of source files and constructor arguments;
  • compile options and target network assumptions;
  • dependency lockfiles and build-environment details;
  • a hash of the final compiled artifact;
  • review or audit references where applicable.

For high-value contracts, reproducible builds and independent verification remain desirable. The embedded version is one useful field in that process, not the whole chain of trust.

How should tools use the new field?

Tools should display the version in diagnostics and preserve it when storing or transmitting a compiled artifact. They can warn when the artifact’s compiler version falls outside a tested range, but they should avoid silently “upgrading” bytecode. Recompilation is a deliberate operation because changed compiler output may require a new review.

Caches can include the compiler version in their key. Without it, a build system may return an artifact created by an earlier compiler even though the source file has not changed. Adding source hashes, constructor inputs, and options to that key provides better protection against stale output.

Support interfaces can also include the field in an export bundle. A developer investigating an ABI mismatch needs fewer follow-up questions when the artifact, compiler version, source revision, and logs travel together.

What is the difference between compiler and protocol versions?

The SilverScript compiler version describes a development tool. A rusty-kaspa node version identifies node software. A Kaspa hardfork activation identifies when consensus rules change. These version domains can be related, but they are not interchangeable.

For example, a compiler release may target features made available by a protocol upgrade. That does not mean changing the string inside an artifact activates those rules. Nodes enforce consensus; the compiler prepares scripts intended for those rules.

Clear labels prevent a common documentation problem: saying “version 2” without identifying whether that means the contract language, SDK, node, API, or network rule set.

The same separation applies to protocol research. For example, the KIP-21 inactivity shortcut concerns proving behavior, while compiler_version identifies the tool that generated an artifact. One value cannot substitute for the other.

Frequently asked questions

Does compiler_version change the compiled script itself?

PR #124 adds the field to the compiled contract artifact. Whether serialized metadata is included in a particular deployment payload depends on the tool path; developers should inspect the actual script bytes and transaction construction.

Should a tool reject every older compiler version?

Not automatically. It should apply a documented compatibility policy, warn clearly, and require review where a known compiler issue or breaking change exists.

Is a version string enough for reproducible builds?

No. Reproducibility also requires exact source, dependencies, options, environment information, and deterministic build behavior.

Source and verification note

This article is based on kaspanet/silverscript PR #124, merged into the SilverScript master branch on May 19, 2026. The public diff adds compiler_version, documents it in the tutorial, prints it in an example, and tests it against COMPILER_VERSION. This compiler metadata change did not activate a Kaspa consensus rule; current compatibility should always be checked in the maintained repository.

Related Posts

SilverScript Compiler Versions: Why Compiled Contracts Record Them
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.
Read more