Web Node
The web node is an experimental implementation of the Mina Rust node compiled to WebAssembly, enabling users to run a fully functional Mina node directly in their web browser. This eliminates the need for native software installation and pushes the boundaries of decentralized infrastructure.
See the Docker deployment guide for the easiest way to run a web node without building from source.
Overview
The web node leverages WebAssembly (WASM) technology to bring the full power of the Mina Rust node to web browsers. This enables block production, transaction validation, and network participation without traditional infrastructure requirements.
Features
- Browser-based node - Run a complete Mina node in Chrome, Edge, or Safari
- Block production - Participate in consensus directly from your browser
- P2P networking - Connect to other nodes using WebRTC
- State management - Maintain blockchain state in browser storage
- Zero installation - No software installation or system configuration required
Architecture
The web node consists of two main components:
- WebAssembly module - The Mina Rust node compiled to WASM, providing core blockchain functionality
- Frontend application - An Angular application that hosts the WASM module and provides the user interface
Prerequisites
Rust toolchain
Install the Rust toolchain (required for WASM compilation):
# Install rustup with default stable toolchain
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.92
# Setup the current shell
source "$HOME/.cargo/env"
Node.js
We recommend using the latest Node.js version specified in the .nvmrc file at
the root of the repository. As of this writing, You can use a Node.js version
manager like nvm to easily switch to the correct version.
For more information on how to install Node.js, please refer to the official Node.js documentation.
Building from source
Clone the repository
git clone https://github.com/o1-labs/mina-rust.git
cd mina-rust/
Install nightly toolchain and WASM tooling
make setup-wasm
Download circuit files
The web node requires circuit files for proof verification:
make download-circuits
Build the WebAssembly module
make build-wasm
The web node WASM build requires nightly Rust for certain unstable features used in the WebAssembly compilation. The build process automatically handles the toolchain selection.
Install frontend dependencies
cd frontend
make install-deps
Running the web node
Development mode
Start the development server:
cd frontend/
make start-webnode
Access the web node at http://localhost:4200
Production build
Build an optimized production bundle:
# Enter frontend directory
cd frontend
# Build with Web Node production configuration
make build-webnode-production
The built files will be in frontend/dist/ and can be served by any static web
server.
Block producer mode (optional)
By default, the web node runs in observer mode. To produce blocks, you need to generate an encrypted keypair and supply it to the interface upon starting the web node. Run this from the repository root:
#!/bin/bash
set -eou pipefail
# This creates `web-node-key.zip` containing:
#
# - `producer-key` (encrypted private key)
# - `producer-key.pub` (public key)
# - `producer-key-password` (password file)
# Create temporary working directory
mkdir producer-key-tmp
# Create password file
echo "mypassword" > producer-key-tmp/producer-key-password
# Generate encrypted key pair
cargo run -r --bin mina -- misc mina-encrypted-key \
--file producer-key-tmp/producer-key \
"$(cat producer-key-tmp/producer-key-password)"
# Package into ZIP for upload through the web interface and clean up intermediates
cd producer-key-tmp
zip web-node-key.zip producer-key producer-key.pub producer-key-password
mv web-node-key.zip ../
cd ../
rm -rf producer-key-tmp
Update the script to set your desired password. The encrypted key will be stored
in web-node-key.zip and can be imported into the web node interface.
Related documentation
- Web node WASM API - JavaScript API for interacting with the web node programmatically
- Docker deployment - Run a web node using Docker without building from source
- Browser compatibility - Supported browsers and minimum versions
- Mainnet readiness - Web node requirements for mainnet