Ethereum has a huge developer lock-in, and many projects have failed trying to replace Ethereum as a general purpose smart contracting platform. This is why CosmWasm focused on providing multiple, specialized smart contracting platforms.
What is CosmWasm?
- CosmWasm is a new smart contracting platform built for the cosmos ecosystem.
- CosmWasm is a library providing all modular code needed for building a contract.
- CosmWasm was originally prototyped by Team Gaians at the Berlin Hackatom 2019. In particular, Aaron Craelius came up with the architecture, especially avoiding reentrancy, Jehan Tremback led the rust coding, and Ethan Frey led the go side of the implementation. After the successful prototype, the Interchain Foundation provided a grant to Confio to implement a robust version that would work in an adversarial environment.
- CosmWasm is written as a module that can plug into the Cosmos SDK. This means that anyone currently building a blockchain using the Cosmos SDK can quickly and easily add CosmWasm smart contracting support to their chain, without adjusting existing logic.
Once you have a CosmWasm-enabled blockchain, you can deploy a custom contract.
What is EVM?
The Ethereum Virtual Machine is the software platform that developers can use to create decentralized applications (DApps) on Ethereum. This virtual machine is where all Ethereum accounts and smart contracts live.
EVM creates a sandboxed environment that executes smart contracts’ bytecode. This means the machine code is completely isolated from the network, filesystem, or process on the host machine. For every instruction implemented on the EVM, a system keeps track of the execution cost. This cost associated with the instruction execution is measured in a gas unit. The user willing to execute this instruction has to reserve some ether to pay as a gas fee.
It achieves this by enabling a system that charges per software instruction executed rather than charging per financial transaction executed like in Bitcoin. Ethereum network being Turing complete means that it can be considered a peer-to-peer worldwide distributed computer.
Comparison between CosmWasm and EVM
let us look at some of the main comparison:
|CosmWasm was architected to eliminate the possibility of reentrancy attacks. CosmWasm prevents most classes of attacks present in solidity.||One major class of attacks in Ethereum (and probably the most infamous due to the DAO hack) is reentrancy|
|CosmWasm deploy-execute process consists of 3 steps||EVM deploy-execute process consists of 2 steps|
|CosmWasm has a more steeper learning curve due to it programming language such as Rust and Go||EVM is much easier and faster to learn|
|CosmWasm can easily handle several hundred tx per second, and is deployed on multiple, connected chains, splitting the load and keeping costs low||Gas prices on Ethereum have skyrocketed, This is due to the high popularity of the chain along with a limit of around 30 tx per second and market pricing for space.|
|CosmWasm provides all the power of contract composition as in Ethereum, but with architectural support to allow you build complex composition safely.||It is easy to connect contracts, but we see such composition is very dangerous — even when the other contract is legitimate, composition multiplies the attack surface for exploits and is extremely difficult to test.|
|However, building upon the Cosmos SDK and IBC, CosmWasm provides such power.||There is no method to compose across multiple chains, nor migrate a project to another blockchain.|
It is important to recognize that Ethereum has a huge developer lock-in, and many projects have failed trying to replace Ethereum as a general purpose smart contracting platform. This is why CosmWasm focused on providing multiple, specialized smart contracting platforms. And with the new world of IBC and Bridges, you don’t have to run on Ethereum to be composable with it