tpt-e-wasm
RustA #![no_std], zero-allocation WebAssembly micro-runtime for TPT edge devices — sandboxed, hot-swappable .wasm applets pushed over tpt-e-link, managed from tpt-basestation.
Languages
tpt-e-wasm
A #![no_std], statically-allocated WebAssembly micro-runtime and toolchain
for the TPT ecosystem. It plugs into tpt-e-node as an optional capability so
tpt-basestation can push tiny, sandboxed, hot-swappable .wasm "applets" to
edge devices over tpt-e-link — dynamic logic updates without full firmware
OTA rewrites.
Why
- Complements, doesn't replace,
tpt-e-node— the base runtime stays the trusted authority for boot, network, and hardware; tpt-e-wasm is just another capability in thetpt-node-corereactor. - Reuses
tpt-e-link— modules transfer over the existing zero-desync, transport-agnostic framing. - Enhances
tpt-basestation— a new "Wasm App Manager" card for compiling, signing, pushing, and monitoring sandboxed resource usage. - Uses
tpt-zero-*where useful —tpt-zero-jsonfor module metadata parsing in the toolchain,tpt-zero-vecfor guest vector math. Both are vendored (see Upstream integration).
The four crates
| Crate | Role |
|---|---|
tpt-e-wasm-runtime | no_std Wasm interpreter, static memory pool, tick budgets, traps |
tpt-e-wasm-sdk | no_std guest library (Rust + C macros) for writing applets |
tpt-e-wasm-cli | tpt-wasm build/optimize/sign/verify toolchain |
tpt-e-wasm-ui | "Wasm App Manager" card for tpt-basestation (patch set) |
Quick start
# Build the whole workspace
cargo build --workspace
# Run the test suite
cargo test --workspace
# Scaffold, build, sign, and verify an applet (see docs/cli.md)
tpt-wasm new my-applet
cd my-applet
tpt-wasm build
tpt-wasm keygen device-owner
tpt-wasm sign target/wasm32-unknown-unknown/release/my-applet.wasm -k device-owner
tpt-wasm verify target/wasm32-unknown-unknown/release/my-applet.wasm.signed
Documentation
docs/cli.md—tpt-wasmusage guide and first-applet walkthroughdocs/sdk.md— guest SDK API reference (Rust + C header)docs/upstream.md— upstream integration & migration guide (patches, vendoring, rebasing)
Roadmap
Tracked in todo.md. Current progress and phase-by-phase milestones
are documented there. High-level status:
- Phase 0 — scaffold: complete (this tree builds offline from vendored deps).
- Phases 1–3 — runtime, SDK, CLI: complete;
tpt-wasmbuilds, stamps applets with theirCargo.tomlmetadata, signs, and verifies (seedocs/cli.md). - Phases 4–8 — basestation glue, integration, security, perf, DX: see
todo.md; the transport round trip and hardening suites are done, thetpt-basestationcard surface and real-hardware bring-up remain.
Upstream integration
tpt-e-link, tpt-node-core, and the tpt-zero-text workspace are pinned and
vendored under vendor/: tpt-e-node's workspace
references tpt-e-link by relative path and can't be consumed as a git
dependency, and the same holds for the tpt-zero-* siblings. Phase 5 files the
actual upstream patches (Capability::Wasm, new LinkMessage variants) under
patches/; the tpt-zero-* crates carry no patches.
License
Apache-2.0 OR MIT (see LICENSE-APACHE, LICENSE-MIT). Vendored upstream
crates retain their own MIT OR Apache-2.0 license files.