A quick text + video tutorial Instawin when you play this card! Update: I received some much appreciated feedback from the community to highlight this important message more prominently in the post: Before you begin, be mindful that this software is experimental and could contain bugs that result in lost funds. Only use small amounts of bitcoin that you can afford to lose. Bitcoin is a decentralized peer-to-peer payment network used all around the planet to transact trustlessly. The system enables trustless transactions by requiring miners to include transactions in blocks, which are linked to each other cryptographically. However, this means that transaction confirmations take time, and not everyone has the luxury of time. The answer to this inconvenience is payment channels, which Satoshi Nakamoto described as a way to enable “high-frequency transactions” between channel partners, as opposed to waiting roughly 10 minutes for a confirmation. Instead of only being able to pay your channel partner, Lightning takes this idea and deploys it on a large scale. you can instantly pay anyone on the Lightning Network, which is a network of payment channels. Recently, The most exciting part is that you can only purchase things on the with a Lightning Network payment This is a tutorial on how to setup your own Lightning node to purchase items or to receive Lightning payments using , Blockstream’s Lightning implementation. Blockstream released an e-commerce shopping page called Blockstream Store, which uses their newly released Wordpress e-commerce plugin built using Lightning Charge. Blockstream Store on Bitcoin’s mainnet. c-lightning Requisites: Linux (Ubuntu 17.10 is used for this guide) Ample storage for Bitcoin’s blockchain Basic to intermediate command line knowledge A fully synced Bitcoin node with SegWit Some bitcoin Step 0: Installing build tools and dependencies Our first step is to install, via , the tools needed: apt sudo apt-get install -y autoconf automake build-essential git libtool libgmp-dev libsqlite3-dev python python3 net-tools tmux installing what we need to build lightningd Step 1: Installing bitcoind from the Bitcoin PPA Either build from source, download and verify the binary from (preferred method), or install from the Bitcoin PPA: bitcoind bitcoin.org sudo apt-get install software-properties-common sudo add-apt-repository ppa:bitcoin/bitcoin sudo apt-get update sudo apt-get install -y bitcoind installing bitcoind from the bitcoin ubuntu PPA Step 2: Cloning the lightningd repository and building: Now grab the code and then build it: c-lightning mkdir builds && cd builds git clone https://github.com/ElementsProject/lightning.git cd lightning make Use _make -jn_ to speed up compilation. _n_ being the number of threads dedicated to building. Example: _make -j10_ for a processor with 10 or more threads (like a Xeon). building lightningd Step 3: Running bitcoind, lightningd, and lightning-cli to confirm correct installation Start , then , then to confirm everything is installed correctly: bitcoind lightningd lightning-cli Make this process cleaner by using _tmux_ to keep everything neat and tidy in one terminal: tmux Start _bitcoind_ , and watch its startup from the log, then test it with _bitcoin-cli_ : bitcoind tail -f ~/.bitcoin/debug.log bitcoin-cli -getinfo Similarly, start _lightningd_ and test it with _lightning-cli_ : ./lightningd/lightningd --network bitcoin --log-level debug ./cli/lightning-cli help running bitcoind, then lightningd, then finally lightning-cli Step 4: Connecting to a remote lightning peer After and successfully build, connect to a peer and sync the channel graph. The peer used is Blockstream’s: lightningd lightning-cli ./cli/lightning-cli connect 02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432 104.198.32.198 9735 The graph syncs automatically ( log output) : lightningd Step 5: Creating an address to fund in order to open a channel: Opening a Lightning payment channel requires a funded UTXO. Generate a Bitcoin address with to send some bitcoin to. lightning-cli ./cli/lightning-cli newaddr Send some bitcoin to that address, but be mindful that this is experimental software. Step 6: Confirming we have received the BTC Use to check if the address is funded: lightning-cli ./cli/lightning-cli listfunds Step 7: Opening a channel with the peer we connected to earlier To open a payment channel, find the node’s pubkey or id (in this case, Blockstream’s) and then use to initiate opening the channel: lightning-cli To print the peer’s node id: ./cli/lightning-cli listpeers Copy that id and fund the channel with some number of satoshis: ./cli/lightning-cli fundchann Step 8: Monitoring lightningd logs for funding transaction confirmations: Optionally, switch back to the window with to watch for your funding transaction to be confirmed: lightningd tmux Step 9: Confirming we have opened a channel: Three confirmations are required for opening a channel. Once the funding transaction has three confirms, use to list our new payment channel. lightning-cli ./cli/lightning-cli listchannels | grep your_nodes_pubkey Congrats! You’ve opened up your first Lightning Network payment channel! You can now invoice others to receive instant payments, or you can pay an invoice that someone has sent you! ./cli/lightning-cli invoice amount_in_millisatoshis label description or ./cli/lightning-cli pay [bolt11_string](https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md) 's install documentation can be found and . c-lightning here here Thanks for reading! -grubles