Bitcoin Lightning Network #3: Paying for goods and services

Andreas Brekken
Jul 25, 2018 · 11 min read

Lightning Network aims to make micro-payments faster, cheaper, and more secure than zero-confirmation Bitcoin transactions. Is it unfairly easy to pay with Lightning? Andreas goes shopping.

Image for post
Image for post

In the second part of my Lightning Network review I became the largest node in the Lightning Network. Today I’ll try to pay for goods and services.

TL;DR: Sending payments using the Lightning Network is cheaper than the regular Bitcoin network, but suffers from routing errors and wallet bugs that make it impractical even for highly technical users.

I have split this review of the Bitcoin Lightning Network into multiple parts for better readability. Subscribe to the newsletter and I’ll tell you when I publish the next part.

Parts of the review

  1. Compiling and running a node
  2. Becoming a hub
  3. Paying for goods & services
  4. Final thoughts

SatoshiTweet

SatoshiTweet lets the user pay a small amount of bitcoin to send a tweet from the SatoshiTweet account. They only accept Lightning Network payments.

Image for post
Image for post

I write a message encouraging people to connect to my Lightning Network node.

Image for post
Image for post
I don’t know if the statement is accurate.

I click the Pay 2020 satoshis to Tweet button.

Image for post
Image for post
I also tried with shorter/different messages.

I click the button a few more times. The error remains the same. I look in the Google Chrome network inspector. SatoshiTweet is returning a generic 500 Internal Server Error response.

Image for post
Image for post

Back in my lnd dashboard channels are still being established.

Image for post
Image for post

I edit the lndconfig to increase fees by adding two more zeroes. I restart lnd.


There’s at least one dice site using Lightning Network payments, Lightning Spin.

Image for post
Image for post

I click the Spin button.

Image for post
Image for post

Lightning Spin is glitching. The payment invoice is changing rapidly. I restart my browser and try again.

Image for post
Image for post

This time the payment request remains stable. I look in the lncli help to see how I can send funds.

Image for post
Image for post
Image for post
Image for post

There are plenty of routes available, at least ten. I use decodepayreq to see what the Lightning Network payment invoice actually contains.

ubuntu@ip-172-31-33-128:~$ lncli decodepayreq lnbc1m1pd5xfe7pp56spv65p5sr52q8gax8ugkxqj838waadn9qrm7kmdxck3366px4pqdqlf35kw6r5de5kueeq2dcxjm3q95sr27qcqzysmdfw5q5w6npkg7ashyjfqr5qcszdrua0shxq8nzvxq9ee2leucrk5mxjp4tzkkhexgha34dqdsf6ujxd02tjx8f94uzps8nl09apxdgqpmczyv
{
"destination": "02cf3cc45d8fee5055c4ba5a58fe22ae973685fa2cb43e2c5b6454eaa1d08066a8",
"payment_hash": "d402cd503480e8a01d1d31f88b18123c4eeef5b32807bf5b6d362d18eb413542",
"num_satoshis": "100000",
"timestamp": "1531127614",
"expiry": "3600",
"description": "Lightning Spin - 5x",
"description_hash": "",
"fallback_addr": "",
"cltv_expiry": "144",
"route_hints": [
]
}

The amount and node identifier are correct. I run the lncli payinvoice command.

ubuntu@ip-172-31-33-128:~$ lncli payinvoice lnbc1m1pd5xfe7pp56spv65p5sr52q8gax8ugkxqj838waadn9qrm7kmdxck3366px4pqdqlf35kw6r5de5kueeq2dcxjm3q95sr27qcqzysmdfw5q5w6npkg7ashyjfqr5qcszdrua0shxq8nzvxq9ee2leucrk5mxjp4tzkkhexgha34dqdsf6ujxd02tjx8f94uzps8nl09apxdgqpmczyv
{
"payment_error": "",
"payment_preimage": "a135dcd537912d68ebcc064cded992ad2ca73a07181c6e41dfc18cb7f057c14a",
"payment_route": {
"total_time_lock": 531322,
"total_fees": 1,
"total_amt": 100001,
"hops": [
{
"chan_id": 583927535793471488,
"chan_capacity": 326943,
"amt_to_forward": 100000,
"fee": 1,
"expiry": 531308,
"amt_to_forward_msat": 100000000,
"fee_msat": 1800
},
{
"chan_id": 582182610938953728,
"chan_capacity": 1337000,
"amt_to_forward": 100000,
"expiry": 531308,
"amt_to_forward_msat": 100000000
}
],
"total_fees_msat": 1800,
"total_amt_msat": 100001800
}
}

The payment will be sent through two hops and pay 1800 msats (0.00000002 BTC or 0.000135 USD).

Back in the web browser the spin has been detected and I have won 400,000 sats (0.004 BTC or $30 USD)!

Image for post
Image for post

I click Withdraw.

Image for post
Image for post

I must create a Lightning Network payment invoice for 500,000 satoshis. I consult the lncli help.

$ lncli -h | grep inv
payinvoice Pay an invoice over lightning.
addinvoice Add a new invoice.
lookupinvoice Lookup an existing invoice by its payment hash.
listinvoices List all invoices currently stored.

The addinvoice command looks like what I need.

Image for post
Image for post

The command has a lot of parameters. I start to experiment.

$ lncli addinvoice --amt 500000
{
"r_hash": "8a6c89724b806dfa085400e25c47ac98059048f4feb3509db6072c05dac3b2b7",
"pay_req": "lnbc5m1pd5x2uspp53fkgjujtspkl5zz5qr39c3avnqzeqj85l6e4p8dkqukqtkkrk2msdqqcqzys2s48rrh22ff0rvj8sl6rdx4adrmhw2pxemrnt0skckzmczg5ndp39h972przrlqg4ng0v7aw29hzr5w0a9kka7nfs3385q303tsmzrcphc5tre"
}

Easy enough. I paste the pay_req string into Lightning Spin.

Image for post
Image for post

The website claims the payment has been sent! I return to lncli to check the status.

Image for post
Image for post

The payment has been received and settled! I’m not entirely sure what that means, but I’ll assume it’s safe.

While I’ve been enjoying gambling, lnd is still opening channels and approaching 100 channels. I add some more zeroes to the fee settings and restart lnd.

The settings are bitcoin.basefee=100000000 and bitcoin.feerate=100000.

Satoshi’s Place

Satohi’s Place is a clone of the million dollar homepage. Ppixels are bought using Lightning Network payments. I decide to repeat my tank man stunt.

Image for post
Image for post

Blake, the Chief Meme Officer of Shitcoin.com quickly designs a 1000x800 pixel version.

Image for post
Image for post

I find a tool that converts uploaded images to Lightning Network invoices to paint pixels on Satoshi’s Place.

Image for post
Image for post

I decide to pay all eight invoices in one command.

Image for post
Image for post
xargs is a program that lets me do “for each of the eight payment invoices, run the command lncli payinvoice”

The first few Lightning invoices pay quickly and the image starts appearing on Satoshi’s Place.

Image for post
Image for post

The bottom of the picture never appears. Back in lncli there are several error messages.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

I retry the invoice corresponding to the bottom right of the image. The TemporaryChannelFailure has become a permanent channel failure. I restart lnd, which as this point must be terminated with the kill command as opposed to stopping normally.

Image for post
Image for post

I ask on the Lightning Network Slack chat. They recommend I establish channels manually to Satoshi’s Place or to users that have channels to Satoshi’s Place.

Image for post
Image for post
Image for post
Image for post

I take a few hours break to have dinner with some friends.


After dinner, my image has been vandalized.

Image for post
Image for post
Everyone loves ducks.

I reset the fee settings hoping it will alleviate the issues I have with sending payments and restart lnd which is currently eating most of my CPU. I make one last attempt at opening some channels.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

It’s late and I don’t want to diagnose any more. Perhaps I’ve been excluded from the network?

Image for post
Image for post
Image for post
Image for post

Bitrefill

Bitrefill is a service that lets you buy gift cards and phone top-ups with Lightning Network payments.

Image for post
Image for post

Their website also offers Reddit Gold. I click to find out more.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

I run the lncli payinvoice command to pay the invoice.

Image for post
Image for post

The command completed without errors. I return to the Bitrefill website.

Image for post
Image for post

Looks good! I check on Reddit.

Image for post
Image for post

The Blockstream Store

