Skip to content

feat(bootloader): prove the verify-core — "loads only verified bytes"#3

Merged
Hugegreencandle merged 1 commit into
mainfrom
feat/bootloader-proof
Jun 17, 2026
Merged

feat(bootloader): prove the verify-core — "loads only verified bytes"#3
Hugegreencandle merged 1 commit into
mainfrom
feat/bootloader-proof

Conversation

@Hugegreencandle

@Hugegreencandle Hugegreencandle commented Jun 17, 2026

Copy link
Copy Markdown
Owner

The proof side of the layer-1-UI / PWA boot-blob work — Xahau Discussion #759, xahaud draft PR #760.

An on-chain bootloader is the root of trust for a Hook's UI: it fetches a larger stage-2 app and must run it only if the bytes hash to the pinned value. That go/no-go gate is small + bounded — exactly what this engine proves.

prove_bootloader.py proves: accept (hand control to stage-2) ⟹ candidate hash == pinned hash (all 32 bytes). This closes one link — the gate's accept logic — the same byte-exact-equality discipline as the guardrail's dst-lock, here over a 32-byte SHA-512Half. Out of model + trusted (do not read this as "whole app proven"): the on-chain SetBoot stores the blob verbatim and verifies nothing; the wallet's SHA-512Half; stage-2 sandboxing. The proven artifact is a reference model, not a deployed hook.

Matrix

  • bootloader_verify (full 32-byte compare) → PROVEN (0)
  • bootloader_prefix_bug (only 4 of 32 bytes) → COUNTEREXAMPLE (2)
  • bootloader_skip_bug (no check) → COUNTEREXAMPLE (2)

143 tests pass.

Scope (honest): proves the verify gate's accept condition; the wallet supplies the candidate = SHA-512Half(fetched bytes). Stated in the driver docstring.

🤖 Generated with Claude Code

…ied bytes"

The proof side of the layer-1-UI / PWA boot-blob work (Xahau discussion #759,
xahaud PR #760). An on-chain bootloader is the root of trust for a Hook's UI: it
fetches a larger stage-2 app and must run it ONLY if the bytes hash to the pinned
value. That go/no-go gate is small + bounded — exactly what this engine proves.

prove_bootloader.py proves: accept (hand control to stage-2) => candidate hash ==
pinned hash, all 32 bytes. A loader satisfying it cannot be tricked into executing
unverified code, so prove(Hook) + prove(bootloader) = the whole app's trust base
formally verified, UI included. Same byte-exact-equality discipline as the
guardrail's dst-lock, here over a 32-byte SHA-512Half.

Fixtures + matrix: bootloader_verify (full 32-byte compare) -> PROVEN(0);
bootloader_prefix_bug (only 4 of 32 bytes) -> COUNTEREXAMPLE(2);
bootloader_skip_bug (no check at all) -> COUNTEREXAMPLE(2). 143 tests pass.

SCOPE: proves the verify gate's accept condition; the wallet supplies the candidate
hash = SHA-512Half(fetched bytes). Honest about that boundary in the driver docstring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Hugegreencandle
Hugegreencandle merged commit 9dc9a29 into main Jun 17, 2026
@Hugegreencandle
Hugegreencandle deleted the feat/bootloader-proof branch June 17, 2026 11:53
Hugegreencandle added a commit that referenced this pull request Jun 20, 2026
…-SWITCH (primitive #3)

inactivity-release: accept-with-emit => ledger_last_time >= last_seen + TMO (128-bit, underflow-safe)
— a dead-man-switch / inheritance / recovery Hook releases ONLY after the owner has been inactive for
>= TMO seconds; any owner activity (which updates last_seen, slot 0x02) resets the timer. ledger_last_time
is SYMBOLIC -> proven for ALL times. A hook that emits without reading the time OR last_seen fails closed
to COUNTEREXAMPLE.

deadman_ok = the most complex hook yet (TWO behaviors: owner-activity records last_seen=now [only-
increase, keeps monotonic]; cron releases after inactivity), certifying 7 PROVEN invariants:
inactivity-release [NEW] + emit-budget + emit-dst-lock + trigger-lock + nospend + monotonic (across
2 slots) + termination.

AUDITED BEFORE COMMIT (2 parallel auditors): driver sound (no false-PROVEN; byte order verified via the
deadman_ok-PROVEN logic — NO false byte-order CRITICAL this time) + hook sound (owner detection guarded,
inactivity gate underflow-safe, slots distinct/monotonic, emit only on cron+inactive+in-cap, no grief/
premature/over-release). Applied the one fail-closed nit (INCONCLUSIVE on a wrong-length last_seen slot).
deadman_ok->PROVEN, deadman_early_bug->CEX, vesting (no TMO)->N/A. 156 tests, soundness 0 false-PROVEN.
Prover now 35 invariants; 3 certified autonomous primitives (subscription, vesting, dead-man-switch).

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