Earlier this year, I spent some time researching the latest Cryptocurrency payment technologies. I discovered Lightning Hold Invoices which solves many of the problems I faced with Bitcoin payments in the past. I ended up building “Lightning Watts” (https://watts.cryptoconvert.co.za) as a proof of concept web app to demonstrate the smooth Lightning payment experience. What is “Lightning Watts”? Since Bitcoin is mined using Electricity, “Lightning Watts” completes the loop, letting you convert Bitcoin back into Electricity (in the form of vouchers) via the Lightning Network.
Bitcoin transactions make for a bad payment experience
Please note: In this post I talk about “Bitcoin Payments” which specifically refers to the full payment flow involved when paying a merchant with Bitcoin. I use “Bitcoin Transaction” for the general reference to a transaction on the Bitcoin network.
For me, the “gold standard” of payment technology is something that lets you buy a cup of coffee at a coffee shop. Why? Because the amount involved is small and the whole experience needs to be quick. A Bitcoin layer 1 transaction can attract high network fees (R1 – R100+ depending on congestion) and can take a long time to be verified by the network (10 – 30+ minutes typically). Verification is important for the merchant to guarantee receipt of funds. Until a transaction is verified, there is some risk that the payment might be “reversed”. Nobody will buy their morning latte with Bitcoin if the transaction costs more than the order and you hold up the queue while your transaction is verified…
The main problem with Bitcoin payments is that the sender controls too many of the parameters of the payment experience.
The merchant wants to ensure the correct amount is received within a limited timeframe. With Bitcoin transactions, the sender controls:
- The amount sent – they can easily send too much or too little.
- The time sent – they could send the payment the next day or even the next year.
- The network fees paid – they could use a low fee which would delay transaction verification if the network is busy.
If the sender gets any of these things wrong, the merchant needs to cancel and refund the transaction, which takes a lot of effort and could be expensive if network fees are high due to congestion.
Lightning Payments
Bitcoin transactions are like EFTs in the sense that you send money to a Bitcoin wallet address, like a bank account number. Lightning payments put a lot more control in the merchant’s hands, because transactions are invoice-based, which means the merchant can specify an exact amount, a fixed time window for the payment, and include additional information displayed to the sender. This eliminates the typical pitfalls that cause Bitcoin payments to fail.
Lightning payments are also better for the sender because they are instantaneous (no need to wait for network verification) and super cheap (0.1 cents to 5 cents).
In addition to the benefits a Lightning invoice provides a merchant, there exists a special type of Lightning invoice called a “Hold Invoice“. This type of invoice introduces an extra step to the payment flow, something like a Credit Card reserve step, except that the customer is pushing funds to the merchant instead of the merchant pulling funds from the customer’s card.
In the diagram above, the customer scans a merchant Lightning Invoice QR code and hits “Send” in their wallet app. At this point, the transaction is marked as “paid”. The merchant can then decide to either “settle” the payment which finalises the transaction, or “cancel” it which immediately returns the funds back to the sender. Cancelling does not require a separate refund transaction, instead, it marks the original transaction as canceled. It is not possible for the sender to reverse the funds once it is in the paid state.
Hold Invoices and “Lightning Watts”
In my app, the customer specifies their Electricity box’s meter number and the amount in Rands they want to spend on electricity for their home. The app displays a Lightning Invoice that the customer pays. At this point, the app requests an electricity voucher from my upstream electricity provider. There is a chance that the provider fails to issue a voucher for the specified meter number, in which case the app simply cancels the payment and returns the sender’s funds.
You can test the Hold Invoice payment flow by specifying an invalid meter number like 000000 (six zeroes) and paying the minimum amount which is R25. After a few seconds, the provider will return an error and your funds will be returned to your wallet.
Next Steps
“Lightning Watts” is just a demo for some of the cool new features of Lightning and a proof of concept showing how Bitcoin payments can (finally) work to buy a cup of coffee. If you are interested in testing but don’t have a wallet, I recommend installing Muun wallet. Follow @CryptoConverted on Twitter and add a message to the LightningWatts thread, we will follow you back and send you R30 worth of Sats to get going.
Once you have a wallet set up, visit this post on where to spend Bitcoin in South Africa: https://www.cryptoconvert.co.za/2021/08/17/where-to-spend-your-sats-in-south-africa/