I head over to the Blockstream Store to see what’s for sale. The hoodie looks nice. I’ll ship one to my friend Lawson in San Francisco.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

I click Proceed to Lightning Payment.

Image for post
Image for post

And pay using lncli.

Image for post
Image for post

The command hangs for five minutes. I terminate it. Restarting lnd and retrying does not help.

Perhaps the problem is withlncli.

Zap Wallet (Desktop)

In an attempt to buy the hoodie I check out the Zap Wallet after it was recommended in the Lightning Network Slack chat. I visit the website.

Image for post
Image for post

The Zap Wallet website is minimalistic and sleek. I press Download Desktop Wallet.

Image for post
Image for post

The most recent release of Zap Wallet was nearly six months ago, in February 2018. There is commit activity, but mostly minor and cosmetic fixes. I download v0.1.1-beta for macOS.

Image for post
Image for post
Image for post
Image for post
The installation process and loading screen is unusually well designed for a cryptocurrency wallet.

The Zap Wallet loading spinner indicates loading is 73% completed. I take a break.

Image for post
Image for post

After 15 minutes the progress bar is still on 73%. The Lightning invoice for the Hoodie will expire soon.

Image for post
Image for post

My Lightning Network invoice in the Blockstream Store expires.

Image for post
Image for post

I take a break.

Eclair Wallet (Android)

Another wallet that’s been recommended is the Eclair for Android. I find it in the Google Play Store and download.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
The warning is confusingly worded. Any funds in a phone wallet connected to the Internet is a hot wallet.

I accept the warning and look around in the Zap Wallet for a way to fund the wallet. There must be on-chain BTC in the wallet to pay for fees to establish payment channels.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

I send enough funds to pay for the hoodie from my other wallet, Mycelium.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
The suggested network fees from Mycelium are quite high. Recommended fees from Earn.com were lower.

I wait for the funds to confirm. Next, I will open a Lightning Network channel.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Eventually my funds confirm. I open a channel to lnd.shitcoin.com, which is now the largest hub in the Lightning Network, approaching 50% of the network capacity.

After some more waiting, the channel shows as Normal. I scan the Blockstream Store Lightning Invoice QR Code with my phone and press pay.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Is the payment routing failing because lnd.shitcoin.com does not have a route to the Blockstream Store Lightning node? It’s hard to believe, but I’m desperate.

My Eclair Wallet has no more BTC to open a channel directly with the Blockstream Store. I decide to open a channel from lnd.shitcoin.com to the Blockstream Store. This way the payment can go from my Eclair Wallet to lnd.shitcoin.com and from there to the Blockstream Store.

The Blockstream Store does not announce its Lightning Network node connection information on its website. I ask around.

Image for post
Image for post
Is the Blockstream Store no longer announcing their IP address due to DoS attacks? I don’t investigate further.

I open a channel from lnd.shitcon.com to the Blockstream Store node with enough funds to cover the hoodie.

Image for post
Image for post

After the Lightning Network funding transaction has confirmed, the Blockstream Store Lightning Network invoice has expired again. I re-enter my billing and shipment information and press check out.

A new invoice has been generated. I scan its QR code with my Eclair wallet and press Pay.

Image for post
Image for post

I give up on buying the BlockStream hoodie for now.

Image for post
Image for post

Sending payments using the Lightning Network is cheaper than the regular Bitcoin network, but suffers from routing errors and wallet bugs that make it impractical even for highly technical users.

In part four I’ll decide what to do with my Lightning Node after the review is published. Is it safe enough to keep online? Will it ever become profitable Subscribe to the newsletter below to find out.

See you back here for part four, blockchainers!

About The Author

Andreas Brekken is the CEO of Shitcoin.com and has been obsessed with cryptocurrency since 2011. He was the CTO/co-founder of Justcoin.com and later worked as an engineer with Kraken.com.

Follow me on Medium and Twitter for more reviews.

Shitcoin.com

There’s a lot of “blockchain” projects out there, but do…

Andreas Brekken

Written by

Shitcoin.com
Andreas Brekken

Written by

Shitcoin.com

There’s a lot of “blockchain” projects out there, but do they actually work? Andreas tries to install and use them. Also home of the Shitcoin.com newsletter.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store