DISCOVER // Nov 22, 2024 // 7 MIN READ

What is WAVS? The Framework Powering Actively Validated Services on Layer

Share this article
What is WAVS? Framework for decentralized AVS development

In our last blogpost, we described, at a high level, what Layer is. In this blogpost, we’ll start to talk about how Layer works.

Layer is built around WAVS, a runtime for building Actively Validated Services (AVSs). This blogpost explains what WAVS is and why it makes Layer so powerful.

In the beginning, there was WASM

Our story begins with WASM

WebAssembly, commonly known as WASM, is a virtual machine standard. It provides a highly performant way to execute code on multiple platforms, enabling a low-level assembly-like language that can be run securely in a sandboxed environment (for example, a web browser or, pertinent to our use case, a blockchain validator).

Originally, WASM was developed by major browser vendors—Mozilla, Google, Microsoft, and Apple—to overcome the limitations of JavaScript for performance-critical applications. Their motivation was to create a portable, language-agnostic runtime that could safely run high-performance applications directly in the browser. WASM unlocked new possibilities for web-based games, video editing, scientific computing, and other compute-heavy applications, all within the security sandbox of a web browser.

One of WASM’s key strengths is its support for multiple languages, including memory-safe languages like Rust. Languages like Rust ensure that developers can write secure, performant applications without worrying about low-level memory vulnerabilities. The memory safety provided by languages like Rust is particularly valuable in blockchain contexts, where security vulnerabilities can have severe financial implications.

Now there is WASI

Where WASM allows performant, safe code to target diverse platforms, WASI lets that code access server-side functionality. For Layer, WASI lays the groundwork for off-chain compute.

WASI enhances WASM with system interfaces, providing a way for WASM to communicate with deeper, system-level functions. While WASM allows applications to run securely within a browser or similar sandboxed environment, WASI lets WASM interact with system-level functions like file systems, network interfaces, and hardware resources (like GPU processing). For Web3, this means WASM applications can now interact with blockchain nodes, make network calls, and even utilize GPUs for machine learning or AI tasks.

WASI utilizes the power of WASM to access lower-level OS systems capabilities like network calls, GPU processing, file storage, and (for web3 uses) the EVM. On top of that, WASI has a composable architecture, allowing developers to build intelligent protocols that abstract (potentially highly complex) system-level capabilities.

If you were around at the dawn of Node.js: WASI is to WASM as Node.js was to the V8 Javascript engine. It turns your preferred language (WASI/Rust, Node.js/Javascript) into a highly portable system language.

Enter WAVS

On top of WASI and WASM comes WAVS, a framework for building AVSs with WASI. As we described in our last blogpost, one of Layer’s primary functions is to enable actively validated services, or AVSs, on Ethereum L2s.

Using WASI, WAVS allows those AVSs to do anything. WASI lets AVSs do off-chain compute. With that capability, AVSs can run (or train) large language models. They can make network calls. They can spin up services of arbitrary complexity that run off-chain, but are directed by on-chain governance. With WAVS, you can build performant decentralized applications with ease.

WASM boasts excellent performance compared to other portable systems-level solutions, like Docker

In the last blogpost, we described a hypothetical use case: an LLM-powered bouncer for a Discord server. This use case illustrates the power of community governed off-chain compute. But the true power of WAVS emerges from its modular design. WASM components can be composed—smart contracts and AVSs can combine to create intelligent protocols that are reactive and verifiable on-chain.

Zooming out: The Layer vision

Layer allows users to compose these AVSs together. In the aggregate, these powerful AVSs will eventually constitute a decentralized ecosystem where cooperation is enforced by cryptography rather than courts, and where communities can govern themselves without external interference. Like commitment protocols, Layer allows users to embed trust directly into the fabric of their networks. 

Whether it’s through staking tokens to secure AVSs or collectively governing AI-driven services, Layer transforms human cooperation by allowing users to dictate the rules of their digital environments.

In the next blog post, we’ll take a deeper dive into how AVSs work on top of WASI, how commitments provide economic security, and how those commitments in aggregate produce powerful network effects.

Share this article

Sign up to our newsletter

Stay up to date with the latest news and developments from LAYER

Thank you for subscribing

You’re all set to receive our latest updates and content straight to your inbox.

Join the Layer community
Oops! Something went wrong while submitting the form.