Security researcher reviewing audit report on laptop, code editor open in background, coffee shop workspace, technical audit workflow.
Protocols

Soroban Host Function Versioning

Documents the lifecycle of Soroban host functions—the system calls contracts use to interact with the Stellar ledger. Covers introduction, deprecation, and metering changes across protocol versions to help developers and security reviewers assess contract compatibility and gas cost implications.
introduction
LIFECYCLE OF A SYSTEM CALL

How Soroban Host Functions Evolve

The controlled process by which Soroban's interface to the Stellar ledger is introduced, modified, and retired across protocol versions.

Soroban host functions are the fixed set of system calls that WebAssembly smart contracts use to interact with the Stellar ledger—reading account balances, writing contract data, calling other contracts, and managing cryptographic operations. Unlike a user-facing API that can be versioned with a simple endpoint path, these functions are imported by compiled WASM bytecode. Changing or removing a host function is a breaking change that can render deployed contracts inoperable, making their evolution a critical governance and engineering concern for the Stellar network.

The lifecycle of a host function is tied directly to the Stellar protocol version. A new function is introduced in a specific protocol upgrade, such as Protocol 20 or 21, and becomes available to contracts once the network validators adopt that version. Deprecation follows a multi-phase process: a function is first marked as deprecated in a protocol version, which causes the Soroban environment to emit a diagnostic warning on invocation, but the call still succeeds. In a subsequent protocol version, the deprecated function's metering cost may be increased to discourage use. Finally, in a later upgrade, the function is removed entirely, at which point any contract that imports it will fail to instantiate or invoke, effectively bricking it on the network.

For contract developers and security reviewers, the operational impact is direct. A contract compiled against a specific protocol version's host function interface must be re-audited and potentially re-deployed when a dependency is deprecated. Infrastructure providers running Stellar Core and the Soroban environment must ensure their deployment supports the correct set of host functions for the contracts they intend to host. Chainscore Labs helps teams model this lifecycle risk by mapping deployed contract dependencies against the protocol upgrade roadmap, identifying which contracts will break and when, and planning the migration or restoration work required to maintain continuity.

LIFECYCLE AND COMPATIBILITY

Host Function Versioning at a Glance

How Soroban host functions are introduced, deprecated, and metered across protocol versions, and who must act.

AreaWhat changesWho is affectedAction

New host function introduction

A new system call is added to the Soroban environment, expanding contract capabilities.

Contract developers, auditors, wallet providers

Review the new function's behavior and cost model in the protocol release notes. Re-audit contracts that adopt it.

Host function deprecation

An existing host function is marked for removal in a future protocol version.

Contract developers, node operators

Identify all deployed contracts using the deprecated function. Plan and execute a migration to the replacement function before the removal protocol version activates.

Cost model re-metering

The CPU or memory cost of a host function is adjusted, changing execution budgets.

Contract developers, exchanges, DeFi protocols

Re-benchmark all contract invocations to ensure they remain within transaction resource limits. Update fee estimation logic.

Behavioral change

The internal logic of a host function is modified, potentially altering outputs for the same inputs.

Contract developers, auditors, risk teams

Test all dependent contracts against the new protocol version on Testnet to detect breaking behavioral changes. Verify determinism.

WASM runtime dependency

A host function relies on a new WASM feature that requires a runtime upgrade.

Contract developers, infrastructure providers

Re-compile contracts with the updated SDK targeting the new runtime. Ensure validator infrastructure supports the new WASM features.

State archival interaction

A host function's behavior changes when interacting with archived ledger entries.

Contract developers, node operators

Test contract logic for state restoration scenarios. Ensure node infrastructure correctly handles archival and restoration for the affected functions.

Security advisory

A vulnerability is discovered in a host function's implementation.

All node operators, contract developers, auditors

Apply the mandatory Stellar Core patch immediately. Re-audit contracts that depend on the patched function to confirm no exploit path remains.

technical-context
SMART CONTRACT SYSTEM CALL GOVERNANCE

The Host Function Lifecycle: Introduction, Deprecation, and Metering

How Soroban host functions are introduced, deprecated, and metered across protocol versions, and why this lifecycle is critical for contract compatibility and gas cost stability.

Soroban host functions are the system calls that smart contracts use to interact with the Stellar ledger—reading account balances, writing contract data, and performing cryptographic operations. Each host function has a defined lifecycle that spans its introduction in a protocol version, its operational phase where it is metered and priced, and its eventual deprecation when a superior alternative replaces it. This lifecycle is not managed by a single governance vote but by the Stellar Core release process and the protocol version upgrades that validators adopt. For developers, the introduction of a new host function in a protocol like Protocol 21 or 22 means new capabilities become available, but only after the network has upgraded past the activation point.

