eWASM Replaces the Heart of Ethereum

The Ethereum Virtual Machine (EVM) is stored across numerous nodes that make up the platform and is responsible for executing DApps, tokens, digital kittens, and DAOs of which the blockchain is comprised of.

Ethereum’s entirety operates on top of this engine, and it speaks in a language called “EVM bytecode”—raw, 256-bit information strings which can deliver any conceivable equation. It looks essential and powerful but it is gearing up for a complete rewrite.

“I would make the case there wasn’t an enormous amount of design thinking put into it at the beginning,” Ethereum developer Lane Rettig said about the EVM. “It was kind of like a tool – a swiss army knife is the way I would describe it – it does a bunch of things but not incredibly well.”

As such, a new virtual machine named “eWASM” will replace the present EVM. eWASM is Ethereum’s version of the WASM (WebAssembly) code which was created by the team of developers responsible for standardizing and maintaining the web, the World Wide Web Consortium (W3C).

“There are many highly paid, very experienced engineers, and many thousands of professional engineer hours that went into the conception of [the WASM] construction set – compared to EVM,” Rettig said.

eWASM will enable developers to code not only in the Ethereum-specific language Solidity but in several programming languages. It is also said to come with a host of performance improvements.

Ethereum will join various competitors such as Tron, Cardano, and EOS, who plan to deploy or have deployed project-specific virtual machines to handle decentralized computation through the WASM code.

The switch for Ethereum is set to execute with some other updates now called “Shasper,” which includes mining rewrite Casper and scaling solution sharding. While the switch’s exact timeline is not fixed, the development of eWASM is making quick progress. It is gearing up for the release of its testnet in October at the Devcon 4 in Prague.

“Ethereum is at the point where it’s transitioning from a clunky homebrew custom build job that we’ve been riding around our farm to a real racecar that we can take out on the highway and open up,” Rettig summarized.

Although EVM is a disruptive technology, it is not as flawless as it could be. Case in point, many DApps developers program in Solidity, a sophisticated programming language that instantly compiles into an EVM bytecode compatible form.

Since the EVM relies on “very large, wide instructions,” Rettig stated, even the tiniest types of computations like basic arithmetic would have to be converted into 256-bit strings to be processed by the EVM.

It is only among the many operations built into the system code which Rettig thinks should not be there. Another is the famous hash function SHA-3.

Because of that, the developer describes the EVM as “warty.” Ethereum core developer Nick Johnson agreed, saying that when he entered Ethereum, he immediately understood that the EVM was created by developers with a thorough understanding of computer science, but with limited experience in developing widely useable products.

Johnson noted that as a tool, the EVM has been “optimized for theoretical purity, rather than practical use.”

“It has these enormous registers, but they’re all the same, and it’s very internally consistent and so on,” he stated, “but it’s not built with real-world implementation in mind.”

On the other hand, the WASM code was created with production in mind. According to Rettig, it is built “closer to the metal,” therefore the code it runs is near to actual hardware instructions. Meaning, there is less effort on translating various coding logics.

“The instructions very closely mimic actual hardware instructions,” Rettig added. “These instructions can map one-to-one directly to the instructions the actual devices run, so you can, in theory, get pretty exciting performance improvements.”

Another significant advantage is that it potentially does away with the so-called “precompile.” Specific operations have to be built inside the system since the EVM is comprised of unwieldy code. Otherwise, the operations would exceed the associated gas costs. Precompiles is necessary to make such operations available on a network, hard fork, or a system-wide upgrade.

“With eWASM, it’s efficient enough at doing compute stuff that most of those precompiles could be done away with and replaced with just eWASM contracts,” Johnson stated.

As with any significant change in a decentralized ecosystem, the move to deprecate the EVM is criticized. Ethereum core developer Greg Colvin is hesitant to let the old code go. He has been designing an enhanced version of the EVM code called “EVM 1.5,” which was initially intended to be the EVM’s future. However, the Ethereum Foundation cut his funding without warning.

“I was pissed,” Colvin said. “I was like wait a minute, you won’t pay me $8.40 an hour when you’ve already decreased my hours to 20 from 35, so why am I doing this. And then for the rest of the year, I could no longer afford to volunteer time.”

Colvin claims that eWASM also has technical issues. For instance, since eWASM enables multiple language support, the code mainly depends on the “compilers”—something that he maintains could be a point of failure for attackers. Colvin is also unconvinced that eWASM smart contracts could substitute precompiles.

“There seems to be a pattern in technology and computer science where the best-designed things, not only do they not necessarily win, but they seem to not do very well,” Rettig said.

“I didn’t understand why we wanted to be early adopters of an experiment when we were already early adopters of our own experiment,” Colvin told the press.

Nevertheless, eWASM is gaining steam among several Ethereum developers. Its rollout is closely bound to the Shasper upgrade. It will first be brought out on a sidechain or a shard before replacing the EVM.

“If you’re in the process of building a new client there’s a lot of confusion: Should I be building eWASM? Should I be building EVM? Should I be building both? Should I be building something else,” Rettig said.

Among the major frustrations for Colvin is the lack of clarity. When it comes to the present EVM, there are a few performance issues that can be easily improved but have been side-barred by the immediate shift in the roadmap.

“It’s been a frustration of mine for a while, eWASM was clearly over the horizon, but without too much resources EVM 1.5 was on the near horizon. And now, it’s still doable, but it got pushed, a whole year got wasted,” Colvin said.

Both Colvin and Rettig admit that such uncertainty is merely a part of contributing to an open-source project without central leadership.

“The community aspect is so important. If this was a company I’d be long gone,” Colvin said.

Rettig was also quick to argue that there is no wasted work when it comes to Ethereum developments.

“There is no single Ethereum, there is no single roadmap, there is no single authority, it’s a community, it’s a family of technologies, and I do not believe that the future is just one chain to rule them all,” he said.

eWASM will also unlock new interoperability levels and could pave the way for undiscovered interoperability between various blockchains.

“Maybe you have quadratic sharding over here, and Plasma over here, and maybe they overlap in places, and maybe we have a Dfinity chain talking to an Ethereum chain talking to bitcoin through Cosmos and Polkadot,” Rettig stated, suggesting:

“We just don’t know, so don’t get so caught up in the official canonical roadmap, whatever that may be.”