Draft
Conversation
- 'Experimental' → 'Chat' (section only contains Chat Settings) - 'Key management' → 'Wallet backup' (section only contains Backup) Reported by Lori (app audit). Copy fix, no structural changes.
Users can now top up their Flash card with Cashu proofs directly
from the mobile app, enabling offline bearer payments.
New files:
app/nfc/cashu-apdu.ts APDU layer for CashuApplet (AID D2 76 00 00 85 01 02)
app/nfc/useCashuCard.ts IsoDep NFC session hook (NfcTech.IsoDep)
app/screens/card-screen/cashu-topup.tsx
6-step top-up screen:
amount → pin → tap card → mint → write → success
app/screens/card-screen/cashu-topup.helpers.ts
extractNonceFromSecret() + toCardWriteProof()
Flow:
1. User enters USD amount + card PIN
2. NFC: SELECT + GET_INFO + GET_PUBKEY (blank card detection)
3. GQL: cashuCardProvision (mints P2PK-locked proofs from user's USD wallet)
4. NFC: SET_PIN (blank) + VERIFY_PIN + LOAD_PROOF × N
5. Card is loaded, ready for offline tap-to-pay at Flash POS
Depends on: lnflash/flash#296 (cashuCardProvision mutation)
Modified:
app/screens/card-screen/card.tsx onCashuTopup() → cashuTopup route
app/components/card/EmptyCard.tsx optional 'Top Up Flash Card' button
app/components/card/Flashcard.tsx optional 'Flash Top-Up' icon button
app/navigation/stack-param-lists.ts cashuTopup: undefined route
app/navigation/root-navigator.tsx CashuTopup screen registered
app/screens/card-screen/index.ts exports CashuTopup
Closes ENG-179
Pure-logic helper tests using babel-jest (avoids ts-jest/TS5.0 incompatibility). 10 tests covering extractNonceFromSecret and toCardWriteProof. Also adds jest.helpers.config.js + tsconfig.helpers.json for running helper-layer tests without ttypescript/ts-auto-mock transforms. Note: the main jest.config.js has a pre-existing breakage — ttypescript is incompatible with TypeScript 5 (read-only createProgram); ts-jest 29.4.6 requires TS >= 5.3 but flash-mobile has 5.0.4. These are pre-existing issues unrelated to ENG-179. Run: npx jest --config jest.helpers.config.js __tests__/card/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Users can top up their Flash card with Cashu proofs directly from the mobile app, enabling offline bearer payments (NUT-XX Profile B).
New NFC layer
app/nfc/cashu-apdu.ts— APDU layer for CashuApplet (D2 76 00 00 85 01 02)app/nfc/useCashuCard.ts—NfcTech.IsoDepsession hook withstartSession / cleanup / readBlankCardPubkey / writeProofsNew screen
app/screens/card-screen/cashu-topup.tsxUX entry points
Depends on
cashuCardProvisionGQL mutation (ENG-174/175)