Deprecation follows a strict, multi-version process designed to prevent breaking changes. A host function is first marked as deprecated in one protocol version, which causes the environment to emit a diagnostic warning on invocation but still allows execution. In a subsequent protocol version, the function is disabled entirely, and any contract that calls it will fail with a HostError. This two-phase deprecation gives developers a full protocol cycle to migrate their contracts. Metering changes are equally critical: the CPU and memory cost parameters for a host function can be recalibrated between protocol versions based on benchmarking data. A function that becomes cheaper to call can reduce transaction fees, while one that becomes more expensive can unexpectedly push a contract's execution budget over the limit, causing transactions to fail.

For security auditors and integration engineers, the host function lifecycle introduces a review surface that must be checked against the target protocol version. A contract audited against Protocol 21's host function set may behave differently or fail on Protocol 22 if a dependency has been deprecated or repriced. Teams operating Soroban contracts should maintain a host function dependency manifest and test against upcoming protocol versions on Testnet before they reach Mainnet. Chainscore Labs performs protocol upgrade impact assessments that map a project's contract call graph against the host function lifecycle, identifying deprecation risks and metering surprises before they cause mainnet failures.

IMPACT ANALYSIS

Who Is Affected by Host Function Changes

Immediate Build Impact

Host function deprecation or metering changes directly break contract compilation and execution. Developers must recompile contracts against the new Soroban environment interface, update SDK dependencies, and re-run test suites to validate gas cost assumptions.

Action steps:

  • Pin the rs-soroban-env version matching the target protocol release.
  • Audit contracts for calls to deprecated host functions flagged in release notes.
  • Re-benchmark gas consumption; a metering change can push a previously valid contract over resource limits.
  • Deploy to Testnet first and verify determinism across the new WASM runtime.

Chainscore can review contract compatibility and gas cost models before mainnet activation.

implementation-impact
HOST FUNCTION LIFECYCLE

Operational Impact Areas

Changes to Soroban host functions directly alter the execution environment for smart contracts. Each introduction, deprecation, or metering adjustment creates a cascade of operational requirements for developers, node operators, and infrastructure providers.

02

Gas Cost and Resource Planning

Metering changes for host functions alter CPU instruction costs and memory pricing. A function that was economical in one protocol version may become prohibitively expensive in the next. Teams must re-benchmark contract execution budgets, update fee-bump strategies, and adjust Soroban resource fee models. Unexpected cost spikes can break user flows and automated operations that rely on predictable transaction fees.

03

SDK and Toolchain Synchronization

Host function versioning forces major version bumps in Stellar SDKs and the Soroban CLI. Developers must upgrade toolchains in lockstep with protocol activation to generate valid transactions. Running mismatched SDK versions against a new protocol can produce XDR serialization errors or transactions that fail with opaque error codes. Integration engineers should pin SDK versions and test against the exact protocol version targeted for deployment.

04

Validator and RPC Node Upgrade Sequencing

New host functions are only available after validators adopt the protocol version that introduces them. Node operators must upgrade Stellar Core and the Soroban environment in the correct sequence. RPC providers and infrastructure operators face a coordination problem: enabling new functions too early risks divergence, while delaying breaks applications that expect the new interface. A staged rollout plan with monitoring checkpoints is essential.

05

Security Review of New Host Functions

Each new host function expands the attack surface of the Soroban environment. Functions that expose cryptographic primitives, ledger state access, or cross-contract calls must be reviewed for determinism guarantees and resource exhaustion vectors. Security reviewers should assess whether new functions introduce reentrancy-like patterns, unexpected state mutations, or denial-of-service risks that could affect all contracts sharing the runtime.

06

Testnet-to-Mainnet Migration Testing

Host function changes propagate through Futurenet and Testnet before Mainnet activation. Teams must deploy and test against each environment to catch breaking changes early. A function that works on Testnet may still exhibit different gas behavior on Mainnet due to ledger state differences. Building a CI pipeline that runs contract test suites against each protocol version is the most reliable way to prevent Mainnet surprises.

SOROBAN HOST FUNCTION LIFECYCLE

Compatibility and Execution Risk Matrix

How changes to host functions across protocol versions create compatibility risks and require action from different actors in the Stellar ecosystem.

AreaWhat changesWho is affectedAction

New host function introduction

A new system call is added to the Soroban environment, expanding what contracts can do.

Contract developers, security auditors

Review the new function's behavior and cost model. Re-audit contracts that adopt it for unforeseen interactions.

Host function deprecation

An existing host function is marked for removal in a future protocol version.

Contract developers, wallet providers, DeFi protocols

Identify all deployed contracts using the deprecated function. Plan and test migration to the replacement API before the removal activates.

Host function removal

A deprecated host function is removed, causing any contract that calls it to fail.

Node operators, exchanges, contract developers

Verify no active contracts depend on the removed function. Node operators must upgrade to a Core version that enforces the removal.

Metering cost adjustment

The CPU or memory cost charged for calling a host function is recalibrated.

Contract developers, exchanges, risk teams

Re-benchmark contract resource consumption. Update deployment budgets and user-facing fee estimates to prevent unexpected execution failures.

Behavioral change in existing function

The internal logic of a host function is modified, potentially altering outcomes for the same inputs.

