While new contracts can be written in high-level languages, the ewasm project targets backward compatibility by also supporting the current opcode instruction set and including transcompilation options in its specification.Furthermore, the W3C WebAssembly specification is very wide, covering aspects simply not required by Ethereum.Each opcode is represented by a numerical code and is given a human-readable name in the specification.Otherwise, transaction verification and confirmation would not be possible.The EVM’s initial opcode specification is not optimized for speed on different hardware platforms, nor is it aimed at portability, meaning that tool and language support for writing smart contracts is limited.< 

WebAssembly (WASM)

WebAssembly is a highly optimized binary format for virtual machines.The Bitcoin virtual machine is relatively simple, but a virtual machine for a general-purpose blockchain, capable of supporting Turing-complete smart contracts, requires a more complex instruction set.[Token To Introduction Brief A Sales]

However, there are some caveats.The standard includes an instruction set, intermediate source format (akin to byte code) and an encoding format.

Virtual Machines

Blockchain nodes need to process the transactions that they receive.A number of predefined opcodes can be used to implement a variety of functionalities.Smart contracts, usually written in Solidity, are compiled into EVM code consisting of a sequence of these opcodes in the same way that high-level programming languages are compiled into hardware instructions.Current adoption rate and tool support means that a variety of languages can compile directly into WebAssembly, including Go, Rust, and C/C++.Most importantly, blockchain virtual machines need to be deterministic in their execution, as the code needs to execute exactly the same way on each node.[News 8211 2019 Summary Bitcoin 28 January]


The current EVM has evolved from the early specification, with little change, and has found its limits in terms of performance and flexibility.The EVM’s opcodes are the equivalent of a processor core’s instruction set.However, like most of the Ethereum 2.0 specification, the ewasm project is still a work in progress and may be subject to change. 

The post EWASM (Ethereum Flavored WebAssembly) Explained appeared first on Mycryptopedia.

To comply with Ethereum’s specific requirements, the proposal for a wasm-based EVM in Ethereum 2.0 introduces the concept of Ethereum flavored WebAssembly (ewasm).The EVM constitutes a runtime for executing general-purpose smart contracts.EWASM (Ethereum Flavored WebAssembly) Explained

Ethereum 2.0, also known as Serenity, is a series of planned upgrades that is expected to take place on the Ethereum platform.Therefore, WebAssembly can execute close to native speed on most platforms.Therefore, any WebAssembly feature that may introduce a source of non-determinism must be excluded.It also includes a number of system smart contracts that provide access to Ethereum platform features.[To Grin Mine Coin GRIN How]

Ethereum 2.0 (Serenity)

As the image above shows, the core upgrades expected to be implemented on Ethereum include:

    Phase 0: Beacon Chain Phase 1: Shard Chains Phase 2: Execution Engine

Phase 2 is expected to see the implementation of a new execution engine on the Ethereum platform, and there is rough consensus that that execution engine will be ewasm.



The advantages of ewasm are clear: faster execution speed, improved hardware support, large existing tool support, language portability, and access to the large WebAssembly community and ecosystem.Now, with Ethereum 2.0 approaching, a new EVM specification is being drawn up, which is based on WebAssembly.These changes will be rolled out incrementally over the next few years, and once implemented, it is hoped that these upgrades will produce a more efficient and scalable Ethereum platform that is capable of handling thousands of transactions per second.[Guide Recession Economic Survival]

WebAssembly is a stack-based virtual machine specification, which provides several advantages, such as the ability to adapt easily to any low-level target architecture and high performance.Defined by the World Wide Web Consortium (W3C) as an open standard, the binary instruction format is natively supported by a number of JavaScript engines and other runtime environments, making WebAssembly executable in most modern web browsers.To this end, they run a virtual machine capable of executing the instructions encoded in these transactions.With such an EVM, it should theoretically be possible to write smart contracts in any language that compiles into WebAssembly.


The current proposal to re-specify and migrate the EVM to WebAssemly is motivated by the advantages mentioned above.The instruction set has been specifically designed to leverage features common to most contemporary hardware architectures.Primarily, a wasm-based EVM can leverage improved hardware features and can build on a wide ecosystem of tooling and language support.The ewasm specification consists of a subset of WebAssembly components suitable for Ethereum’s needs, namely determinism and relevant features.[October 8211 22 Summary 2018 News Bitcoin]

The Ethereum Virtual Machine (EVM) is specified in an appendix of the Ethereum yellow paper.For instance, the opcode ADD (as is identified in code by the number 0x01) is interpreted by the EVM to calculate the sum of two 256-bit numbers on the EVM’s stack.
Source: https://www.mycryptopedia.com/ewasm/

No comments yet. Be first to leave one!