LNPoS
A Bitcoin & Lightning ⚡ Point of Sale
Completely self-sufficient point of sale terminal. Both online and offline Lightning ⚡ Payments. For offline onchain payments and an offline Lightning ATM for withdrawals. Free and open source software, free from intermediaries, with integrated battery, WLAN, for self-construction, low budget, not even 50 euros.
The LNPoS functions:
- LNPoS Online Lightning payments with active interaction
- LNURLPoS Offline Lightning Payments. Passive interaction, sharing a secret as evidence
- OnChain For onchain payments. Generates an address and displays a link for verification
- LNURLATM offline lightning payouts. Generates LNURLw links to do withdrawals
🆕🆕🆕 New version available for testing: WebInstaller 🆕🆕🆕
1. The LNPoS briefly explained
The LNPoS is a Lightning ⚡ Point of Sale and consists of a microcontroller board with display (designation: TTGO T-Display ESP32), a keyboard and a housing. The board has WiFi and Bluetooth. The WiFi can be actively used as an access point, but it can also connect to another WiFi to connect to the Internet. It has a USB interface for power supply and serial data transmission. This allows you to write (flash) the program to the internal memory. The LNPoS is configured conveniently via a web interface.
The LNPoS can be operated as a pure offline device. For the offline functions (LNURLw / LNURLp / OnChain) you only have to transfer the data from the LNbits wallet and the xPub for the OnChain addresses to the LNPoS once. In addition, the LNPoS also has the option of connecting to the Internet via WiFi and making classic online Lightning ⚡ payments. This has the advantage of active feedback on the receipt of payment. In order for the LNPoS to be able to connect to the Internet, you also have to enter the access data for the network (SSID / password). This can be a home network or a mobile hotspot.
The backend is a LNbits server. LNbits is a wallet and account system that uses a Lightning ⚡ funding source. You can use the free demo server demo.lnbits.com to start with. There you create a wallet and get all the data you need to operate the LNPoS. Since everything is “free and open source” you can later host LNbits yourself and connect them to your own Lightning ⚡ Node as a source of funding. This makes you sovereign and independent. 🔥 This is exactly what Bitcoin and Lightning ⚡ was built for! 🧡
2. The hardware
There are two shops in Europe where you can order the LNPoS as a set. There is shop.lnbits.com in England and in Germany fulmo.shop.org. With both you can pay me Lightning ⚡. You have to order the battery separately. However, the battery is not required for stationary use. You can also get the components from alternatives or in individual parts:
- LILYGO® TTGO T-Display Keyboard Kit ESP32 Google
- TTGO T-Display ESP32 Google
- Possible cases for the LNPoS shop.lnbits.com
- Templates for building the cases yourself GitHub
- Switch Example
- Battery 3.7V LiPo, no larger than 1100 mA and possibly with a JST ( 2 pin / 1.25mm) for the ESP32 board. Otherwise, the plug is also supplied with the set.
Another note on assembly, coincharge.io has written a good instructions for this.
3. Setting up the LNPoS
Setting up the LNPoS has now become quite simple. You can install the program through a web browser. No additional software is required for this. The website required for this is called Web Installer. It works with the desktop browser Chrome or Edge. The only hurdle you have to overcome at the beginning is setting up a suitable driver for the connection between the computer and the microcontroller. With some operating systems, the appropriate driver is automatically recognized and installed when the microcontroller is connected.
But it doesn’t always work and sometimes you need a driver update to make it work properly. But don’t panic, the website offers help right away. If you cannot set a connection port and then click cancel, you will see the following message window. There you will also be offered the link to the appropriate driver. The TTGO has the chip CH9102. So all you have to do is download the latest driver from the manufacturer and update your system with it.
3.1 Preparation: The LNbits wallet
The bitcoinSwitch communicates with an LNbits wallet. Here I will show you how you can create a wallet on the free LNbits demo server and how you can create the necessary interface data so that there is a connection between LNPoS and the wallet.
- Visit the website demo.lnbits.com and create a wallet
- You can now see the wallet on the top left and can add extensions under
Manage extentions
- There you select
LNURLDevice
and withENABLE
you activate the extension - Now you will find the item Extensions LNURLDevice under Extensions. Select it and create a new
LNURLDevice Instance
. This defines the parameters and generates an interface. - Fill in all fields for
PoS
and select Create LNURLDevice. Repeat forATM
. - From
PoS
click the first small button LNURLDevice Settings and copy the displayed link to the clipboard and then immediately to a digital note for later. Repeat forATM
. You will later add these “strings” to the configuration menu of the Web Installer. - Now you need the
Invoice/read key
. Click once on the wallet and then click onAPI Info
on the right. There you will find the key. You also copy that again to your digital note. You will need it later to configure.
3.2 Installing the LNPoS
Let’s start the installation now. To do this, please go to the Web Installer page again. You can find them under the link: https://lnpos.lnbits.com/
Or you can go to the bitcoinSwitch GitHub page: https://github.com/lnbits/LNPoS And look for the link to the Web Installer in the text there.
- Connect the microcontroller to your computer with a USB cable. Wait a moment for your computer to recognize the new device, select version 0.1. and then go to
Flash
once.Note:
With version 0.2, the WiFi did not work for me. As soon as I can, I will update the documentation. - Select the correct connection and press Connect.
- Now select
INSTALL LNBITS LNPOS
in the “Device Dashboard”. - Select
Erase Device
and pressNext
. Note: If you want to keep old configuration data like the WiFi and interface data, then leave it deselected. - Now the program will be installed (flashed). When the installation is complete, go to
NEXT
and look at the next chapter for the configuration.
3.4 Configuring the LNPoS
The best way to configure the LNPoS is via WiFi. To do this, you must bring the LNPoS into “WiFi Access Point” mode. You do this by taking the LNPoS off the voltage once, holding down a button and applying the voltage again. Then you take your mobile phone and see if you have found a new WiFi. You can use it to log into the microcontroller and configure the LNPoS there.
- Take the LNPoS off the voltage once, e.g. hold down the * button and reconnect it. I am acknowledged with the display “AP Launched”. AP stands for Access Point.
- Search your WiFi for a new participant that begins with
LNPoS-...
. Connect to it and if it asks for a password it will beToTheMoon1
. Click on the connection again to log in to the LNPoS Access Point. Then click on the hamburger in the top right corner to get to the menu. - Select
Configure new AP
to add a new WiFi. Select your home network or hotspot and pressApply
. Now the microcontroller should connect to the net and show it byEstablished connection
. Now go back to the menu on the top right. - In the menu you go to PoS Options. Now, if you have one, provide a
Master Public Key
for OnChain transactions. Fill in theLNbits Server
you are using. And then all the data likeWallet Invoice Key
,LNURLPoS String
andLNURLATM String
. You should have received the data from Chapter 3.1 and ideally just copy it from the digital note. You can leave thePassword
, themempool.space server
and theLNURLATM pin String
as they are. You need the pin for ATM withdrawals. Now confirm the whole thing once withSave
and on the following page once withOK
.
That was actually it, the LNPoS is set up. 🎉 Have fun testing! 🔥
3.5 The functions of the LNPoS
Here are a few sample images of the LNPoS functions and a booking example as it is displayed in the mobile wallet.
- LNPoS, online payment
- LNURLPos, offline payment
- OnChain payment (offline)
- LNURLPoS, offline payout
- The transactions in the LNbits Web Wallet
4. Supplements
LNbits is a wallet and account system. Check it out here. I made a video about this some time ago. It is important to understand that LNbits is nothing more than a database. And so the LNPoS terminal communicates with a database. The real values in the form of satoshis are on the underlying Lightning node. The node is also responsible for the actual online transactions in the background. The LNPoS, with the Lnbits wallet, is just an interface. If the LNPoS breaks or is lost, or if LNbits itself crashes, your funds are still safe because they are managed by the underlying Lightning Node. There must also be well-connected Lightning channels with sufficient inbound liquidity. So if you create a wallet with LNbits and lose the keys or the links to the wallet, the Sataoshis are not gone, it’s just a donation to the operator of the Lightning node underneath.
The online LNbits wallet “demo.lnbits.com” is great and works great. Usage is license-free and free, but the server is in someone else’s custody and not intended to store large values permanently. It’s more of an experimental environment to make it easy for people to experiment with LNbits. There is no guarantee that the LNbits server will work in the long term and the developers and altruistic operators are unlikely to bear losses due to technical problems or hacks. So, always secure your funds as soon as possible on a wallet of your choice and check whether you cannot host LNbits yourself. This is possible on the RaspiBlitz and the offline functions LNURLPos and LNURLATM and the generation of OnChain addresses also work via an IP2Tor connection. But what does not work yet is the online Lightning payment with LNPoS. Then you get the error message “fetching fiat rate failed”, which means that a connection to the LNbits server could not be established.
If you wish, you can also access the LNPoS LNbits wallet via the LndHub extension for BlueWallet and Zeus. It can be used as an (emergency) alternative to LNPoS with full control (LNDHUB ADMIN), or as “read only / only invoices” (LNDHUB INVOICE). This allows the employee, for example, to check the transactions if there are any discrepancies. It can also happen that the customer or employee accidentally forgot the “secret” (the four-digit PIN) of a LNURLPos offline payment. Another advantage to the LNbits web wallet itself is that with these LndHub wallets in BlueWallet or Zeus you have a read only wallet can set up, but on the other hand also has no access to the settings and extensions. So nobody can damage anything with it. The LNbits Web Wallet should therefore only be used by the admin of the account.
5. Sources and further information
- The LNPoS GitHub project: LNPoS
- Video tutorial: MakerBits – LNPoS 2
- MarkerBits Youtube Channel: MakerBits
- Telegram Group: MakerBits
- Telegram Group: LNbits
- LNbits GitHub project: LNbits
- German LNPoS Telegram Group: LNPoS Kassenterminal
- The LNbits Shop: shop.lnbits.com
- You can also find very good and supplementary instructions for the LNPoS with videos on coincharge.io.
If you liked the article, I’m happy about a message. 📨
My⚡️My Lightning address: axelhamburch@ereignishorizont.xyz
Tip: By the way, this also works with the LightningTipBot .
Syntax: /send <Amount> <LightningAddress> <Message>
Created with love 🧡 Block 735952 / 843728 updated
– Lightning ⚡ (er)leben –