Bitcoin Point of Sale

Related tags

Cryptography LNPoS
Overview

LNPoS

Hardware

https://shop.pimoroni.com/products/m5stack-faces-kit-pocket-computer-with-keyboard-game-calculator

Installation

Install Arduino IDE:

https://www.arduino.cc/en/software

Install ESP32 boards:

https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md

*Occasionally boards are updated and code stops working, I used esp boards version 1.0.5-rc7

Install libraries:

  • WiFimanager
  • M5Stack
  • ArduinoJson

*Libraries I used that worked are in this repo

Select board "M5Stack-Core-ESP32"

Upload code!

Usage

*Important: The wifi you connect to can not have special characters or numbers in the SSID or PASSWORD

Press A on the M5Stack during "INITIALIZING" screen
Connect to the WiFi captive portal SSID: "lnpos" PASS: "password1"
Enter your LNBits details

Notes

I had an issue

Old version

Comments
  • "Authentication failed" when trying to access PoS Options on captive portal on iOS

    Prerequisites

    • [x] I am running esp32 board version 1.0.4
    • [x] I checked the documentation and found no answer
    • [x] I checked to make sure that this issue has not already been filed
    • [x] I checked to make sure I'm running the latest build

    Expected Behavior

    Upon tapping on "PoS Options" in the captive portal menu, I want to be able to see input boxes where I can fill in info on my wallet id, lnurlPOS string, etc.

    Current Behavior

    Upon tapping on "PoS Options", after a couple of seconds I get a response saying "authentication failed".

    If I attempt to access it from my browser and not the captive portal, I am asked to enter a username and password upon tapping on the "PoS Options" option in the menu.

    Failure Information (for bugs)

    Gathering from this thread iOS (and Android 10 onwards) considers this AutoConnect request to be insecure (because HTTP) and thus disallows it.

    The following pages might help with finding a solution:

    Steps to Reproduce

    1. Launch the AP from ESP32 board by pressing * within 2 seconds of starting
    2. On an iPhone, tap on Settings > Wi-Fi > PoS-xxxxxxxx (under Other Networks)
    3. Enter password ToTheMoon1 (subject to change based on build)
    4. Tap on the hamburger menu on top right
    5. Tap on PoS Options

    You can also access the portal on a browser after cancelling out of the captive portal by selecting "Use Without Internet" and then navigating to http://172.217.28.1 It may ask you for a username and password if accessed via a browser.

    Context

    This issue is only relevant for those attempting to access the portal on any Apple devices.

    Failure Logs

    iPhoneCaptive Browser

    opened by mrugakshee 5
  • Possible issue with Portnumber in POS URL?

    Possible issue with Portnumber in POS URL?

    If a POS URL contains a : followed by a port number, the QR code can't be scanned. I tried in my mobile Lightning wallets and also with a QR app on my phone. If I delete the : und the port, the QR ist scannable (but wrong).

    opened by foobar-osint 3
  • In LNURLPoS, amout of sats different from wallet

    In LNURLPoS, amout of sats different from wallet

    When I add an amount of sats in the POS, and read the QR Code in my wallet, the amount is different. I have tested it with two different wallets: LN Bits and BlueWallet, and the value was different from the POS in both of them

    For example, when I inserted 1sats, my wallet read as 7sats

    opened by nathaliaacouto 1
  • fix: menuloop looping correclty when few menuItems

    fix: menuloop looping correclty when few menuItems

    Issue

    When having 2 menuItems enabled, there was no way to get to the second item. At first it seamed to be a bug with the keypad, but since the '*' was working correctly on other screens it didn't make sense.

    Bug

    After reviewing the code, I've noticed that the menuLoop function was resetting the loop in a way that didn't cover well all the possibilities. Inside the "btnloop" while loop (Line ~1258) you will find that the menuItemNo is iterated with the complete possible menu in mind [0-3] while the resetting condition (Line ~1274) was compared to the menuItemCount which contemplated only active menuItems. This doesn't comply when you have only LNUrlPOS and LNUrlATM items, since the menuItemCount is 2, but LNUrlATM is 3.

    Solution

    largestMenuItemChecked is a new variable that holds the largest item that is active in the menu. When loading the items checked we update this variable and then use it to compare with in the condition to reset the menuloop.

    Variable is started at 0 so there is no need to add any code for menuItem 0, nor validate anything if this item is deactivated later due to lack of wifi connection.


    There is already another pull request that solves the issue with an alternative solution. I'm proposing this one since it might be better aligned with the current design. If the other gets merged I will delete this one. I appreciate any comments. Awesome project!!

    opened by joacorma 1
  • Menu selection fails for some combinations of active menu items

    Menu selection fails for some combinations of active menu items

    There are some combinations of enabled menu items which stop the selection with '*' key from working.

    As an example, where the menu items enabled are:

    • LNURLPoS
    • LNURLATM

    In this case, only LNURLPoS can be selected and pressing '*' does not advance the selection.

    opened by Sparrowhawk1337 1
  • Fix menu selection logic, remove compiler warnings, improve keypad responsiveness

    Fix menu selection logic, remove compiler warnings, improve keypad responsiveness

    Where LNURLPos & LNURLATM are the only menu items available, it's not currently possible to select LNURLATM. An update to the logic for selecting the next item on a '*' key press fixes this.

    There are two compiler warnings with regard to NULL values which are fixed here by introducing a sentinel value for USB_POWER.

    The keypad delay is parameterised and reduced to 50ms. This makes the keypad feel more responsive - no keybounce issues have been observed.

    opened by Sparrowhawk1337 1
  • Added screen brightness control

    Added screen brightness control

    This has been tested with onchain and lnurlpos but not lnpos as I am getting server errors when the device is checking for payment on the invoice.

    Also, not implemented for LNURLATM yet as I don't know what that even is :p

    opened by blackcoffeexbt 1
  • fix block explorer link

    fix block explorer link

    Fixes the issue that currently the mempool.space link is given in the QR as

    https:/mempool.space/address/bc1...
    

    Changed to https:// in all 3 .ino-s.

    (Previously could give the custom link as /mempool.space to work around this)

    opened by openoms 1
  • Updated t display case

    Updated t display case

    Larger hole to allow for variation in screen placement on ttgo board 0.2mm gap between case upper and lower lips to accomodate less precission on some 3d printers

    opened by blackcoffeexbt 0
  • Barebones fixes and improvements

    Barebones fixes and improvements

    Some thgings I came acrross while setting up my barebones LNPoS:

    • Invoice memory length was incorrect and led to a NoMemory when fetching the JSON
    • LNURRL-Withdraw QR code was too small, applied the same fix as in #26
    • Improved and adjusted the display of the screens
    opened by dennisreimann 0
  • Fix typo: PAID instead of PAYED

    Fix typo: PAID instead of PAYED

    In the lnPoSTdisplay version, the payment success screen shows the message PAYED. The correct English term would be PAID.

    Change tested with TTGO device:

    image

    opened by Stadicus 0
  • Sending Receipt in addition of showing only Pin

    Sending Receipt in addition of showing only Pin

    Would like to have an option to customize the "checkout page" when completing the transaction. For now, the pin is showing at LNpos device and the link for the one that did the payment. Only the pin is showing when clicking the link. This page could have some more details:

    • Summary of transaction
    • Timestamp
    • Sats paid
    • Fees paid in sats
    • Sats value in local fiat currency
    • maybe some information of the company / client who received the sats
    • an Email-Form to send all this information to the person who paid and as cc or bcc to the company.

    For me personally living in Germany it would be awesome to always get all transaction details from above as email.

    All this is available on BTC-PayServer. Getting the transaction details should not be a problem, I think. Creating a form is simple HTML.

    For me running Umbrel I was not able to find a path where I can customize the page showing when transaction is done.

    opened by btckai 0
  • Unification

    Unification

    How the unification was done:

    mkdir -p lnPoS/libraries/

    cp lnPoSBareBones/lnPoSBareBones.ino lnPoS/lnPoSBareBones.cpp.h cp lnPoSM5Stack/lnPoSM5Stack.ino lnPos/lnPoSM5Stack.cpp.h cp lnPoSTdisplay/lnPoSTdisplay.ino lnPoS/lnPoSTdisplay.cpp.h cp -R lnPoSM5Stack/libraries/* lnPoS/libraries/

    • built lnPoS/lnPoS.h based on headers from lnPoSBareBones/lnPoSBareBones.ino, lnPoSM5Stack/lnPoSM5Stack.ino and lnPoSTdisplay/lnPoSTdisplay.ino
    • built lnPoS/lnPoS.ino entry point
    • built lnPoS/hardware_device.h that allows configuration of the hardware device
    • reworked User_Setup_Select.h of the TFT_eSPI library to get the hardware device from hardware_device.h and then include the appropriate file from User_Setups/
    • cp lnPoSBareBones/libraries/TFT_eSPI/User_Setup.h lnPoS/libraries/TFT_eSPI/User_Setups/Setup0_lnPoSBareBones.h

    Next steps:

    • test the code on BareBones, M5Stack and Tdisplay to make sure nothing broke
    • gradually reduce code duplication by moving identical functions to lnPoS.ino
    • merge the remaining differing but similar functions so they can also be moved to lnPoS.ino

    Regarding the unusual .cpp.h extension

    The original .ino files have been moved to .cpp.h files, which is an unusual file extension.

    The reason is:

    • a file extension that the Arduino IDE will open by default when opening the project, so we need either .h, .cpp or .ino
    • the extensions .cpp and .ino can't be used because these files will always be included in the compilation so we can't use a selective #include for them, resulting in "duplicate definition"s
    • so only .h remains
    • to make it clear that these are not regular header files (without code) but actual code files, the extension is .cpp.h

    Comparing old with new code:

    Also see attachments.

    This allows you to verify that the code changes were really minimal:

    cd ~/Arduino/LNPos/ # go to the top-level
    
    # Inspect the code changes:
    
    diff -Nabur deprecated_since_unification/lnPoSM5Stack.ino lnPoS/lnPoSM5Stack.cpp.h | tee /tmp/unification_lnPoSM5Stack.ino.code_diff
    diff -Nabur deprecated_since_unification/lnPoSTdisplay.ino lnPoS/lnPoSTdisplay.cpp.h | tee /tmp/unification_lnPoSTdisplay.ino.code_diff
    diff -Nabur deprecated_since_unification/lnPoSBareBones.ino lnPoS/lnPoSBareBones.cpp.h | tee /tmp/unification_lnPoSBareBones.ino.code_diff
    less /tmp/unification_*code_diff
    
    # Inspect the header changes:
    diff -Nabur deprecated_since_unification/lnPoSM5Stack.ino lnPoS/lnPoS.h | tee /tmp/unification_lnPoSM5Stack.ino.header_diff
    diff -Nabur deprecated_since_unification/lnPoSTdisplay.ino lnPoS/lnPoS.h | tee /tmp/unification_lnPoSTdisplay.ino.header_diff
    diff -Nabur deprecated_since_unification/lnPoSBareBones.ino lnPoS/lnPoS.h | tee /tmp/unification_lnPoSBareBones.ino.header_diff
    less /tmp/unification_*header_diff
    

    unification_lnPoSBareBones.ino.header_diff.txt unification_lnPoSTdisplay.ino.header_diff.txt unification_lnPoSM5Stack.ino.header_diff.txt unification_lnPoSBareBones.ino.code_diff.txt unification_lnPoSTdisplay.ino.code_diff.txt unification_lnPoSM5Stack.ino.code_diff.txt

    opened by ThomasFarstrike 5
  • Removing the onchain option does not work

    Removing the onchain option does not work

    Once set up, one cannot remove the onchain option as the key file will still be present.

    It should only be available in the setting contains an actual xpub, so that the onchain option isn't available if the setting gets cleared out.

    Alternatively the key file should be deleted when the setting is cleared out.

    opened by dennisreimann 1
  • LNPoS Service - Cannot connect to LNBits Server

    LNPoS Service - Cannot connect to LNBits Server

    I tested this project on a TDisplay and everything works fine except the LNPoS Service. (LNURLPoS and LNATM works fine) My WiFi is set up correctly.

    I debugged it with a connected serial console:

    connecting to LNbits server legend.lnbits.com 
    10:12:47.240 -> failed to connect to LNbits server legend.lnbits.com 
    10:12:50.264 -> menuLoop
    

    I don't know why this happens (yet).

    opened by mroxso 3
Owner
Arc
Arc
Bitcoin Core integration/staging tree

Bitcoin is an experimental digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin Core is the name of open source software which enables the use of this currency.

Bitcoin 67.6k Jan 4, 2023
A high-performance distributed Bitcoin mining pool server.

Viabtc Mining Server ViaBTC Mining Server is a high-performance distributed Bitcoin mining pool server. We have made a lot of optimizations for Bitcoi

ViaBTC 96 Nov 22, 2022
Dogecoin is a cryptocurrency like Bitcoin

Dogecoin is a cryptocurrency like Bitcoin, although it does not use SHA256 as its proof of work (POW). Taking development cues from Tenebrix and Litecoin, Dogecoin currently employs a simplified variant of scrypt.

Dogecoin 14.2k Jan 3, 2023
Bitcoin and Altcoins Publickey subtracter

keysubtracter Bitcoin and Altcoins Publickey subtracter Generate multiple but different "copies" of a publickey, Actually Added and substracted public

Luis Alberto 23 Dec 27, 2022
Bitcoin Core integration/staging tree

Bitcoin Core integration/staging tree https://bitcoincore.org For an immediately usable, binary version of the Bitcoin Core software, see https://bitc

Bitcoin Core 47 Dec 22, 2022
Brute Force Bitcoin Private keys, Public keys

Rotor-Cuda This is a modified version of KeyHunt v1.7 by kanhavishva. A lot of gratitude to all the developers whose codes has been used here. Feature

LostCoins 87 Sep 24, 2022
Onix is a decentralized blockchain project built on Bitcoin's UTXO model

What is Onix? Onix is a decentralized blockchain project built on Bitcoin's UTXO model, with support for Ethereum Virtual Machine based smart contract

Onix CryptoCurrency Development 4 Dec 16, 2021
mako - full bitcoin implementation in C

mako - full bitcoin implementation in C

Christopher Jeffrey (JJ) 540 Jan 5, 2023
Small collection of tools written in C for ECC and bitcoin

ecctools Small collection of tools written in C for ECC and bitcoin Why this programs are written in C language? Well i like C language because compil

Luis Alberto 26 Dec 7, 2022
Open-source, airgapped bitcoin hardware signer for the M5StickV.

Krux ✝ Krux is an open-source DIY hardware signer for Bitcoin that can sign for multisignature and single-key wallets. It is a low-cost airgapped devi

Jeff 50 Dec 28, 2022
LIDAR(Livox Horizon) point cloud preprocessing, including point cloud filtering and point cloud feature extraction (edge points and plane points)

LIDAR(Livox Horizon) point cloud preprocessing, including point cloud filtering and point cloud feature extraction (edge points and plane points)

hongyu wang 12 Dec 28, 2022
Apache Thrift is a lightweight, language-independent software stack for point-to-point RPC implementation

Apache Thrift Introduction Thrift is a lightweight, language-independent software stack for point-to-point RPC implementation. Thrift provides clean a

The Apache Software Foundation 9.5k Jan 7, 2023
BTCU Wallet is the original Bitcoin Ultimatum client and it builds the backbone of the network.

The concept of BTCU is similar to the concept of the second cryptocurrency by capitalization - Ethereum.

Bitcoin Ultimatum (BTCU) 31 Jul 1, 2022
Bitcoin Core integration/staging tree

Bitcoin is an experimental digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin Core is the name of open source software which enables the use of this currency.

Bitcoin 67.6k Jan 4, 2023
The Game Boy ROM of the Game Boy bitcoin miner!

game-boy-bitcoin-miner The Game Boy ROM of the Game Boy bitcoin miner! To build this, currently this patch needs to be applied to GBDK: https://gist.g

Ghidra Ninja 80 Dec 11, 2022
A high-performance distributed Bitcoin mining pool server.

Viabtc Mining Server ViaBTC Mining Server is a high-performance distributed Bitcoin mining pool server. We have made a lot of optimizations for Bitcoi

ViaBTC 96 Nov 22, 2022
Dogecoin is a cryptocurrency like Bitcoin

Dogecoin is a cryptocurrency like Bitcoin, although it does not use SHA256 as its proof of work (POW). Taking development cues from Tenebrix and Litecoin, Dogecoin currently employs a simplified variant of scrypt.

Dogecoin 14.2k Jan 3, 2023
This project shows how to interface Nokia 5110 LCD with Esp32 module to show current prices of any cryptocurrency like Bitcoin, Dogecoin, etc

ESP32 Cryptocurreny Ticker Introduction This project shows how to interface Nokia 5110 LCD with Esp32 module to show current prices of any cryptocurre

Aniket Katkar 20 Jun 16, 2022
Bitcoin and Altcoins Publickey subtracter

keysubtracter Bitcoin and Altcoins Publickey subtracter Generate multiple but different "copies" of a publickey, Actually Added and substracted public

Luis Alberto 23 Dec 27, 2022
Bitcoin Core integration/staging tree

Bitcoin Core integration/staging tree https://bitcoincore.org For an immediately usable, binary version of the Bitcoin Core software, see https://bitc

Bitcoin Core 47 Dec 22, 2022