Contract developers, auditors, bridges

Test all dependent contracts for determinism breaks. This is a critical audit trigger as it can silently corrupt contract state.

WASM runtime constraint change

The underlying WASM engine enforces new limits on instructions or memory, indirectly affecting host function calls.

Contract developers, infrastructure providers

Re-compile and re-test contracts against the new runtime. Adjust contract logic if new limits are too restrictive for current execution paths.

Host function gating by protocol version

A host function is only callable when the network is at or above a specific protocol version.

DeFi protocols, wallet providers, data indexers

Implement version-aware transaction submission. Do not submit transactions using new functions until the network upgrade is confirmed externalized.

SOROBAN HOST FUNCTION VERSIONING

Contract Compatibility Checklist for Protocol Upgrades

A systematic checklist for developers and security reviewers to assess whether existing Soroban contracts remain compatible with a protocol upgrade that introduces, deprecates, or re-meters host functions. Each item identifies a specific risk, the signal to check, and the action required to maintain deterministic and secure execution.

What to check: Review the protocol release notes for a list of deprecated host functions. Cross-reference this list against every host function imported in your contract's Cargo.toml and called in your source code.

Why it matters: Deprecated functions may be removed in a future protocol version, causing your contract to fail at invocation. Even before removal, they may have altered gas metering that makes transactions economically non-viable.

Readiness signal: A successful build with no deprecation warnings from the updated Soroban SDK, and a code audit confirming zero calls to deprecated host functions.

Chains We Build On

Looking to build on a specific blockchain?

We build smart contracts, DeFi applications, wallets, tokenization platforms, and blockchain infrastructure across the major ecosystems teams choose today. That includes Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Solana, Sui, Aptos, Hedera, Stellar, and NEAR, with support for additional EVM and non-EVM networks based on your product requirements.

EVM ecosystems

  • Ethereum logo
    Ethereum
  • Arbitrum logo
    Arbitrum
  • Optimism logo
    Optimism
  • Polygon logo
    Polygon
  • Avalanche logo
    Avalanche
  • Cronos logo
    Cronos

Non-EVM ecosystems

  • Solana logo
    Solana
  • Sui logo
    Sui
  • Aptos logo
    Aptos
  • Hedera logo
    Hedera
  • Stellar logo
    Stellar
  • NEAR logo
    NEAR

Additional ecosystems

  • Polkadot logo
    Polkadot
  • Cosmos logo
    Cosmos
  • TON logo
    TON
  • Cardano logo
    Cardano
  • Algorand logo
    Algorand
  • Tempo logo
    Tempo

Also available for Base, appchains, custom EVM networks, and cross-chain product architecture.

SOROBAN HOST FUNCTION VERSIONING

Frequently Asked Questions

Practical answers for developers, auditors, and node operators managing the lifecycle of Soroban host functions.

You must test your contract against the target protocol version's testnet environment. A deprecated host function will not cause a deployment failure, but the Soroban environment will emit a diagnostic warning during execution. To systematically check:

  • Review the release notes for the Stellar Core and Soroban environment version you are targeting. Deprecations are explicitly listed.
  • Run your test suite on the Futurenet or Testnet that has been upgraded to the target protocol version. Monitor the transaction result meta for deprecation warnings.
  • Use the Soroban CLI to invoke the contract with verbose logging enabled. The diagnostic output will flag calls to deprecated functions.

Why it matters: Deprecated functions are candidates for removal in a future protocol version. A contract that relies on them will become non-functional after the removal, potentially locking user funds or breaking an application. Proactive migration is the only safe path.

Trusted by Industry Leaders

Delivering blockchain solutions for 5+ years.

We have partnered with 50+ leading DeFi protocols, NFT ecosystems, and fintech innovators to build secure, scalable, and capital-efficient blockchain products.

Selected Partners & Clients

ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
ChainVote logo
Reax logo
Sokail logo
Swapsicle logo
SyntheX logo
Tekika logo
Telos logo
Zexe logo
“I've been working with Chainscore Labs for last 3+ years, they've consistently delivered with strong ownership across multiple projects. The team is reliable and detail-oriented.”
L
Lee Erswell
CEO, Telos Foundation
how to get started

How to get started?

If you're looking for blockchain integration, ChainScore Labs has 5+ years of experience helping teams build and integrate exchanges, wallets, smart contracts, tokenization solutions, and protocol-connected products, we can help you choose the right path, integrate securely, and get to production faster. Our team consists of experienced blockchain developers and architects who can help you with your blockchain integration needs.

01

Exploration & Strategy

Define your product goals and choose the right blockchain architecture for your use case.

02

Architecture & Design

Design the smart contracts, tokenomics, and security parameters of your system.

03

Development & Integration

Build and integrate with wallets, oracles, and front-end dApps for a seamless experience.

04

Security & Launch

Comprehensive audits followed by a risk-managed mainnet deployment to protect your users.

Start a build

Need a blockchain engineering team?

Send the project context and we will respond with next steps, scope questions, and a practical path to delivery.