Skip to content

Enable VSS checkpoints and verified staged restore - #27

Merged
Jainakin merged 7 commits into
mainfrom
fix/vss-backup-enabled
Oct 20, 2026
Merged

Jainakin merged 7 commits into
mainfrom
fix/vss-backup-enabled

Conversation

@Jainakin

@Jainakin Jainakin commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Configured VSS gains a durable automatic-backup switch, confirmed upload times and verified pre-unlock restoration. The final clock correction also keeps a valid saved receipt and policy readable when the device clock moves backwards. Signer cleanup, BIP-322 and pinned upstream versions are retained.

  • New wallet/network/endpoint/signer scopes default on. The saved native choice is loaded before startup and wins over initial configuration. Off drains automatic snapshots while preserving manual backup, status, restore and ownership; independent common/KV/fence replication continues. Enabling acknowledges only after a catch-up snapshot. Upload failure preserves the prior choice; an uncertain filesystem commit requires an authoritative metadata refresh.
  • vssBackupMetadata() reports the saved choice and an optional scoped canonical-MANIFEST completion receipt. Historical/restored snapshots without local proof have no invented time. Reads, signing and unchanged clean syncing polls do not upload. BTC/RGB/BFA, address/UTXO and RGB stock/witness mutations are covered; backup failure retains pending state without replaying a successful payment. Existing vssBackupInfo() is preserved. Low-level manual backup retains the SDK DATA/MANIFEST return convention; WDK normalizes its result to the canonical MANIFEST version.
  • Receipt validity checks exact identity/network/endpoint and 1..=8_640_000_000_000_000 milliseconds, independently of the current clock. New completion times use the same bound. Reading, clock correction and cold reopen preserve the original acknowledged time.
  • Restore validates bounded extraction and destination identity, promotes without overwrite, and uses local HMAC proof for interrupted pre-unlock resume. Archived receipts cannot supply local proof; prepared is not unlocked. Missing cloud state cannot initialize an empty wallet. Fence recovery stays explicit; remote erasure is unavailable.

RLN remains v0.17.0-beta.3 (ecc69f20308231400561f6f060fea88acfa40cc4), rgb-lib v0.3.0-beta.50-bfa (1b951af0c8233308c919975552487be19ad2a930) and LDK 79b9eb5166546c62692d3a672986f385c7fe047d. Final maintained adapter: 6d46717b80ffba8ed8af2de023a536af242aadcacbbb799fb9bb89f8933e4ca5.

Final complete Bare source: 78831157b86aea63ef50bbe69f6eeb8c4c0df6fd; companion Node #26: a1fb8291d946685e2e668156ac520f0581302b96. New clock qualification and safety notes. Earlier policy/financial receipts are unchanged.

Final Darwin checks passed 102 installer tests, types, 214 admission cases and 18 terminated-environment immediate signer reopens. All seven Release targets were rebuilt and source/hash/symbol/ELF-admitted: Darwin ARM64; iOS ARM64/device, ARM64 simulator and x64 simulator; Android ARM64, ARMv7 and x64. Official staging/complete distribution passed for all three matching data-only payloads. A fresh four-archive consumer suppressed scripts, ran the reviewed hydrator, verified all seven targets and exercised the actual Darwin runtime. Every packed file was subsequently checked byte-for-byte against the tracked-clean final tree; Apple artifacts were not relabeled or substituted.

Final platform/distribution recheck — 2026-10-19

Source remains exactly 78831157b86aea63ef50bbe69f6eeb8c4c0df6fd; its CI run is green. The unchanged seven-target Release and three-payload complete distribution gates pass again, together with types, 102 installer tests, 214 constructor admission cases, 18 immediate terminated-environment reopens and three BIP-322 crypto tests.

All four existing clock-candidate archives were rehashed and every member was compared again against the exact committed source or independently admitted generated artifact: owner 72 files (70 tracked), iOS 8 (4 tracked), Android ARM 7 (4 tracked), Android x64 6 (4 tracked). Their original hashes and original packed-consumer/runtime evidence remain unchanged. This recheck adds no Android runtime, physical-device, funded-mobile or new financial-flow claim.

