Network Update

Protocol 20: Preparing for Smart Contracts on Stellar

Author

Bri Wylde

Publishing date

Smart Contracts

Developers

It’s that time, folks! Time to talk about Protocol 20. We are nearing the moment when Stellar public network validators will vote on whether to upgrade the network to Protocol 20, which, if accepted, will activate Soroban support on Stellar’s Mainnet.

The goal to add smart contract capabilities to the Stellar network was announced back in January 2022. Since then, the Stellar Development Foundation (SDF), in collaboration with the ecosystem, has been hard at work designing and building the Soroban smart contract platform. After two years of development and eleven preview releases, the vote to launch Soroban on Mainnet is on our doorstep.

Let’s talk a bit more about what Protocol 20 is, what it means for the Stellar network, and Soroban’s development process.

Updates

What’s new in Protocol 20

Protocol 20 implements 12 new Core Advancement Proposals (CAPs) that, combined, introduce the changes to the Stellar protocol and Stellar Core required to enable Soroban smart contracts. CAP-46: Soroban smart contract system overview details all the changes to the XDR and links out to the other Soroban-related CAPs.

CAP-0046-02

Smart Contract Lifecycle defines the structure of smart contracts on the Stellar network and specifies how users can create them.

View Repo

CAP-46-03

Smart Contract Host Functions covers the new functions provided by the smart contract host to contracts.

View Repo

CAP-46-05

Smart Contract Data covers the new ledger entries that store contract data.

View Repo

CAP-46-06

Smart Contract Standardized Asset covers the built-in token contract that can also "wrap" existing Stellar assets;

View Repo

CAP-46-07

Fee and Resource Model in Smart Contracts covers changes to the Stellar network’s fee system.

View Repo

CAP-0046-11

Soroban Authorization Framework introduces the authorization framework, which supports account abstraction.

View Repo

CAP-0046-12

Soroban State Archival Interface introduces the State Archival interface.

Impact

What this means for the Stellar network

Adding smart contract support to Stellar drives imagination and innovation and unlocks a myriad of new possibilities for developers building on the network. The Stellar network currently supports a rich, although fixed, set of transactions, making it inflexible and difficult to adapt to ecosystem needs and the fast-paced blockchain landscape. Users must currently rely on protocol-level changes to implement and use features such as AMMs, which can be a laborious process.


With Soroban, Stellar developers are empowered to do more on the network and have more room to innovate. And this doesn’t take away from what the network already offers. In fact, Soroban’s capabilities, coupled with Stellar’s already established on-chain assets (easily leveraged with the Stellar Asset Contract (SAC)) and global anchor network, give developers opportunities not experienced in other networks.

The Story

Soroban's Development

Soroban’s development has been unique in that it has been designed in the open since its inception. With design docs open to the community and design discussions held publicly in Discord, developers were able to understand the reasoning behind decisions and provide input that made meaningful impacts on the platform’s development.

Soroban has gone through eleven preview releases since development began, each of which introduced different parts of its total functionality. Throughout each preview release, developers have been encouraged and incentivized to experiment, build, and scale projects on the platform through several programs as part of the $100M Soroban adoption fund.

Because the ecosystem has been consistently tinkering and developing on Soroban since the first preview release, there are now 100+ projects ready to launch with the Mainnet upgrade, including developer tools such as oracles, block explorers, and IDEs, DeFi primitives such as AMMs and lending and borrowing protocols, SDKs, RPC services, and more. There are also many community-made tutorials and guides to help new developers get up and running on the platform quickly (check out some of these tutorials from the Sorobounty Spectacular program).

In addition to leveraging community input, Soroban developers have made thoughtful technical choices based on learnings from other platforms, especially with the decision to use the well-established technologies Wasm and Rust. The election of using Wasm over other runtimes was deliberate and explained in detail here, but its robust execution environment, thriving ecosystem, and broader interoperability were large contributing factors. The Rust programming language also boasts a mature, active community and is the standard language for safe, secure, and efficient computation.

Soroban engineers have also conducted research that has influenced the design of certain features that support network scalability and sustainability. For example, Soroban employs a fees and metering structure that allows individual resource consumption (such as ledger entry reads and writes, CPU instructions, and RAM) to be priced independently and a novel method for archiving state that solves the age-old blockchain problem of state bloat.

Next Steps

Prep & Resources

If you're building on the Stellar network, and you want to make sure you're prepared for the upgrade, check out the Protocol 20 Upgrade Guide, which provides helpful guidance on upgrading to the latest versions of Stellar software, including the SDKs, Horizon, and Stellar Core.

The initial Protocol 20 vote will introduce new network settings that validators control (such as the maximum number of Soroban transactions per ledger, resource fees, and resource limitations) and will likely be followed by a series of additional votes to adjust these settings. Keep up to date with any Protocol 20-related announcements in the #protocol-20 channel in the Stellar Developer Discord, where the ecosystem is coordinating and sharing information about the upgrade.

The upcoming Protocol 20 vote will mark a pivotal moment for the Stellar network, with the introduction of smart contracts on Mainnet a milestone for the entire ecosystem. It sure is an exciting time to be building on Stellar!