From 4c758f4665e97811803d4d02c83be70bb293affc Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Sun, 14 Aug 2022 10:48:23 -0600 Subject: [PATCH] re-create @iWarpBTC commit ID a9df953990ea454e8cafc87f64395efc1929c321 --- lnbits/extensions/boltcards/README.md | 31 ++++- lnbits/extensions/boltcards/crud.py | 2 +- .../boltcards/templates/boltcards/index.html | 127 +++++++++++++++--- 3 files changed, 138 insertions(+), 22 deletions(-) diff --git a/lnbits/extensions/boltcards/README.md b/lnbits/extensions/boltcards/README.md index e9d1d9cc..ca239e42 100644 --- a/lnbits/extensions/boltcards/README.md +++ b/lnbits/extensions/boltcards/README.md @@ -1,10 +1,31 @@ -

Bolt cards (NXP NTAG) Extension

+# Bolt cards (NXP NTAG) Extension This extension allows you to link your Bolt card with a LNbits instance and use it more securely then just with a static LNURLw on it. A technology called [Secure Unique NFC](https://mishka-scan.com/blog/secure-unique-nfc) is utilized in this workflow. -**In order to use this extension you need to be able setup your card first.** There's a [guide](https://www.whitewolftech.com/articles/payment-card/) to set it up with your computer. Hopefully a mobile app is to come to do this. +***In order to use this extension you need to be able setup your card first.*** There's a [guide](https://www.whitewolftech.com/articles/payment-card/) to set it up with your computer. Or it can be done with [https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter](TagWriter app by NXP) Android app. -

Setting the outside the extension

+## Setting the outside the extension - android +- Write tags +- New Data Set > Link +- Set URI type to Custom URL +- URL should look like lnurlw://YOUR_LNBITS_DOMAIN/boltcards/api/v1/scane?e=00000000000000000000000000000000&c=0000000000000000 +- click Configure mirroring options +- Select Card Type NTAG 424 DNA +- Check Enable SDM Mirroring +- Select SDM Meta Read Access Right to 01 +- Check Enable UID Mirroring +- Check Enable Counter Mirroring +- Set SDM Counter Retrieval Key to 0E +- Set PICC Data Offset to immediately after e= +- Set Derivation Key for CMAC Calculation to 00 +- Set SDM MAC Input Offset to immediately after c= +- Set SDM MAC Offset to immediately after c= +- Save & Write +- Scan with compatible Wallet + +## Setting the outside the extension - computer + +Follow the guide. The URI should be `lnurlw://YOUR-DOMAIN.COM/boltcards/api/v1/scane/?e=00000000000000000000000000000000&c=0000000000000000` @@ -12,8 +33,8 @@ The URI should be `lnurlw://YOUR-DOMAIN.COM/boltcards/api/v1/scane/?e=0000000000 Choose and note your Meta key and File key. -

Adding the into the extension

+## Adding the into the extension Create a withdraw link within the LNURLw extension before adding a card. Enable the `Use unique withdraw QR codes to reduce 'assmilking'` option. -The card UID can be retrieve with `NFC TagInfo` mobile app or from `NXP TagXplorer` log. Use the keys you've set before. You can leave the counter zero, it gets synchronized with the first use. +The card UID can be retrieve with `NFC TagInfo` mobile app or from `NXP TagXplorer` log. Use the keys you've set before. You can leave the counter zero, it gets synchronized with the first use. \ No newline at end of file diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index 7cf5cad1..5c2824f4 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -26,7 +26,7 @@ async def create_card(data: CreateCardData, wallet_id: str) -> Card: ( card_id, wallet_id, - data.name, + data.card_name, data.uid, data.counter, data.withdraw, diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 165d72fb..8ce57398 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -33,27 +33,15 @@ {% raw %}