Skip to content

Trustless in-tab full node: run skycoin/fibercoin daemon in the wasm visor (storage-backend + signed-snapshot fast-sync) #3446

Description

@0pcom

Vision

Run a full skycoin/fibercoin node inside the wasm visor (browser tab) — a trustless in-tab wallet that verifies the chain locally instead of querying a remote full node it doesn't control. Now that skywire + dmsg run in the browser (demonstrated by the skycoin-web thin-client integration over dmsg), the networking constraint that made this unthinkable has evaporated: the tab already talks peer-to-peer over the mesh. What's left is storage + sync — an implementation problem, not a physics one. Likely a first-of-its-kind (browser full node for a UTXO chain).

Why it's worth it (the value, not just the flex)

  • Privacy: querying a remote full node for balances/history leaks which addresses you care about to a node you don't control. A local node answers those queries against your own verified copy — nothing leaks. (We can still offer the remote path too — connect over dmsg to a full node you control — but local is the strongest privacy posture.)
  • Trustlessness: verify the chain yourself rather than trusting a remote node's answers.
  • Abstraction fit: the daemon is "external" today only because of its storage engine, not because of what it is. Swap the backend and it becomes another internal-app RunFunc with a wasm body — the exact pattern skycoin-web now uses, one layer deeper (the seam moves from "serve the SPA" to "what's my KV backend").

The real constraints (and why they're tractable)

  • bbolt is the wall. It needs mmap + flock + POSIX file syscalls; js/wasm has no filesystem and wasip1 mmap/lock support is flaky. Stock storage is DOA in a tab. → Swap the backend behind skycoin's DB interface to an OPFS- or IndexedDB-backed KV store. (SQLite already ships a wasm build on an OPFS VFS — persistent DB-in-a-tab is proven, shipping tech.)
  • wasm32 4 GB address space → can't hold the ~700 MB chain all in RAM; need a paged, on-disk-shaped store (→ OPFS), not in-memory.
  • Sync/verify cost. skycoin's single-block-publisher consensus has no PoW to replay — verification is signature-checking + tx/UTXO rules, far cheaper than a PoW browser node. This also enables fast-sync from a signed UTXO snapshot (trust the publisher's signature from a checkpoint forward), collapsing both sync time and footprint.
  • Fibercoins (small/fresh chains) are feasible sooner — a tiny chain could run a full node in a tab today, even in-memory. skycoin mainnet is the harder case but not a wall.

Rough path (research-grade, not near-term)

  1. Abstract skycoin's block/UTXO DB behind a KV interface (if not already).
  2. OPFS/IndexedDB-backed KV backend for the wasm build (mirror the SQLite-wasm-on-OPFS approach).
  3. Signed-snapshot fast-sync (checkpoint UTXO set + verify forward) — leverage the block-publisher signatures.
  4. Register skycoin-daemon as an internal app with a wasm RunFunc (same launcher path as skycoin-web / skychat), backed by the wasm KV store; blocks fetched over dmsg.
  5. Local wallet queries hit the in-tab node; keep the dmsg-remote-node option for users who prefer it.

Status

Deliberate detour, not near-term. Keep the daemon external for now (thin-client-over-dmsg is the default). Filing so the design + rationale aren't lost — the day someone wants a trustless in-tab node, skycoin is the chain most likely to make it actually work, and the internal-app abstraction means the daemon can graduate later without breaking the model.

Related: skycoin-web internal-app integration + wasm Apps-tab convergence (the abstraction this builds on).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions