It’s Showtime!

Ethan Frey
CosmWasm
Published in
5 min readOct 12, 2021

CosmWasm 1.0 is production ready. Coming soon to a blockchain near you!

Photo by bert brrr on Unsplash

Starting as a Hackathon project in summer 2019, CosmWasm has grown into a large community and, according to Defi Llama, has the third biggest TVL of all smart contracting languages (behind Solidity and Solana). Even though it has been powering Terra, Secret Network, Fetch.ai, Provenance, and more for over a year, we have very high demands for security, performance, and usability and have not considered it a final, stable, production version until today.

The time is here.

With the v1.0.0-beta release, we are establishing a platform to build the future of all Cosmos chains. We promise backwards compatibility and easy upgrade paths from v1.0.0-beta to all future 1.x versions. With stable, polished APIs, and huge performance improvements, we are providing fertile ground for a growing ecosystem of DeFi, NFTs, Governance, AI, and more.

Don’t be too worried about the beta label. The APIs are stable and have been tested heavily in various testnets and even a mainnet or two. We are awaiting the result of a formal audit, that will start late October. Once we have the audit results and have fixed any issues reported, we will make the official v1.0.0 tag, with no other changes.

CosmWasm v1.0.0-beta comes with a full-stack of code and is compatible with wasmd v0.20.0,cw-plus v0.10.0, cosmjs v0.26.0, and cosmos-sdk v0.42.10. A v1.0.0 of wasmd is coming soon.

Why CosmWasm?

CosmWasm runs WebAssembly (Wasm) bytecode, with very mature bindings to develop in the Rust programming language. We are looking to add support for smart contracts in Golang by Q2 next year. This provides a safe, highly performant runtime for your contracts, and the ease of using mature tooling and test frameworks in well-established languages with large developer communities.

The APIs have been designed both for ease of development, as well as preventing the majority of security issues by design. While Solidity makes it easy to write a simple contract, it is very hard to write a complex contract without any security holes. While it takes a bit longer to get started, the architecture of CosmWasm prevents most classes of attacks present in Solidity. Furthermore, the Rust programming language prevents many coding issues at compile-time. So there is no long gap where you produce functional but exploitable contracts.

Besides exploits like reentrancy attacks, faulty implementations of the business logic are a huge cause of DeFi hacks. Years of computer engineering have shown that testing (whether unit testing, BDD tests, fuzz tests or TDD) are the best way to avoid such errors in your programs. CosmWasm makes it easy to test your contracts at many level of complexity — from unit testing a contract in isolation with mocked input, to native Rust tests simulating complex cross-contract interactions, to integration tests of a contract inside a running blockchain. You can even write tests in TypeScript to test cross-chain contract calls with local blockchain nodes.

In short, CosmWasm allows you to use familiar, powerful, and safe languages to write highly performant and secure smart contracts. These smart contracts can be deployed to a number of different blockchains and even communicate across blockchains via IBC. We will be diving into the details of this multi-chain smart contract world in a series of follow-up articles.

Embedding in your blockchain

While CosmWasm provides a powerful standard library, a plethora of example contracts, and a performant and secure VM, it is not a blockchain. Rather, it can be embedded into any Cosmos SDK based blockchain.

We have provided a sample blockchain, wasmd that can be run out of the box, adding smart contract capabilities to the basic SDK app (which already comes with dPoS, governance, and IBC). The functionality of this app is all contained in the x/wasm module, which can easily be imported into any other Cosmos SDK app. This module is quite flexible and is designed to be customized without forking. (Note that wasmd is at v0.20.0, which runs CosmWasm v1.0.0-beta. A v1.0.0-beta will be released shortly after a bit of mostly internal API cleanup)

Beyond simply adding these smart contracts to your chain in isolation, they can actually integrate deeply with native modules. By default, contracts can interact with the native bank, staking, and distribution modules (to delegate tokens), as well as some limited governance integration (voting). Most blockchains add custom messages and queries, allowing chain-specific contracts to make use of any custom native Go/SDK modules that run on that chain.

There is no choice between native Cosmos SDK modules or smart contracts. Make use of both, using the right tool for each job.

Next Steps

In order to expand and accelerate ecosystem development across multiple CosmWasm blockchains, we helped establish the InterWasm DAO in order to issue grants for all manner of public goods that assist all CosmWasm based blockchains. This will speed up the development of established teams, and provide easier on-ramps to get more developers skilled in CosmWasm development.

Many blockchains are planning to launch with CosmWasm v1.0. In addition to those already on mainnet (with a pre-release version), there is a long list of chains already using CosmWasm on testnets and waiting for a stable v1.0 release to go live. In fact, the Confio team (creators of CosmWasm) are also planning their own blockchain, Tgrade, with an even deeper integration of smart contracts into the Cosmos SDK.

For me, the most exciting part of CosmWasm going live on multiple blockchains, is not just the fact that a contract can be deployed to many different chains, but rather the deep integration of Inter Blockchain Communication (IBC). This means contracts can easily communicate directly with contracts on other chains, relying only on a cheap, trustless relayer. This can go far beyond token transfers to quickly develop and interate on inter-chain protocols, with the same speed and composition that launched DeFi and NFTs.

Subscribe to CosmWasm medium to get our ongoing series “CosmWasm for CTOs” explaining the benefits of using CosmWasm for your next project. And if you are already convinced and want to add CosmWasm to your chain, check out our code on GitHub, read the docs, and join our Discord server for support.

--

--