Skip to content

[PWABoot] SetBoot — on-chain PWA boot-blob (draft PoC, discussion #759)#760

Draft
Hugegreencandle wants to merge 2 commits into
Xahau:devfrom
Hugegreencandle:feat/pwa-bootblob
Draft

[PWABoot] SetBoot — on-chain PWA boot-blob (draft PoC, discussion #759)#760
Hugegreencandle wants to merge 2 commits into
Xahau:devfrom
Hugegreencandle:feat/pwa-bootblob

Conversation

@Hugegreencandle

@Hugegreencandle Hugegreencandle commented Jun 17, 2026

Copy link
Copy Markdown

Draft / PoC for design discussion #759#759

A storage primitive for a small on-chain "bootloader" blob — the layer-1 root of trust for a Hook's UI. A wallet renders the on-chain stub, which fetches + hash-verifies a larger stage-2 app before running it (secure-boot, rooted in the ledger). The node only stores + serves the bytes; the verify/render/sandbox runtime is wallet-side.

Modeled on the Remarks amendment.

What's here (v0)

  • featurePWABoot (DefaultNo)
  • sfBootBlob (VL, code 33)
  • ttBOOT_SET (105) / SetBoot transactor
  • sfBootBlob as an optional field on AccountRoot
  • SetBoot: amendment-gated; set / replace / delete the sender's own boot blob; fee = base + 1 drop/byte; 4 KB cap. Per-account, owner-key-mutable.

Tests

ripple.app.SetBoot — 3 cases / 53 checks, green: amendment-disabled → temDISABLED; set/replace/delete round-trip on AccountRoot; empty + oversize → temMALFORMED, at-cap ok. (SetHookTSH_test gets a testSetBootTSH stub; full TSH coverage is a follow-up.)

Open for discussion (#759)

  • per-account (here) vs per-hook keying; field-on-AccountRoot (here) vs a dedicated ltBOOT object
  • immutability (tfBootImmutable) — fixed-pin vs owner-key rotation
  • size cap + reserve economics (4 KB placeholder)
  • the wallet resolve → verify → render → capability-sandbox standard
  • an xahc-prover proof of the bootloader's verify core (the "loads-only-verified" invariant) (scoped: proves the gate's accept logic — accept ⟹ candidate hash == pin. The on-chain SetBoot stores the blob verbatim and verifies nothing; the wallet's hashing + stage-2 sandbox stay trusted. Not an end-to-end "whole app proven" claim.)

Marking draft — opening early so the ledger shape can be shaped with @RichardAH / the wallet side before it's polished.

🤖 Generated with Claude Code

Adds the PWABoot amendment: a storage primitive for a small on-chain "bootloader"
blob, the layer-1 root of trust for a Hook's UI (discussion Xahau#759). A wallet renders
the stub, which fetches + hash-verifies a larger stage-2 app before running it; the
node only stores + serves the bytes.

Modeled on the Remarks amendment:
- feature PWABoot (DefaultNo)
- sfBootBlob (VL, code 33)
- ttBOOT_SET (105) / SetBoot transactor
- sfBootBlob as an optional field on AccountRoot
- SetBoot: amendment-gated; set / replace / delete the sender's own boot blob;
  fee = base + 1 drop/byte; 4 KB cap. v0 is per-account + owner-key-mutable.

Tests (ripple.app.SetBoot, 3 cases / 53 checks, green): amendment-disabled =>
temDISABLED; set/replace/delete round-trip on AccountRoot; empty + oversize =>
temMALFORMED, at-cap ok. SetHookTSH_test gets a testSetBootTSH stub (full TSH
coverage is a follow-up).

Follow-ups: immutability (tfBootImmutable), per-hook keying / dedicated ltBOOT
object, the wallet resolve/verify/sandbox standard, and an xahc-prover proof of the
verify core. See Xahau#759

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…audit TA-03/04)

Audit found the fee path was never validated (every submission hard-coded a flat
1,000,000-drop fee, swamping the surcharge) and the delete-when-absent doApply branch
was uncovered. Add:
- testFeeSurcharge: submit exactly base + 1 drop/blob-byte (tesSUCCESS) and one drop
  short (telINSUF_FEE_P) via a no-baked-fee helper, so calculateBaseFee is actually
  enforced — a zero/wrong/sign-flipped surcharge now fails a test.
- testDeleteWhenAbsentIsNoOp: delete a boot blob on an account that never had one ->
  tesSUCCESS, field stays absent (the doApply fall-through branch).
ripple.app.SetBoot now 5 cases / 84 checks, green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant