Blog Article

Soroban: A New Smart Contract Standard

Author

Tomer Weller

Publishing date

Soroban

Smart contracts

If you’ve been following us this year, you’ll know that in March we announced our plan to bring smart contracts to Stellar. We were serious. Last week at Stellar's 4th annual Meridian conference, we announced two important milestones: first, Soroban, the Stellar network’s native smart contracts platform, is now live on Futurenet, an incentivized testnet, and second, SDF has created a $100M adoption fund to support developers building on Soroban. It’s big news, so let’s get into what it all means.

Soroban’s origins

As a quick refresher, I want to recap why we built Soroban in the first place. When we decided we wanted to bring smart contracts to Stellar, we conducted a pretty thorough inventory of what was already out there and compared it to our desired properties. Nothing fit the bill because the smart contract landscape today didn’t meet the standards we were looking for:

  • Scalability - We want a platform that’s built to scale from the ground up. We need something that can handle the current traffic on the Stellar network, which already operates on scale, and grow with it. But what we found were systems that were unoptimized, not built for concurrency, and harbor a crippling fee regime.
  • Sensibility -We want an opinionated system that guides developers towards sensible design, but what we found were ambiguous systems that gave developers so many options that they ended up confused and getting lost.
  • A Consistent Developer Experience - We want developer tools that are high- quality, consistent, and familiar for developers. What we found were developer ecosystems that are plagued with patchwork tooling of varying quality.

So, we decided to set a new standard for smart contracts. And to do that, we needed to build it ourselves. Now, don’t get me wrong. There’s a lot of great work being done on smart contracts across the blockchain space, and some of these existing systems were a partial fit. But we couldn’t compromise.

Soroban: a new smart contract standard

The Japanese soroban is the smallest and simplest abacus. Developed in the 14th century and still in use today, its design is compact and minimalist, focused on doing the essentials — and doing them well. Inspired by the soroban because its technology is a design standard, we wanted to set the standard for smart contracts while assembling our platform for the long term. We designed Soroban with purpose and built it to perform through three design principles.

Batteries-included

First of all, Soroban is designed for a batteries-included developer experience. Developers deserve immediate access to the tools required to get started quickly and implement effectively. The first builders on Soroban will find a local sandbox for fast setup and iterative development. This means that you can run and debug your contracts locally, on your computer, and without the Stellar network.

Also included is a rich and performant set of host functions and built-in contracts so that you don’t have to reinvent the wheel. For example, we have a built-in efficient token contract meaning no more of that copying and pasting ERC-20 contracts nonsense. Soroban is built using Rust from the ground up. I recently shared my thoughts on this decision in a recent blog post. The Soroban Virtual Machine is written in Rust, for contracts developed in Rust. This allows us to tap into the growing set of safe and efficient tools already available in the Rust ecosystem.

This means you can use the tools that you already use for Rust development. But if you don’t want to write contracts in Rust – that’s also okay. Soroban builds on the WebAssembly standard (or WASM), so you can build SDKs in your favorite WASM compatible language. We already have a community member working on an AssemblyScript SDK.

Scalability

Soroban is designed for scale, providing a foundation from the start that will be able to provide concurrency. Soroban transactions include footprints or what could be described as transaction dependencies, allowing us to group transactions by these dependencies and execute them concurrently, taking advantage of modern multi-core hardware.

We got rid of most of the deserialization and serialization loops. When we examined existing smart contracts, we realized a lot of time and computing power is spent on encoding and decoding – so we eliminated most of that.

We’re also building a tunable gas model to achieve a strong correlation between compute resources and fees. This might sound trivial, but when you look at other ecosystems, you can have two contracts that pay exactly the same, and one runs orders of magnitude slower. That’s unfair and inefficient. To maximize throughput and lower fees, you must have a gas model calibrated to the resources it uses.

We’re also tackling the elephant in the room: ledger bloat. Blockchains are growing to the point where the increasing ledger size is becoming untenable (my colleague Justin Rice wrote a newsletter issue about that - you should check it out). We are tackling this head on and are designing a state archiving mechanism to deal with ledger bloat.

Reliable access to financial rails

Lastly, Soroban is designed for reliable access to financial rails via the Stellar network. We’re incorporating Soroban into the existing Stellar tech stack and ecosystem. That means we can harness the best of what Stellar has to offer; a proven, reliable network that has been live since 2015. As we speak, Stellar is closing ledgers in a timely manner with five seconds to finality, on average. Stellar is processing 150 transactions per second (TPS) – this is a weekly average of real TPS, not theoretical marketing hype.

Most importantly, we tap into Stellar’s global anchor network of on / off ramps and assets, including worldwide cash access. This includes access to top-tier exchanges and custody providers.

Soroban is the platform for developers who don’t want to compromise between performance and simplicity.

Soroban testing is live!

This year has been busy already for Soroban development. From when we launched Project Jump Cannon in March, to design announcements in Q2, and an initial preview last quarter – we’re moving fast. And now that Soroban is live on Futurenet, we actually get to use Soroban, not just talk about it.

Futurenet is an incentivized testnet that will have iterations over the coming months as we work towards a mainnet launch for Soroban in the first half of 2023. That means what is being developed here is far from production-ready, but a step forward for us to collaborate on the tech and get valuable feedback from early adopters. It is going to be a good environment for testing how to write and deploy smart contracts with Soroban – where we hope to learn alongside the devs who join in to kick the tires (hard) so we see what breaks. This phase will make our next Futurenet iterations and Mainnet launches more robust.

Using Futurenet

Let’s fast forward for a minute and imagine Soroban in the future. It’s easy to imagine all sorts of use cases. Think of the potential of Soroban on Stellar to reach the unbanked by leveraging the global access of Stellar with the innovation of Soroban. For example, we’ve created an end-to-end demo showing how to build a crowdfunding platform with Soroban that we showcased on-stage at Meridian, this past Wednesday, called Write Your First Smart Contract on Soroban. The video is coming soon so we'll post the link as soon as it's up.

We imagine products that provide low cost financial infrastructure to those without it today, things like:

  • Truly community owned savings banks.
  • Community crowd funding and ownership for micro public works projects.
  • Tools which not only bring financial access to people without it, but also give them control and ownership of those tools as well.

So, when we talk about this particular phase of Soroban development live on Futurenet, who should come to play? Let’s be clear that this Futurenet launch is for a particular category of devs keen to help shape innovation from the ground floor. We want all you tinkerers, early adopters, tool builders, and dev shops out there to come test this thing with us. Take it out for a spin, write and deploy Soroban smart contracts to a test environment, and start creating developer tools like a Soroban block explorer. We’re willing to make that interesting for you. Which brings me to the next chapter for Soroban’s future.

We’ve created a dedicated reserve in our mandate specifically to support Soroban adoption. $100,000,000 USD to be precise. That’s right – Soroban is supported by a $100 million adoption fund from the SDF. This will go towards supporting developers to test and build on Soroban.

We will be creating incentive programs to award these funds to developers – with our first program announced last week, Sorobanathon: First Light.

Sorobonathon. It’s fun to say. You should try it out. \ ˈsȯrəˌbän-ə-ˌthön \

Sorobanathon: First Light will reward eligible developers for testing Soroban and sharing feedback through Soroban-related content, including code examples, tutorials, and Github issues. More details on Sorobonathon: First Light are available at soroban.stellar.org.

Getting started

If you’re a developer, go right now to soroban.stellar.org and join the Sorobanathon (I love saying this word). You can earn rewards for tinkering with Soroban and join the discussion on the Stellar Dev Discord (#soroban channel). Discord is where we'll be announcing future rewards programs when they go live, you’ll get first notice of all incentive programs, and the general place to be in the know.