Skip to content

Host tool: lend a throwaway mainnet key for Lantern Zero's key check (#61) - #100

Merged
gf5901 merged 1 commit into
mainfrom
feat/mainnet-lend-host-61
Nov 16, 2026
Merged

gf5901 merged 1 commit into
mainfrom
feat/mainnet-lend-host-61

Conversation

@gf5901

@gf5901 gf5901 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Part of #61: the "production key-storage check" prep step. The app is unchanged. Mainnet wallets in the app still never lend a viewing key.

Lantern Zero's production check (no key-derived data on disk, in logs or in backups) needs a real mainnet lease. This lets the host tool make one from a throwaway mainnet wallet, so no real wallet's key is lent.

  • New Cargo feature host-mainnet-alerts, which no app build enables. With it, the engine's host_lend_mainnet_key() lifts the mainnet and view-only checks in alerts_allowed and lets lantern_wake_keys lend the Orchard IVK. It isn't exported to Swift or Kotlin.
  • examples/lantern: --mainnet (wallet in data/mainnet/<NAME>, production relay lz-api, gateway push.lanternzero.com) and --lend-key (needs the feature and --mainnet).
  • Tests: a mainnet view-only account lends nothing in a normal build. With the feature, the host tool lends a uivk1… key.
  • CI and scripts/check.sh run clippy and the lib tests with the feature too.

Run:

cargo run --release --example smoke -- --mainnet throwaway-ufvk \
  | cargo run --release --example smoke -- --mainnet --wallet lend view
# put a production connection URL in data/mainnet/lend/lantern-url.secret
cargo run --features host-mainnet-alerts --example lantern -- --mainnet --lend-key --wallet lend connect --scan
cargo run --features host-mainnet-alerts --example lantern -- --mainnet --lend-key --wallet lend wake

Not done yet: a real run against production, and the server-side check itself (lanternzero-ops notes/legal/scanning-risk-assessment.md).

🤖 Generated with Claude Code

Lantern Zero's production key-storage check needs a mainnet lease, and
the app never lends a mainnet viewing key. A Cargo feature,
host-mainnet-alerts, that no app build enables, lets the host tool lift
the mainnet and view-only rules for a throwaway wallet:

  smoke --mainnet throwaway-ufvk | smoke --mainnet --wallet lend view --birthday H
  cargo run --features host-mainnet-alerts --example lantern -- \
    --mainnet --lend-key --wallet lend connect --scan

examples/lantern also gains --mainnet (data/mainnet/<NAME>, production
relay and gateway). Tests cover both builds; CI and check.sh lint and
test the feature too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gf5901
gf5901 merged commit 1e820d4 into main Nov 16, 2026
4 checks passed
@gf5901
gf5901 deleted the feat/mainnet-lend-host-61 branch November 16, 2026 22:37
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