CosmWasm Delivers Multi-chain Smart Contract for Terra Blockchain

Misang Ryu
CosmWasm
Published in
4 min readMay 26, 2020

The foundational integration of the CosmWasm multi-chain smart contracting platform opens the door for a substantially increased development environment for the Terra blockchain, one of the world’s largest blockchain payment networks. In step with adoption milestones made in the payments realm, Terra has the functional capacity to support general purpose cross-chain smart contracts that can be run on multiple chains through Interblockchain Communication (IBC) protocol.

This integration presents an enormous step forward for the exciting plethora of applications that can now be built on Terra and other Cosmos-based blockchains leveraging CosmWasm and IBC development.

This collaboration between Terra and CosmWasm teams supports the continued growth and development of the Cosmos blockchain ecosystem. Now, the additional functionalities of a robust smart contract platform CosmWasm will provide a catalyst to the expanding foundations of the Terra ecosystem.

Ethan Frey, the CEO of Confio, the team building CosmWasm:

“I am excited to work with Terra, one of the largest Tendermint-based blockchains with a strong emphasis on DeFi. By plugging into their variety of tokens, native swap modules and dynamic staking modules, we can demonstrate the power of CosmWasm contracts extending native blockchain logic. For us, they provide an interesting and concrete use case, helping us shape CosmWasm to meet real user needs.”

Do Kwon, the CEO of Terra:

“We are thrilled to be collaborating with the CosmWasm team to bring smart contracts to the Cosmos ecosystem. With richer expressivity enabled by CosmWasm, we will expand Terra’s usership beyond payments to passive income, staking derivatives and more.”

What does it bring to Terra´s ecosystem?

With respect to this exciting project, the CosmWasm team has been working over the past 5 weeks in collaboration with Terra to provide tailored support towards the integration. Initially, this rich feature set will be provided on Terra’s testnet and further expanded towards production prime-time.

A breakdown of feature customizations are as follows:

  • Prioritizing cross-contract query support
  • Adding support for contracts interacting with the staking module as well as custom module (Terra’s swap, oracle, and treasury)
  • Allow easy customization of message dispatching and queries in the x/wasm module of wasmd
  • Producing demo contracts that offer staking derivatives of a validator
  • Producing demo contracts that work as “market makers” allowing permissionless “buys” and “sells” of a currency pair when rates exceed a predefined threshold.

Building with CosmWasm on Terra

As an example of such an application that can be built with CosmWasm in the Terra blockchain ecosystem is Anchor. Currently in development, Anchor is a principal protected staking product for Luna, Terra’s native mining token. Upon completion, Anchor will provide opportunities such that investors may participate in staking without having to speculate on Luna’s price movement.

Under the hood, Anchor is a money market smart contract on Terra that allows for frictionless borrowing of Terra assets (stablecoins, synthetic assets, and Luna). In this specific case, the partnership with CosmWasm will provide the necessary technical functionality for such smart contract features.

Finally, beyond products like Anchor, there are teams that are working on applications needing either cross border stablecoin swaps and payment facilities, so such a Wasm integration would help Terra provide integrated functionality at the development layer.

The CosmWasm Smart Contracting Platform

CosmWasm is a project that was originally prototyped by Team Gaians at the Berlin Hackatom 2019. Aaron Craelius of Regen Network came up with the architecture to avoid reentrancy vectors, Jehan Tremback led the Rust coding, and Ethan Frey led the Golang implementation. After successful prototyping, the Interchain Foundation provided a grant to Confio to implement a robust version that would work in an adversarial environment.

Now, CosmWasm stands as a secure, interoperable, multi-chain operable smart contract platform. It provides a WebAssembly (Wasm) virtual machine (VM) for the Cosmos SDK. The addition of Wasm allows software written in many different languages to run securely on blockchains, as it fundamentally serves as an intermediate language that compiles the language of choice to a portable VM. This ultimately translates to fast VM setup for sandboxing or partitioning applications for better testing, security, performance, and speed. To put it simply, you can think of CosmWasm as a container — for smart contracts — like you would see in the cloud.

Finally, as CosmWasm is provided and integrated as a module that plugs into the Cosmos SDK it means that anyone building a blockchain using the Cosmos SDK can quickly and easily add CosmWasm smart contracting support to their chain. This means that Terra, as a blockchain built from the Cosmos SDK, will have a seamless transition for this integration and support. Stay up-to-date with CosmWasm:

The Terra Blockchain

Terra operates as one of the largest blockchain payment networks in the world. With the successful adoption of more than 1 million users on its CHAI payment app, it has demonstrated the value of how the traditional payments system can be improved with a single efficient blockchain layer.

Terra’s payment network is supported by a family of stablecoins, which are price-stable digital currencies pegged to the world’s major fiat currencies. These stablecoins achieve price-stability via an elastic money supply, enabled by stable mining incentives. The protocol ensures price-stability by algorithmically expanding and contracting supply. It also uses seigniorage created by its minting operations as transaction stimulus, thereby facilitating adoption.

Now, with the steady development of applicable products in the ecosystem with viable go-to-market strategies, Terra is committed to catalyzing its transition towards supporting a robust and vibrant blockchain ecosystem. The integration of a generalizable smart contract platform like CosmWasm provides such a foundation on which to build.

Special thanks to Daniel Hwang(Terra) for co-authoring the announcement.

--

--