gitwtfhub

wtf is spacewasm?

nasa/spacewasm — explained in plain English

Analysis updated 2026-05-18

1,335RustAudience · developerComplexity · 5/5LicenseSetup · hard

TL;DR

A NASA JPL WebAssembly interpreter built to run sandboxed code safely on board spacecraft, with strict memory rules for flight software.

Mindmap

mindmap
  root((SpaceWasm))
    What it does
      Decodes Wasm binaries
      Interprets code on spacecraft
      Streams input in chunks
    Tech stack
      Rust
      WebAssembly
    Use cases
      Run spacecraft command sequences
      Sandbox untrusted flight code
      Test WASI programs via spacewasi
    Audience
      Flight software engineers
      Embedded systems researchers
    Constraints
      Deterministic memory use
      No panics on allocation failure

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Run spacecraft command sequences as WebAssembly modules instead of mission specific formats.

REASON 2

Sandbox untrusted or low trust code so it can run on board without risking flight software.

REASON 3

Stream a WebAssembly binary into the interpreter in chunks to keep peak memory usage low.

REASON 4

Test WASI 0.1 compatible WebAssembly programs locally using the included spacewasi tool.

What's in the stack?

RustWebAssembly

How it stacks up

nasa/spacewasmwebstonehq/tuxedolitellm-labs/litellm-agent-control-plane
Stars1,3351,2011,069
LanguageRustRustRust
Last pushed2026-07-012026-06-20
MaintenanceActiveMaintained
Setup difficultyhardeasymoderate
Complexity5/52/54/5
Audiencedeveloperdeveloperpm founder

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1day+

Aimed at resource-constrained flight software, understanding the memory and streaming constraints takes real study.

Use freely for any purpose, including commercial use, as long as you keep the copyright and license notices.

Wtf does this do

SpaceWasm is a NASA JPL project that lets spacecraft run WebAssembly programs on board, following the Wasm 1.0 specification. WebAssembly is a compact, sandboxed format for executable code that was originally built for web browsers, and this project adapts it so it can run safely inside flight software, the software that actually controls a spacecraft. The README explains the reasoning behind this choice in a few parts. High level spacecraft activities, like driving the Mars rover or checking temperature readings, are usually described as command sequences that live outside the core flight software, and different missions have historically built their own incompatible ways of doing this. Using WebAssembly gives them one shared standard instead. WebAssembly's sandboxing also means less trusted code can be uploaded and run on a spacecraft while flight software still limits what it can access and how much time or memory it can use, which can shorten the lengthy testing process usually needed before new autonomy software is allowed to fly. SpaceWasm has two main parts: a decoder and validator that reads a WebAssembly binary in small chunks and turns it into a form ready to execute, checking it for correctness as it goes rather than in a separate pass, and an interpreter that actually runs that code using a custom internal representation designed to be fast to execute rather than working directly on the original raw bytecode. Because it runs on spacecraft, SpaceWasm follows strict memory rules: memory is only ever allocated in fixed size blocks called pages, memory cannot be freed before it was allocated, sub regions inside a page cannot grow or shrink, memory use must be predictable ahead of time, and an allocation failure must never cause a crash. It also supports reading a WebAssembly binary in a streaming fashion, a chunk at a time, instead of requiring the whole file to sit in memory at once, since spacecraft systems typically have small, fixed memory budgets. A companion tool called spacewasi lets you run WASI compatible WebAssembly programs from the command line for testing. SpaceWasm is released under the Apache 2.0 license.

Yoink these prompts

Prompt 1
Explain how SpaceWasm's streaming decoder keeps peak memory usage low on constrained hardware.
Prompt 2
Show me how to compile and run a WASI program with the spacewasi tool in this repo.
Prompt 3
Walk me through the memory allocation rules SpaceWasm follows and why each one exists.
Prompt 4
Help me understand the difference between SpaceWasm's intermediate representation and raw Wasm bytecode.

Frequently asked questions

wtf is spacewasm?

A NASA JPL WebAssembly interpreter built to run sandboxed code safely on board spacecraft, with strict memory rules for flight software.

What language is spacewasm written in?

Mainly Rust. The stack also includes Rust, WebAssembly.

What license does spacewasm use?

Use freely for any purpose, including commercial use, as long as you keep the copyright and license notices.

How hard is spacewasm to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is spacewasm for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.