Adding WebAssembly to the Cosmos SDK allows software written in many languages to run securely on a blockchain. WASM serves as an intermediate language that compiles the developer’s language of choice into a portable virtual machine. This means that you can have a simple, secure and fast virtual machine set up to sandbox or partition your application’s actions for better testing, security, performance and speed.
The entrance of a new programming language to the Cosmos Network has several benefits for the overall developer ecosystem. First, this product allows developers to write modules in Rust that integrate seamlessly with the Cosmos SDK, so they can take advantage of the mainnet-proven Cosmos-SDK modules and BPoS Tendermint consensus algorithm while developing a largely Rust-based custom application logic. Second, the ability to upload code in transactions, rather than restarting the chain, allows for a much quicker deployment of new features; the Juno Hub upgrade procedure is necessary only when making changes in the core logic. This enables application-specific zones to freeze the staking logic and iterate quickly on their core value proposition through custom smart contracts. Especially if they limit contract deployment to governance, this can provide an easy way for the chain to ship code quickly. If we launch a chain with the default permissionless uploading of smart contracts, you can build an Ethereum alternative on Tendermint.
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. Confio is awaiting the result of a formal audit, that will start late October. Once the audit results arrive and any issues reported are fixed, Confio will make the official v1.0.0 tag, with no other changes.
CosmWasm runs Web Assembly (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.
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.