WebAssembly
on ICP
A advantage of the Internet Computer blockchain is its use of WebAssembly for executing smart contracts and decentralized applications — written in a wide variety of languages that compile to WebAssembly.
WebAssembly was designed from the ground up to be secure, safe, and fast. Such characteristics enable the Internet Computer to run scalable decentralized applications for clients and enterprises.
Why WebAssembly
The Internet Computer executes the code of an application on multiple decentralized nodes, which are operated by node providers who are selected and vetted by the NNS token holders. This replicated execution works even in the presence of untrusted and malicious nodes. A critical property for replicated execution is its determinism, which refers to executing identical code with the same inputs, invariably yielding the same result. This deterministic execution is a fundamental feature upon which the Internet Computer depends, and it's a guarantee provided by WebAssembly.
WebAssembly is becoming a de-facto standard for secure and safe computation, with benefits for both the server side of systems and the client browser side. Its ecosystem is continuously growing thanks to contributions from industry, academia, and open source enthusiasts. The Internet Computer is a secure platform to run server WebAssembly components and code in a more distributed and secure execution environment where developers and enterprises can leverage all this work to build powerful decentralized applications.
WebAssembly and Cloud
The Internet Computer aims to bring decentralization and statefulness to cloud computing. Conversely, it can be also viewed as bringing cloud features such as fast, scalable, general-purpose computation into the domain of blockchain. WebAssembly is well suited for this mission because it is a general-purpose, sandboxed virtual machine that was designed to be secure, safe, fast, and deterministic.
WebAssembly vs EVM
WebAssembly and EVM are similar in the sense that they both are virtual machines for blockchains. The main difference is that WebAssembly is general-purpose and supports many programming languages. WebAssembly on the Internet Computer provides several orders of magnitudes higher compute and storage capacity to its applications.
Since WebAssembly is more expressive and performant, it can even emulate an EVM. This approach is currently being explored by Bitfinity EVM, an ICP community project.
Joining forces to develop WebAssembly
Contributing to open standards, enhancing performance, and fostering collaborative research.
Bytecode Alliance
DFINITY is a member of the Bytecode Alliance, an organization that develops the Wasmtime runtime, which is a high-performance implementation of the WebAssembly standard.
Open Standard
WebAssembly was co-designed by Andreas Rossberg, who also contributed to the development of the WebAssembly standard. The open standard is overseen by the World Wide Web Consortium (W3C), an organization with over 400 members, including DFINITY.
WebAssembly Research Center
DFINITY is a founding member of the WebAssembly Research Center at Carnegie Mellon University (CMU). Under the direction of Ben Titzer, a co-designer of WebAssembly, this Center is the first to bring together researchers from academia and industry to explore the potential of the platform and its emerging applications.
Canister Development Kits
WebAssembly allows ICP developers to write canister smart contracts in any of these programming languages
Rust
Offers high performance, and many libraries that the Rust community developed over the years. Supported, and maintained by DFINITY.
Motoko
The Internet Computer’s native language, designed to support all features ICP has to offer, and has a less steep learning curve compared to Rust. Supported, and maintained by DFINITY.
TypeScript
Developed by Demergent Labs, Azle is a TypeScript CDK for the Internet Computer enabling developers to write canisters using JavaScript.
Python
Developed by Demergent Labs, Kybra is a Python CDK for the Internet Computer. In other words, it's a Python runtime for building canisters on ICP.