Companion Node #26 now has all five native CI platforms passed and a complete five-target archive accepted by the unchanged release checker and a fresh packed consumer. This does not replace Bare's separate seven-target distribution or mobile acceptance requirements.

Frozen local proof: release-evidence/2026-10-19/native-platform-qualification/native-platform-final-qualification.json, SHA-256 45569927c98c9e1d822c27041ed9952d4cc34dac5d08f7327f3401f306579bd8; fresh Bare recheck receipt c2afe82aec6f4ea807f6eb89dcaea4317fd61a0b8ef5a24bba5868e80079f372. Existing source commits, runtime inputs, artifacts and previous evidence were preserved. No documentation-only source commit, rebuild, merge or publication was introduced.

Shared native verification was rerun on the final adapter: 67 passing tests (14 policy, 5 mutation guards, 9 restore admission, 19 UniFFI, 15 CFFI, 5 isolated VSS integrations). Coverage includes canceled-caller upload draining, ownership, encrypted fresh-device restore and clock rollback/bounds. Three additional tests compile the frozen BIP-322 module in isolation; each live host fixture also signs/verifies through its actual addon.

Both final Darwin fixtures are unfunded: default-on/initial-off, pure reads and unchanged-sync stability, paused mutations, manual/off, cold-Off reopen, saved choice overriding initial configuration, catch-up and real scoped completion receipts passed. A temporarily future-dated owned receipt remained readable across cold reopen; it was restored before subsequent actual upload assertions and is not claimed as a real upload time. Unchanged sync polls advanced neither version nor time (18–28 ms). The earlier rejected-upload host evidence keeps its original identity; native failure tests were rerun.

Prior funded qualification remains explicitly at its recorded identities, not the replacement clock adapter:

Local regtest fixture Recorded result
BTC, Node f1156a6 and formatting follow-up 816931e Received 100,000 sats and sent 50,000 back, mined/verified; actual sync and send advanced receipts, unchanged funded sync did not.
BFA, Bare 62fde5d and Node f1156a6 separately Two fresh wallets funded 2,000,000 sats each; mint 2 USDT, send 0.5 while Off (395-sat fee), manual/off backup, return 0.25 while Off (511-sat fee), enable catch-up. Both transfers settled; final Alice/Bob 1.75/0.25 USDT.
Alice versions Bare 23→23→24→24→25; Node 19→19→20→20→21.
Reopen Node reopened both final BFA wallets with exact balances/receipts. Bare reopened after mint before completing the round trip; final two-wallet BFA reopen was not run. Bare separately passed policy/version/time cold-Off persistence.

These disposable host fixtures did not access the simulator or hosted bridge wallet. Earlier funded scripted restore remains a prior-adapter baseline: restored 999,519 sats and three colorable outputs after a 481-sat UTXO fee, BFA metadata equality with zero BFA holdings, pre-unlock promotion/SIGKILL resume and missing-cloud not_found without an empty upload. It does not prove arbitrary post-unlock recovery or mobile seed-import UI restoration.

Upstream external-signer authentication/encryption still derives from complete public bootstrap metadata, with no private signer-derived credential override. Anyone possessing that complete metadata can derive the same VSS identity. The binding does not repair that boundary or replicate the separate signer database/seed. A filesystem failure to persist a pending marker retains current in-memory dirty state, but process death can lose the extra SDK-stock-only signal.

No arbitrary crash/device-loss recovery, complete address discovery, interrupted chunked replacement, remote erase, funded BFA cloud restore, Android runtime, physical-device or full Lightning recovery qualification is claimed. Compilation is not runtime acceptance. Do not merge or publish.

@Jainakin
Jainakin marked this pull request as ready for review October 19, 2026 09:47
@Jainakin Jainakin changed the title Restore VSS backups and expose remote checkpoint status Enable VSS checkpoints and verified staged restore Oct 19, 2026
@Jainakin
Jainakin merged commit c5425a3 into main Oct 20, 2026
4 checks passed
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