Why you should use Rust for your next DApp

The need for blockchains to scale

At Oasis Labs we’re building a platform for privacy-preserving smart contracts that can scale to complex applications. Scaling to complex applications becomes particularly important as we see blockchains move beyond simple financial transactions to broader real-world use cases including applications utilizing machine learning, gaming, and other complex transactions.

Supporting a new level of complexity not only requires a more robust architecture (you can read more about our approach to scalability in our non-technical primer), but also new tools and frameworks for building these complex applications. Solidity is a great language for writing simple contracts like multisig wallets and tokens, but it isn’t the best language for complex applications like machine learning.

That’s why at Oasis Labs, it has been our goal from the beginning to build a platform that supports many different languages and frameworks, ensuring developers have access to the right tools for their application.

Why Oasis supports Rust

As a first step towards this goal, the Oasis Devnet supports Rust for smart contract development. For those unfamiliar, Rust is a flexible programming language like C++ with the ability to protect against memory safety issues and other common bugs.

By adding Rust support to the Oasis Devnet, our goal is to make it easy for developers to write complex applications. For example, Rust allows developers to write general-purpose code with custom data structures. Developers can also make use of third-party Rust libraries developed and maintained by the Rust community such as machine learning, data serialization, and other utilities. Existing Rust code can be converted into a smart contract for the Oasis Devnet, often with few modifications.

To learn more about using Rust for smart contracts, check out our documentation or check out our video tutorial below.

What’s next for Rust and the Oasis Devnet?

Our support for Rust paves the way to support additional programming languages and frameworks in the future. That’s because under the hood, Rust smart contracts compile to WebAssembly (WASM) which execute inside a WASM runtime on the Oasis Devnet.

WASM is becoming a de-facto standard language for web applications, and it’s supported as a target language by an ever-growing list of tools and frameworks. With both industry and community support behind WASM, we believe it provides a robust foundation for DApps of the future.

Supporting Rust on the Oasis Devnet is therefore an important milestone towards enabling real-world privacy-preserving applications. This feature ensures that you can begin building complex applications today, and will allow Oasis to support a rich set of development tools in the future. This ensures you will have the optionality and flexibility to use the tools and languages best-suited for your unique application.

We’ll keep you updated when we launch support for additional tools — we’re eager to see members of our community (like you) will build!

If you have feedback on our implementation of Rust or requests for other languages and tools you think we should support, let us know by going to feedback.oasiscloud.io. We can’t wait to hear from you and can’t wait to see what you build on the Devnet!