Super Testnet v0

A small browser-native Bitcoin playground: create a test-only wallet, mine fake BTC, sign a MIME inscription, see it in that wallet’s collectibles, and follow its transactions into a local block.

This is a private, single-browser simulation inspired by Supertestnet. It uses real Bitcoin transaction serialization, Schnorr signatures and Taproot commit/reveal envelopes. It is not Bitcoin Core, public testnet, signet, regtest consensus, an Ord indexer, or production custody. There is no mainnet mode and no external broadcast path.

Run locally

Requires Node.js 20.19+ (Node 22 recommended) and npm.

npm ci
npm run dev
# Open http://localhost:5173

For the exact production server:

npm run build
npm start
# Open http://localhost:8080

Use localhost or HTTPS: secure-context Web Crypto and Web Locks are required. Chromium is the verified browser; recent browsers supporting Web Locks and Array.toReversed should work. No API keys, Bitcoin node, faucet, CDN, database, account or environment file is needed. Runtime assets are local. Installing dependencies requires network access; the built app makes no third-party requests. It is not an installable/offline service-worker app.

Complete the loop

  1. Create test wallet, or load a previously saved Super Testnet wallet JSON. Wallet creation never signs a transaction.
  2. Mine a block: receive 50 fake BTC immediately, without coinbase maturity.
  3. Choose text/plain, application/json, text/html, image/svg+xml, image/png, image/jpeg or image/webp. Edit text or upload a local file of up to 16,384 bytes (16 KiB). No remote fetching. Optionally select an owned inscription as its immutable parent. Review inscription shows the payload and costs without signing.
  4. Sign & inscribe explicitly signs a commit and a reveal locally. Fees total 1,000 fake sats; 1,000 fake sats remain in the inscription output. Both transactions enter the local mempool atomically. A child reveal also signs the parent input and returns its full value to the same wallet. After successful persistence the content, file, parent, review and byte counter reset; failures preserve the composer.
  5. The inscription immediately appears as pending in this wallet’s collectibles. Mine again to confirm both transactions in one block.
  6. Open the inscription, its reveal, its commit, or its block in the integrated explorer. Raw transaction hex and witnesses are visible. Reload to verify persistence.

Wallet ownership is derived from the unspent reveal output’s script, not a disconnected UI list. Commits spend ordinary change. Child reveals explicitly spend and preserve an owned parent output, tracked at its current outpoint. Parent and children links support nested lineage, including pending ancestors. Loading another wallet on the same chain displays only that wallet’s collectibles.

Save test wallet exports its tagged test key, not chain history. Save complete lab exports both wallet and chain, including pending transactions, and is the portable recovery option. Loading a complete lab replaces local state after an explicit prompt. Clearing site data/resetting the lab destroys local state unless you have a backup. Explorer hash links work only with the matching local chain; they are not public explorer links. A different origin (including localhost vs Fly) has separate browser storage; use a complete lab backup to move it.

Architecture

  • src/adapters/wallet.js: test-wallet creation/loading, regtest-format bcrt1p address and explicit signing primitive. Only tagged v0 test backups can be imported; there is no arbitrary production-key input.
  • src/adapters/chain.js: instant 50-BTC coinbase, UTXO set, package validation, mempool, synthetic blocks and replayable snapshots. Validates transaction shape, values, spent inputs, default Schnorr signatures and the supported Taproot script/control block. Exposes mine, submitPackage, coins, balance, snapshot.
  • src/adapters/inscription.js: MIME/byte envelope with optional tag 3, commit/reveal construction, confirmation/ownership view. prepare does not sign; inscribe is invoked only after the user’s explicit signing action.
  • src/upstream/primitives.js: small attributed adaptations of Supertestnet’s input/output helpers. See provenance.
  • LocalRPC: in-process read facade for getblockcount, getblockhash, getblock, getrawtransaction. It is deliberately partial, not wire-compatible bitcoind JSON-RPC. A future Core or node_faker adapter can replace this boundary.
  • src/storage.js: versioned localStorage snapshot; index/UTXO reconstruction with transaction validation on load. One atomic storage write per operation; failed validation/quota writes do not publish partial in-memory state. Web Locks serialize mutations across tabs; storage events refresh other tabs.
  • server.js: dependency-free static file server with security headers and /healthz. No signing, chain state, RPC, database or wallet secrets on the server.

