tpt-e-wasm

Rust

A #![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.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust96.0%PowerShell2.9%C1.1%
README

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 the tpt-node-core reactor.
  • 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-json for module metadata parsing in the toolchain, tpt-zero-vec for guest vector math. Both are vendored (see Upstream integration).

The four crates

CrateRole
tpt-e-wasm-runtimeno_std Wasm interpreter, static memory pool, tick budgets, traps
tpt-e-wasm-sdkno_std guest library (Rust + C macros) for writing applets
tpt-e-wasm-clitpt-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.mdtpt-wasm usage guide and first-applet walkthrough
  • docs/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-wasm builds, stamps applets with their Cargo.toml metadata, signs, and verifies (see docs/cli.md).
  • Phases 4–8 — basestation glue, integration, security, perf, DX: see todo.md; the transport round trip and hardening suites are done, the tpt-basestation card 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.