feat(access): Bolt Card tap-to-enter access gate (ADR-003) #86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/access-control-skeleton"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds an opt-in access gate: the terminal boots into a
lockedstate and a single Bolt Card tap unlocks it and pre-loads the card, so buy/sell only need a Complete press — no second tap. Rebased onto currentdev; validated live on the batm3.The flow
Key design: soft entry, verify-at-payment
A Bolt Card tap yields single-use SUN
p/c, so we can't both verify at entry and reuse for payment. Resolution:lnurlwlocally (external_idonly) — no server call, so the p/c stay valid. Only theexternal_idis ever hashed; the p/c never touch the authorize layer (KYC-free).lnurlwmoves sats via the existing #83/#84 paths (executeLnurlWithdraw/resolveCardInvoice). The hard check lands where money moves.Non-breaking:
accessControl.enableddefaults off → thelockedstate'salwaysbypass settles straight toidle, identical to today. Enabled per-machine via/var/lib/bitspire/access.json(provisioning, no rebuild).Commits
lockedstate +ACCESS_GRANTED/ACCESS_DENIED/DEV_UNLOCK+accessBypass/devUnlockAllowedguards;services/access(authorize, allow-list, salted hashes); config loader; ADR-003.boltcardcredential (external_id + lnurlw) + local parser;loadedBoltCardsession state; NFC routing (locked→enter);completeWithCard; card-onlyLockedView; Complete buttons on the cash views./on re-lock so the reopened gate lands onIdleView, not the stale transaction view (fixes a stuck "collect" screen found in testing).IDLE_LOCK_TIMEOUT(60s) onidle → locked(guarded to gate-active) so an unattended unlocked session with a loaded card returns to the lock screen.confirmAbandon/ an in-flight dispense and could strand a customer's bills. Every transaction already returns tolockedon its own, so the timers just defer until the machine is back at the menu.ACCESS_DEV_UNLOCKis now opt-in andaccess.example.jsonships it off, so a gated machine never shows a bypass button unless asked.Product decisions (this PR)
Soft entry · open enrollment (any card) · card-only (npub-QR/PIN dropped from the entry UI, but the union + allow-list + PIN code paths remain for future use).
Tests / validation
…/nostrrelay/sapien.Notes
1.1.1-aio.1/payendpoint for the buy path (already forked/tagged).fix/nfc-reader-auto-recovery(#85) only on the throwawaydeploy/access-plus-nfc-recoverybranch used for the on-device build; that fix is its own PR.🤖 Generated with Claude Code
984ae9d71eto82fbf12950