Exact v0 limitations

  • Blocks are custom JSON hashed with SHA-256, not Bitcoin block headers. No proof of work, difficulty, merkle tree, reorgs, peers, chain synchronization, coinbase maturity, halving or full consensus. Fixed 50-BTC rewards; fixed 500-sat fees per non-coinbase transaction are burned.
  • Only this app’s single-input Taproot key-path and narrow ord MIME script-path templates, plus explicit two-input child reveals, are accepted. No general Script interpreter, legacy/SegWit-v0, timelocks, arbitrary transactions, fee estimation, transfers or replace-by-fee. Regtest-format addresses do not make the chain compatible with Bitcoin Core. Never fund these addresses elsewhere.
  • One inscription per reveal, 1,000-sat postage, 16 KiB body cap and 520-byte script pushes. Parent tag 3 encodes reversed txid bytes plus a minimal little-endian index; validation requires the referenced parent input, its signature, and preservation in the same wallet. Only one parent per child. Parent identity and lineage survive relocated outputs and cannot be edited. Other collectible spends are rejected, including untagged parent spends (which create no provenance). This is an intentionally simplified local ord-like model: no sat-offset/ordinal tracking, full ord indexing or Bitcoin consensus compatibility. No BRC-20 execution, recursive resource resolution, general transfers or external Ord compatibility guarantee.
  • Text/JSON previews use escaped text; JSON is not schema-validated. HTML/SVG use an inert, restrictive element/attribute allowlist in sandboxed blob frames with no scripts, navigation or network resources. Rendering is intentionally lossy (no linked images, fonts, scripts or embedded frames). Raster previews use local blobs; MIME declarations do not guarantee valid image data. Body bytes are preserved exactly even when previews cannot render them.
  • One active wallet per origin. Test secret and chain are unencrypted in browser storage and JSON backups. No mnemonic, password, hardware wallet, key derivation, custody service or hardened security audit. Tagged JSON is an accidental-import guard, not proof a key has never been used elsewhere. Never put production secrets in these files.
  • No persistent server database, volume or shared chain. Browser storage quotas apply; large histories replay synchronously and eventually become slow. A maximum of 1,000 pending transactions (500 inscriptions) per block; complete lab imports capped at 5 MB. Built for small experiments.
  • Mining signs nothing; only Sign & inscribe signs the two displayed operations. Restoring state verifies signatures but does not create new ones. Exporting backups exposes the fake wallet key in the downloaded file.
  • No network security or economic assurances: a user controlling their browser can rewrite their entire private lab. Validation is useful for testing this flow, not an adversarial consensus boundary.

Verification

Verified for this extension: npm test passed all 13 adapter tests, npm run build passed, and Playwright passed all 14 desktop/mobile tests against the production server. The minimal worker required Chromium, runtime libraries and fonts staged under /tmp; no system packages or deployment were changed. Run:

npm test
npx playwright install --with-deps chromium
npm run test:e2e

The adapter suite covers ownership, real signed commit/reveal construction, confirmation, RPC inspection, pending/confirmed restoration, malformed imports, MIME/byte round-trips and size limits, parent ownership/preservation, fraudulent tags, untagged parent spends, nested lineage, bad signatures, modified payload/control blocks, over-spending, atomic rollback, double-spending and collectible protection.

Playwright tests the production build/server, at desktop and Pixel 7 mobile sizes: full loop, review-before-signing, pending persistence, transaction/block navigation, complete backup/reset/restore, wallet imports, invalid input, two-tab concurrent mining, composer reset and failure preservation, non-text uploads, parent navigation, sandbox preview safety, no third-party requests and no horizontal overflow. Screenshots/traces are written to ignored test-results/.

Independent Fly deployment

Dockerfile builds static assets and runs a non-root Node static server. fly.toml targets only supertestnet, one shared CPU, 256 MB RAM, HTTPS, health checks, scale-to-zero, and no volume or database. No Teahub app, service, secrets or network integration is configured. No custom domain is configured.

From a worker with authorized Fly CLI/account access, create the new app in the intended organization, then deploy:

fly auth whoami
fly apps create supertestnet --org YOUR_AUTHORIZED_ORG
fly deploy --app supertestnet --config fly.toml --ha=false
fly status --app supertestnet

Use --ha=false to avoid a redundant second machine. If the app name already exists, verify its ownership and purpose before deploying; do not overwrite an unrelated app. Expected URL after successful creation: https://supertestnet.fly.dev.

Current worker deployment status: not deployed. Neither fly nor flyctl is installed/on PATH, no default ~/.fly configuration is present, and no Fly credential environment variables are configured. Authorized account access could not be established; no app was created and no credentials were invented. Docker is also unavailable here, so the image was not built locally; the identical production Node server is exercised by Playwright. Fly app-name availability and deployment remain unverified.

Configuration references: Fly app configuration, Fly deploy options.

Attribution and licenses

See PROVENANCE.md for upstream commit pins, exactly what was adapted, what was only inspiration, and the node_faker decision. License texts ship in public/licenses/ and the app links them. No upstream UI, network relay, mainnet API or remote script loader was imported.

S
Description
Create and operate lineage holdings on a toy chain in the browser: found, birth, award, decide, graduate, close, one beat at a time. Built on Super Testnet. Test coins only.
Readme
873 KiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 92.5%
CSS 4%
HTML 3.5%