Skip to content
/ Ziggy Public

Engaging with lightning network through RFID/NFC

License

Notifications You must be signed in to change notification settings

arcbtc/Ziggy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

⚡⚡⚡⚡⚡⚡⚡ Ziggy Stardust ⚡⚡⚡⚡⚡⚡⚡
(An NFC bitcoin Lightning Network point of sale device)

"There is life on Mars"

A project to engage with the bitcoin Lightning Network over RFID/NFC, using an ESP32, RFID-RC522, OLED, Keypad

LN Slave Mod

Wiring diagram alt text

Parts list

2 possible sources, from: Aliexpress.com (cheaper, but slower) & Amazon.co.uk (faster, more expensive):

  1. ESP32 Wireless WiFi Bluetooth Development Board AliExpress / Amazon

  2. 0.96 inch OLED White Display Module 128X64 SPI 7pin Driver Chip SSD1306 for Arduino Diy Kit AliExpress / Amazon

  3. MFRC522 RFID Module for Arduino SPI Writer / Reader AliExpress / Amazon

  4. 16 key membrane AliExpress / Amazon

Procedure

  • Assemble as per above wiring diagram.

  • Connect ESP32 to PC with USB micro cable.

  • Install RFID library:

    • Type in RFID
      rfid
    • Scroll down to MFRC522 byGithubCommunity
    • Click Install

Dumpinfo example

  • Check your Arduino IDE is working with your ESP32.

  • File -> Examples -> Dumpinfo dumpinfo

  • Change pin values on lines 39 & 40 from 9 and 10 to 22 and 5 pins

  • Uploade code

  • Open Serial Monitor

  • Tap NFC card upon the reader

  • Serial Monitor will display contents of NFC card:
    cardData


Set up Opennode accounts

  • Create an opennode.com account

  • First we generate an API Key for the Customer account:

    • Click on: Developers -> Integrations -> Add Key
    • Enter Label: NFCWITHDRAW
    • Select Withdrawals from the Permissions dropdown
    • Enter your 2FA
    • Click on Generate
      customerKey
  • Copy the API Key to your clipboard, then paste into a text editor & remove the hypens
    keyRemovedHyphens

  • Repeat for Merchant account

    • Click on: Developers -> Integrations -> Add Key
    • Enter Label: NFCINVOICE
    • Select Invoices from the Permissions dropdown
    • Click Generate
    • Copy the API Key to your clipboard, then paste into a text editor
      merchantKey

writedata

  • Copy main.ino code from Ziggy/writedata

  • Paste into new Arduino file & save as NFCwrite

  • Upload to ESP32

  • Open Serial Monitor

  • Place NFC card upon NFC writer

  • Copy Customer API Key:
    copyKey

  • Paste into Serial Monitor, followed by a hash symbol # & press enter: pasteKey

  • The Serial Monitor should now display that the Customer API Key has successfully been written to the NFC Card: keySuccess


PoS

  • Copy main.ino code from Ziggy/writedata

  • Paste into new Arduino file (& save as NFCPOS)

  • Copy Merchants key into:
    string apikey = "MERCHANTS-OPENNODE-INVOICE-API-KEY" pasteMerchantKey

  • Copy apicalls.h code from Ziggy/PoS

  • Paste into text editor and save as apicalls.h in the same directory as NFCPOS

  • Enter you WiFI details:
    wifiDeets

  • Upload the code

  • When completed, the OLED should display "connecting", followed shortly by "connected" and then "Sats:"

  • You can now use the the keypad to enter an amount of sats and press the hash key #

  • The OLED should then display "..." followed by "Tap card" and finally "Paid!"

  • You can now go back to opennode.com to check the transactions (remembering to refresh the page)

Tip me

If you like this project and might even use or extend it, why not send some tip love! https://paywall.link/to/f4e4e

About

Engaging with lightning network through RFID/NFC

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages