<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Abba Adamu</title>
    <description>The latest articles on DEV Community by Abba Adamu (@shytypes1028).</description>
    <link>https://dev.to/shytypes1028</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1344968%2F6af4ea6f-e629-4c42-9d11-340da8ec8b33.png</url>
      <title>DEV Community: Abba Adamu</title>
      <link>https://dev.to/shytypes1028</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shytypes1028"/>
    <language>en</language>
    <item>
      <title>Bitcoin - A dummy's technical guide to the bitcoin ecosystem part 2 (Addresses)</title>
      <dc:creator>Abba Adamu</dc:creator>
      <pubDate>Tue, 02 Apr 2024 09:40:41 +0000</pubDate>
      <link>https://dev.to/shytypes1028/bitcoin-a-dummys-technical-guide-to-the-bitcoin-ecosystem-part-2-addresses-2i0a</link>
      <guid>https://dev.to/shytypes1028/bitcoin-a-dummys-technical-guide-to-the-bitcoin-ecosystem-part-2-addresses-2i0a</guid>
      <description>&lt;h3&gt;
  
  
  📜 Objective
&lt;/h3&gt;

&lt;p&gt;The goal of this article is to help you&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understand the various types of Bitcoin addresses and their impact on transactions

&lt;ul&gt;
&lt;li&gt;Legacy (P2PKH)&lt;/li&gt;
&lt;li&gt;Nested SigWit (P2SH)&lt;/li&gt;
&lt;li&gt;Native SegWit (Bech32)&lt;/li&gt;
&lt;li&gt;Taproot (P2TR)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Introduction
&lt;/h3&gt;

&lt;p&gt;Welcome to the second part of the series. incase if you haven't already gone over the first part, please ensure you check it out here &lt;a href="https://dev.to/shytypes1028/bitcoin-a-dummys-technical-guide-to-the-bitcoin-ecosystem-part-1-oje"&gt;Bitcoin - A dummy's technical guide to the bitcoin ecosystem part 1&lt;/a&gt;. So you would have a better understanding of this part.&lt;/p&gt;

&lt;p&gt;In this part we'll be talking about the different bitcoin addresses and what forms of improvement they bring into the Bitcoin ecosystem. we may get a little technical in this article but hey it's nothing we can't handle right?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8n400qs8i602xjwwg4yc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8n400qs8i602xjwwg4yc.gif" alt="wink" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let's get to it shall we?&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Understanding Bitcoin addresses
&lt;/h3&gt;

&lt;p&gt;Now we know that the Bitcoin address is a fundamental part of the Bitcoin ecosystem that ensures transaction validations, generation of digital signatures and a host of important functionalities. Owing to the importance of Bitcoin addresses, over the years there have been multiple updates via soft forks to the Bitcoin network that have added improvements to Bitcoin addresses and their impact on the Bitcoin network.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Why do we have different Bitcoin address types?
&lt;/h3&gt;

&lt;p&gt;Have you ever wondered why there are multiple Bitcoin addresses and what improvements they bring into the Bitcoin ecosystem?. Keep reading for a brief breakdown.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pu2wf0a3kwpyanc2eut.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pu2wf0a3kwpyanc2eut.gif" alt="thinking" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well around 2016 and 2017, there was a discussion or debate around the Bitcoin &lt;code&gt;Block size&lt;/code&gt; which was &lt;code&gt;1 mb&lt;/code&gt; per block and so only a limited amount of transactions could be added to a block. The accepted solution was to take a part of the transaction called the &lt;code&gt;witness data&lt;/code&gt; and move it to a second layer on the blockchain there by allowing more space for transactions on the main block and increasing the block size naturally allowing more transactions to fit into a block.&lt;/p&gt;

&lt;p&gt;Now Let's do a quick walkthrough of the various Bitcoin addresses with some quick facts.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Legacy Address a.k.a Pay-to-Public-Key-Hash (P2PKH)
&lt;/h3&gt;

&lt;p&gt;This is the oldest of all Bitcoin addresses. In fact, it is the original Bitcoin address and has a prefix of &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Quick Facts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They are accountable, stable and universally supported.&lt;/li&gt;
&lt;li&gt;Transactions via Legacy addresses have are large in size, meaning they take up more block space.&lt;/li&gt;
&lt;li&gt;transactions from Legacy addresses have high transaction fees due to the size of the transactions&lt;/li&gt;
&lt;li&gt;Legacy addresses are &lt;code&gt;not&lt;/code&gt; SegWit compatible what this means is that on the Bitcoin network, only Legacy addresses can carry out transactions with with each other i'e send and and receive BTC.&lt;/li&gt;
&lt;li&gt;Legacy addresses have long transaction processing times.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Nested SegWit a.k.a Pay-to-Script-Hash (P2SH)
&lt;/h3&gt;

&lt;p&gt;This address is an improvement over &lt;code&gt;Legacy addresses&lt;/code&gt; the implements better scalability, security and smaller block size their by enabling multiple transactions on the blockchain without having too much of an impact on the the Bitcoin blockchain size. it has a prefix of &lt;code&gt;3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Nested SegWit was launched around 2017 and it basically reduced the size of each Bitcoin transaction's data by isolating part of the transaction signature data from the main transaction data.&lt;/p&gt;

&lt;p&gt;Quick Facts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;They have cheeper transaction fees and enhanced security over &lt;code&gt;Legacy addresses&lt;/code&gt; thy achieve this through multi-signature capabilities.&lt;/li&gt;
&lt;li&gt;Nested SegWit addresses have cross compatibility meaning transactions can be carried out between Nested SegWit and other types of Bitcoin Addresses.&lt;/li&gt;
&lt;li&gt;The introduction and implementation of Nested SegWit gave birth to the Lightning Network&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Native SegWit a.k.a pay-to-witness-public-key-hash (Bech32)
&lt;/h3&gt;

&lt;p&gt;This type of Bitcoin address has a prefix of "bc1q" and it is an upgrade to the Nested SegWit. It is also compatible with most wallets and exchanges by default. Native SegWit has a primary focus on weight efficiency, which brings about a reduction in the weight of Bitcoin blocks and this weight reduction naturally translates to faster transaction speeds, which enhances the network’s scalability and further lowers the transaction fees.&lt;/p&gt;

&lt;p&gt;Quick Facts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Native SegWit Bitcoin addresses are in lowercase for enhanced readability and better error detection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Taproot a.k.a Pay-to-Taproot (P2TR)
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Taproot&lt;/code&gt; is by far one of the coolest things to have ever happened to the Bitcoin ecosystem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fggn2sgychtk7ramaixa7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fggn2sgychtk7ramaixa7.gif" alt="coolest" width="480" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This Bitcoin Address type has a prefix pf "bc1p" and has the lowest transaction fees of all existing Bitcoin Address types. Taproot (P2TR) is a new address format that was introduced in 2021 as an update to the Segwit address type. One major shift in the dynamics of bitcoin addresses via Taproot is that it implements the &lt;code&gt;Schnorr digital signature&lt;/code&gt; which is a shift from the conventional &lt;code&gt;Elliptic curve digital signature algorithm&lt;/code&gt; previous bitcoin address types have of used for years.&lt;/p&gt;

&lt;p&gt;Quick Facts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Taproot aims to make bitcoin transactions cheeper, more efficient, private and also unlocks the potential of smart contracts on the bitcoin network via a couple of new implementations one of which is a system called the &lt;code&gt;Merklized Abstract Syntax Trees (MAST)&lt;/code&gt; which enables conditions placed on a transaction to be condensed and hashed into one script.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Schnorr digital signatures&lt;/code&gt; which Taproot makes use of allows for transaction grouping. what this means is that multiple transactions from a bitcoin wallet can be hashed together and assigned a unique key. Simple and complex transactions containing multiple signatures would naturally be indistinguishable via this hashing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Quick Link: &lt;a href="https://tara-annison.medium.com/what-are-taproot-mast-and-schnorr-signatures-b737dae20681" rel="noopener noreferrer"&gt;https://tara-annison.medium.com/what-are-taproot-mast-and-schnorr-signatures-b737dae20681&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Conclusion
&lt;/h3&gt;

&lt;p&gt;The best part about an open blockchain system is how it is community driven and so over time improvements are welcomed and accepted to further scale the network. So Which of the Bitcoin addresses would you be making use of?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7m3re8elu62j4u1v3uz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7m3re8elu62j4u1v3uz.gif" alt="Goodbye" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for staying till the end, Goodbye and see you in the next one.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Useful links
&lt;/h3&gt;

&lt;p&gt;Check out these links for further reading&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bitcoinbook/bitcoinbook" rel="noopener noreferrer"&gt;Bitcoinbook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/pulse/demystifying-bitcoin-address-types-legacy-segwit-native-soren-azorian/" rel="noopener noreferrer"&gt;Soren Azorian | Demystifying Bitcoin Address Types: Legacy, SegWit, Native SegWit, and Taproot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://trustwallet.com/blog/bitcoin-native-segwit-vs-taproot-a-comprehensive-guide-for-beginners" rel="noopener noreferrer"&gt;Bitcoin - Native SegWit vs Taproot: A Comprehensive Guide for Beginners&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tara-annison.medium.com/what-are-taproot-mast-and-schnorr-signatures-b737dae20681" rel="noopener noreferrer"&gt;What are Taproot, MAST and Schnorr Signatures?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Simulate your first Lightning transaction on the Bitcoin regtest network Part 1 (MacOS)</title>
      <dc:creator>Abba Adamu</dc:creator>
      <pubDate>Sat, 30 Mar 2024 17:38:33 +0000</pubDate>
      <link>https://dev.to/shytypes1028/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-1-macos-4o3c</link>
      <guid>https://dev.to/shytypes1028/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-1-macos-4o3c</guid>
      <description>&lt;h3&gt;
  
  
  Objective
&lt;/h3&gt;

&lt;p&gt;The goal of this article is to help you&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;configure the Bitcoin environment&lt;/li&gt;
&lt;li&gt;create a Bitcoin wallet&lt;/li&gt;
&lt;li&gt;create an address, give it a label&lt;/li&gt;
&lt;li&gt;mine some blocks to that address&lt;/li&gt;
&lt;li&gt;configure two Lightening nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Introduction
&lt;/h3&gt;

&lt;p&gt;This was me after I recently started my journey in Bitcoin development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s20gvkukhxlo1yt0kx4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0s20gvkukhxlo1yt0kx4.gif" alt="angry" width="395" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I felt so overwhelmed by the resources online mainly because I found out that certain information where either left out or now deprecated. so I was inspired to write my take on this topic because it confused me the most.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Requirements
&lt;/h3&gt;

&lt;p&gt;To be able to follow along, you must have both &lt;a href="https://github.com/bitcoin/bitcoin" rel="noopener noreferrer"&gt;bitcoind&lt;/a&gt; and &lt;a href="https://github.com/lightningnetwork/lnd" rel="noopener noreferrer"&gt;lnd&lt;/a&gt; installed.&lt;/p&gt;

&lt;p&gt;Below are two articles that helped me through this topic's installation, setup, and research phases.&lt;/p&gt;

&lt;p&gt;Their work heavily inspires this article and has made use of references appropriately.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Author&lt;/th&gt;
&lt;th&gt;Article&lt;/th&gt;
&lt;th&gt;Study flow&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://dev.to/tvpeter"&gt;Peter Tyonum&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://dev.to/tvpeter/how-to-setup-bitcoin-core-and-lightning-network-node-developer-environment-3lil"&gt;How to Setup Bitcoin Core and Lightning Network Node Developer Environment&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Start here&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://medium.com/@bitstein?source=post_page-----ab967167594a--------------------------------" rel="noopener noreferrer"&gt;Michael Goldstein&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://medium.com/@bitstein/setting-up-a-bitcoin-lightning-network-test-environment-ab967167594a" rel="noopener noreferrer"&gt;Setting Up a Bitcoin/Lightning Network Test Environment&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Go here next&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;⚙️ My system specs&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine: MacBook Pro&lt;/li&gt;
&lt;li&gt;Operating System: macOS Monterey&lt;/li&gt;
&lt;li&gt;terminal: kitty&lt;/li&gt;
&lt;li&gt;shell: ZSH&lt;/li&gt;
&lt;li&gt;Editor: Neovim&lt;/li&gt;
&lt;li&gt;Package Manager: &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;📜 The boring but very important stuff&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjporoi8h98n5ymq9es8f.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjporoi8h98n5ymq9es8f.gif" alt="rick sleeping" width="480" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we get to copying and pasting stuff into our terminal(the fun part), let's look at what the internet has to say about the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The lightning network and how it interacts with the Bitcoin network&lt;/li&gt;
&lt;li&gt;The various Bitcoin network modes.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;"The Lightning Network is a second-layer protocol built on top of the Bitcoin blockchain. It enables faster and cheaper transactions by creating off-chain payment channels between users. These channels allow multiple transactions to occur without needing to be recorded on the main Bitcoin blockchain. Instead, only the opening and closing transactions of the channel are settled on the blockchain. This interaction reduces congestion on the Bitcoin network and enables microtransactions with almost instant settlement times."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;📡 The Bitcoin testnet network mode&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"It’s a public test blockchain where the bitcoin does not have a real-world value that works similarly to the mainnet blockchain. In this way, it is safe to test out some functionality."&lt;/em&gt; &lt;strong&gt;&lt;em&gt;source:&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://studygroup.moralis.io/t/bitcoin-testnet-vs-regtest-reading-assignment/7914/2#:~:text=Apr%20%2719-,What%20is%20testnet%20in%20Bitcoin,-%3F%0Ait%E2%80%99s%20a" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;https://studygroup.moralis.io/&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;📡 The Bitcoin regtest network mode&lt;/strong&gt; 👈🏿 (this is the mode we are going to be using)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;*"Regtest (regression test) mode creates a local private blockchain where you can adjust the parameters to what you want. You usually use this when it is not needed to communicate with other peers and blocks. An example of what you can do with the parameters is you can create blocks instantly"*&lt;strong&gt;&lt;em&gt;Source:&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://studygroup.moralis.io/t/bitcoin-testnet-vs-regtest-reading-assignment/7914/2#:~:text=Apr%20%2719-,What%20is%20testnet%20in%20Bitcoin,-%3F%0Ait%E2%80%99s%20a" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;https://studygroup.moralis.io/&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;📡 The Bitcoin signet network mode&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;*"Signet is a proposed new test network parallel to the Bitcoin network. Like testnet and regtest, developers would use signet as a testing environment. Unlike the Bitcoin mainnet or the other test networks, signet would use digital signatures to validate blocks, not a Proof-of-Work system."*&lt;strong&gt;&lt;em&gt;Source:&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://river.com/learn/terms/s/signet/#:~:text=Signet%20is%20a%20proposed%20new%20test%20network%20parallel%20to%20the%20Bitcoin%20network.%20Like%20testnet%20and%20regtest%2C%20signet%20would%20be%20used%20by%20developers%20as%20a%20testing%20environment.%20Unlike%20the%20Bitcoin%20mainnet%20or%20the%20other%20test%20networks%2C%20signet%20would%20use%20digital%20signatures%20to%20validate%20blocks%2C%20not%20a%20Proof%2Dof%2DWork%20system." rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;em&gt;https://river.com/&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Now to the good stuff:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚙️ Configuring our Bitcoin environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcqz0wasqiso79fpb2cs.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcqz0wasqiso79fpb2cs.gif" width="500" height="213"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1a&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This part is very important. if you have gone over the &lt;a href="https://medium.com/@bitstein/setting-up-a-bitcoin-lightning-network-test-environment-ab967167594a" rel="noopener noreferrer"&gt;Setting Up a Bitcoin/Lightning Network Test Environment&lt;/a&gt; as I suggested above you would realize that the author manually created a &lt;code&gt;bitcoin.conf&lt;/code&gt; but we'll be using the one at &lt;code&gt;/Users/user/Library/Application Support/Bitcoin/bitcoin.conf&lt;/code&gt; auto-generated while installing bitcoin core.&lt;/p&gt;

&lt;p&gt;now let's open up the autogenerated &lt;code&gt;bitcoin.conf&lt;/code&gt; file with our text editor&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvim /Users/user/Library/Application Support/Bitcoin/bitcoin.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add these settings below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Daemon Options
server=1
daemon=1
fallbackfee=0.00072
txindex=1
mintxfee=0.0001
txconfirmtarget=6

# Network Options
regtest=1
#signet=1
#testnet=1

[regtest]
# RPC Options
rpcport=18443
rpcuser=bitcoin
rpcpassword=bitcoin

# ZMQ Options
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333
zmqpubhashtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you can run your Bitcoin node service and the following commands from the terminal. Ensure your Bitcoin backend is all set and ready to run your lightning network.&lt;/p&gt;

&lt;p&gt;Take note of the corresponding outputs to make sure you're on the right track. please note that I have truncated some outputs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Start bitcoin service&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bitcoind
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bitcoin Core starting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;ensure you are on regtest&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bitcoin-cli  getblockchaininfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"chain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"regtest"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;just&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;making&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;sure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;we&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'regtest'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;network&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"blocks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;526&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;526&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;create a Bitcoin wallet&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bitcoin-cli createwallet "my_first_regtest_wallet"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"my_first_regtest_wallet"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Create an address (we'll be generating a&lt;/em&gt; &lt;code&gt;legacy&lt;/code&gt; address)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;**Quick note: ** A legacy address refers to a format for cryptocurrency addresses that was used in older versions of the blockchain protocol. For example, in Bitcoin, legacy addresses typically start with the number "1". These addresses are still functional but are being gradually phased out in favor of newer address formats like Segregated Witness (SegWit) addresses, which offer benefits like lower transaction fees and improved scalability.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bitcoin-cli getnewaddress -addresstype legacy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhF5zQHNn7wzaaQTpzRmtsNgPgFF94fxeY  //👈🏿 yours will be different
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Assign a label to the address generated above to make it easy to identify it&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $ bitcoin-cli setlabel "mhF5zQHNn7wzaaQTpzRmtsNgPgFF94fxeY" "my_first_address"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;get a list of all our generated addresses&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $ bitcoin-cli listreceivedbyaddress 1 true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"mhF5zQHNn7wzaaQTpzRmtsNgPgFF94fxeY"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"confirmations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"label"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"my_first_address"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"txids"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Mine some block to the address (This is important)&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Quick note:&lt;/strong&gt; I faced a sticky issue when trying to run my &lt;code&gt;lncli commands&lt;/code&gt; and so after doing some research found a solution which was basically to generate some blocks check here to know more about the issue &lt;a href="https://github.com/lightningnetwork/lnd/issues/1177#issuecomment-1100012559" rel="noopener noreferrer"&gt;https://github.com/lightningnetwork/lnd/issues/1177#issuecomment-1100012559&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; $  bitcoin-cli generatetoaddress 101 "mhF5zQHNn7wzaaQTpzRmtsNgPgFF94fxeY"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="s2"&gt;"461c729e6afecd371a5dac52aa06955fbcaa41688b67d1130887a761ab972064"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"793c537c37a6cea487b762fdb2ca0af6bf15797f5f8f9847fe07dcf982cdc6b4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"422a76fd34cbf65743416f1e256129935c04cd40cb81a80c891e28425f78974d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"1a987221c802116c70c18b2cdd1233ec906c0800835eac3fe9e489b17d911ce8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Check our wallet info&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ bitcoin-cli getwalletinfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"walletname"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"my_first_regtest_wallet"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"walletversion"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;169900&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"format"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sqlite"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;137.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"unconfirmed_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"immature_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;471.875&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"txcount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;122&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keypoolsize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"keypoolsize_hd_internal"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"paytxfee"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"private_keys_enabled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"avoid_reuse"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scanning"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"descriptors"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"external_signer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"blank"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"lastprocessedblock"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0da2df1e8591e6ac00c1390fe397580b267c5b63a729f802e0bdd458aafb46f0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;648&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;⚙️ Configuring two LND nodes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1a&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;we'll be creating a base or root directory called &lt;code&gt;.lnd&lt;/code&gt; using the &lt;a href="https://phoenixnap.com/kb/create-directory-linux-mkdir-command#:~:text=The%20mkdir%20command%20in%20Linux/Unix%20is%20a%20command%2Dline%20utility%20that%20allows%20users%20to%20create%20new%20directories.%20mkdir%20stands%20for%20%22make%20directory.%22" rel="noopener noreferrer"&gt;mkdir&lt;/a&gt; Linux command. please note that this directory can be named anything you wish same&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ mkdir ~/.lnd/.lnd1
$ mkdir ~/.lnd/.lnd2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a configuration file and add the settings below then save it as lnd.conf in the .lnd1 directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Bitcoin]

bitcoin.active=1
bitcoin.regtest=1
bitcoin.node=bitcoind

[Bitcoind]

bitcoind.rpchost=127.0.0.1
bitcoind.rpcuser=bitcoin
bitcoind.rpcpass=bitcoin
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 1b&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now just like in step 1a above, Create a configuration file add the settings below, and then save it as lnd.conf in the .lnd2 directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Application Options]

listen=0.0.0.0:9734
rpclisten=127.0.0.1:11009
restlisten=0.0.0.0:8180

[Bitcoin]

bitcoin.active=1
bitcoin.regtest=1
bitcoin.node=bitcoind

[Bitcoind]

bitcoind.rpchost=127.0.0.1
bitcoind.rpcuser=bitcoin
bitcoind.rpcpass=bitcoin
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;**Quick note: ** Notice that the config above has different ports and settings for network, RPC, and REST connections configured. well, to mention a few reasons:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Each LND instance needs to listen on different ports to avoid conflicts.&lt;/li&gt;
&lt;li&gt;You might want &lt;code&gt;lnd1&lt;/code&gt; and &lt;code&gt;lnd2&lt;/code&gt; to use different wallets or have different wallet configurations. _ You might configure different network settings for each LND instance. For example, one might be configured to run on the &lt;code&gt;Bitcoin mainnet&lt;/code&gt; while the other runs on the &lt;code&gt;Bitcoin testnet&lt;/code&gt; but note that it is required that you run the two LN nodes on the same network for the sake of running transactions between them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;lastly, let's configure some aliases so let's open up &lt;code&gt;~/.zshrc&lt;/code&gt; with our favourite text editor once again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvim ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now add this to the bottom.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# local variables
export LND1_DIR="$HOME/.lnd/.lnd1"
export LND2_DIR="$HOME/.lnd/.lnd2"

# aliases
#lnd1
alias lnd1="lnd --lnddir=$LND1_DIR";
alias lncli1="lncli -n regtest --lnddir=$LND1_DIR"

#lnd2
alias lnd2="lnd --lnddir=$LND2_DIR";
alias lncli2="lncli -n regtest --lnddir=$LND2_DIR --rpcserver=localhost:11009"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;em&gt;This is the end of the first part of the series. we'll be going over some preliminary setup and configuration for a successful transaction between 2 lightning nodes in the next part&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;📜 Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9l0lq28hdl62vw0ph2f.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9l0lq28hdl62vw0ph2f.gif" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you feel rushed, don't you? Don't worry It took me close to a week to understand this so it's fine if you don't entirely get what's going on for now. check out some of these useful links below &lt;a href="https://chainquery.com/bitcoin-cli" rel="noopener noreferrer"&gt;chainquery: bitcoin-cli documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>bitcoin</category>
      <category>lightning</category>
    </item>
    <item>
      <title>Simulate your first Lightning transaction on the Bitcoin regtest network Part 3 (MacOS)</title>
      <dc:creator>Abba Adamu</dc:creator>
      <pubDate>Tue, 26 Mar 2024 11:02:11 +0000</pubDate>
      <link>https://dev.to/shytypes1028/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-3-macos-4b22</link>
      <guid>https://dev.to/shytypes1028/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-3-macos-4b22</guid>
      <description>&lt;h3&gt;
  
  
  📜Objective
&lt;/h3&gt;

&lt;p&gt;The goal of this article is to help you&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Connect the lightning nodes to form a peer&lt;/li&gt;
&lt;li&gt;Open a payment channel between &lt;code&gt;lnd1&lt;/code&gt; and &lt;code&gt;lnd2&lt;/code&gt; nodes&lt;/li&gt;
&lt;li&gt;Add some confirmations to the block that the channel opening transaction was mined on&lt;/li&gt;
&lt;li&gt;Check the list of channels to ensure our channel is ready and funded&lt;/li&gt;
&lt;li&gt;Create an invoice on &lt;code&gt;lnd2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;inspect the invoice created above from &lt;code&gt;lnd1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Pay or satisfy the invoice created by &lt;code&gt;lnd2&lt;/code&gt; via &lt;code&gt;lnd1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Close the payment channels, kill both Bitcoin and lightning daemons&lt;/li&gt;
&lt;li&gt;Celebrate the success of this tutorial with a cold bottle of beer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Introduction
&lt;/h3&gt;

&lt;p&gt;Hey there, welcome to the final part of this 3 part series on simulating your first lightning transaction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7htknp4e1s38g9pcprgy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7htknp4e1s38g9pcprgy.gif" alt="dancing" width="480" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are as happy as I am to finally wrap up the series, let's get right to it....&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;p&gt;To be successful in this tutorial in case if you haven't already gone through the previous parts leading up to this one, ensure you;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ checkout &lt;a href="https://shyxperience.hashnode.dev/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-1-macos" rel="noopener noreferrer"&gt;Part 1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;✅ checkout &lt;a href="https://shyxperience.hashnode.dev/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-2-macos" rel="noopener noreferrer"&gt;Part 2&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;✅ Have a running Bitcoin network daemon (on regtest)&lt;/li&gt;
&lt;li&gt;✅ Have two active and running lightning node instances as lnd1 and lnd2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the above prerequisites list has been satisfied then you can proceed beyond this point.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Connect the lightning nodes to form a peer
&lt;/h3&gt;

&lt;p&gt;Now that both of our nodes are ready for some action, we need to connect them to form a &lt;code&gt;peer-to-peer&lt;/code&gt; network this would enable our nodes to communicate with each other on the network by opening and closing channels.&lt;/p&gt;

&lt;p&gt;From &lt;code&gt;lnd1&lt;/code&gt; run&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lncli1 listpeers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"peers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;no&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;peers&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;now...let's&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;fix&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;that.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From &lt;code&gt;lnd2&lt;/code&gt; run the command below to get its &lt;code&gt;identity_pubkey&lt;/code&gt; which we would use in connecting the node to &lt;code&gt;lnd1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lncli2 getinfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0.17.0-beta commit=fn/v1.0.1-85-ge31d15989"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"commit_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"e31d1598932a814c2d44b774e5110746295df711"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"identity_pubkey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;copy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;this&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"alias"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"024baa5e16c118f42cdd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's connect &lt;code&gt;lnd2&lt;/code&gt; to &lt;code&gt;lnd1&lt;/code&gt; by passing the &lt;code&gt;identity_pubkey&lt;/code&gt;, &lt;code&gt;IP address&lt;/code&gt; and &lt;code&gt;port&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; lncli1 connect 024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579@localhost:9734
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;don't&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;worry&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;this&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;correct&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;output.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's check for the list of peers once again at &lt;code&gt;lnd1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  lncli1 listpeers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"peers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"pub_key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"127.0.0.1:9734"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"bytes_sent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"394"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"bytes_recv"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"394"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sat_sent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sat_recv"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"inbound"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ping_time"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"-1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"sync_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"ACTIVE_SYNC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="err"&gt;.....&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}]}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎉 Both Nodes are now successfully connected as a &lt;code&gt;peer&lt;/code&gt; on our local lightning network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff8781ga3r3yu63nkh0e1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff8781ga3r3yu63nkh0e1.gif" alt="connected" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Open a payment channel between &lt;code&gt;lnd1&lt;/code&gt; and &lt;code&gt;lnd2&lt;/code&gt; nodes
&lt;/h3&gt;

&lt;p&gt;Now let's open up a &lt;code&gt;payment channel&lt;/code&gt; between &lt;code&gt;lnd1&lt;/code&gt; and &lt;code&gt;lnd2&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick note: A payment channel on the lightning network is a two-way connection between two parties (lightning nodes) that enables them to exchange bitcoin.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To create a payment channel between &lt;code&gt;lnd1&lt;/code&gt; and &lt;code&gt;lnd2&lt;/code&gt;, we'll be making use of the &lt;code&gt;pub_key&lt;/code&gt; of &lt;code&gt;lnd2&lt;/code&gt; and we'll then be funding the channel with &lt;code&gt;100,000 SAT&lt;/code&gt;. the &lt;code&gt;100,000 SAT&lt;/code&gt; is &lt;code&gt;lnd1's&lt;/code&gt; contribution to the channel&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; lncli1 openchannel 024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579 100000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"funding_txid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0e5e4d4f8f793cddd9370eb81140d5bc168b0e32200a3a17177d9e4da26607b0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Mine some blocks to increase the confirmations for the Channel opening transaction
&lt;/h3&gt;

&lt;p&gt;Once the channel has been created and &lt;code&gt;lnd1's&lt;/code&gt; BTC contribution has been added to the channel, we need to mine/generate some blocks to increase confirmations for the Channel opening transaction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   bitcoin-cli &lt;span class="nt"&gt;-generate&lt;/span&gt; 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"bcrt1q5ltxhvn3essvq5ldzpfrvlhul73auec4ekg4fk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"blocks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"518ab6ab9e6e93ef03be2da8a8f728358cb0d4270126d1770cdb223df52f9f11"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"01f8a4a87c0c8c98697458e42bdb459af095ba90ad9ae165ac3c31be9addf447"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"3880fe05eaf1cff356d7b035d619704a6b93893b225fb31a938ca7275488229c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"11e52d12e2d7547dd1f47a44d088bd59fd73c7c436b4076c03e51d78a3fba25e"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Check the list of channels
&lt;/h3&gt;

&lt;p&gt;Run the command below to check the list of active channels and to confirm that the channel between both nodes is well-funded and ready.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    lncli1 listchannels
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"active"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"remote_pubkey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"channel_point"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0e5e4d4f8f793cddd9370eb81140d5bc168b0e32200a3a17177d9e4da26607b0:0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"chan_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"735573279047680"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"capacity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"100000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"local_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"96530"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"remote_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"commit_fee"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"3140"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"commit_weight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"772"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"fee_per_kw"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"2500"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"unsettled_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"total_satoshis_sent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"total_satoshis_received"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Create an invoice on &lt;code&gt;lnd2&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Now that we have confirmed that our channel is ready for transactions, let's go ahead and create a payable invoice for an amount of &lt;code&gt;50,000 SAT&lt;/code&gt; on &lt;code&gt;lnd2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   lncli2 addinvoice &lt;span class="nt"&gt;--amt&lt;/span&gt; 50000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"r_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"28f35ccf79cfc8545351ae362b4fdb0f85437ddf452c1aebd399227607e0eb6e"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"payment_request"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"lnbcrt500u1pja5y06pp59re4enmeely9g5634cmzkn7mp7z5xlwlg5kp467nny38vplqadhqdqqcqzzsxqyz5vqsp58p5xllcxwt76rt7hjtjwuec2n5sfgv2t9kkc6vplrhsk2edj6ndq9qyysgqs8aysfmfz60jexh03kq27cmpym5qw8hw55wac4mqmj6t684t48u89kqaw0m7y0xuyygh5uuj95643gde3vse7zxgtu4aycfwfwk5z3cqfwmtp7"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"add_index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;total&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;amount&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;invoices&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;created.&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"payment_addr"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"38686fff0672fda1afd792e4ee670a9d2094314b2dad8d303f1de16565b2d4da"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's quickly inspect or confirm the details of this newly created invoice from &lt;code&gt;lnd1&lt;/code&gt; by making use of the invoice's &lt;code&gt;payment_request&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   lncli1 decodepayreq lnbcrt500u1pja5y06pp59re4enmeely9g5634cmzkn7mp7z5xlwlg5kp467nny38vplqadhqdqqcqzzsxqyz5vqsp58p5xllcxwt76rt7hjtjwuec2n5sfgv2t9kkc6vplrhsk2edj6ndq9qyysgqs8aysfmfz60jexh03kq27cmpym5qw8hw55wac4mqmj6t684t48u89kqaw0m7y0xuyygh5uuj95643gde3vse7zxgtu4aycfwfwk5z3cqfwmtp7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"destination"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"payment_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"28f35ccf79cfc8545351ae362b4fdb0f85437ddf452c1aebd399227607e0eb6e"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"num_satoshis"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"50000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"1708790266"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"expiry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"86400"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"description_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"fallback_addr"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"cltv_expiry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"80"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"route_hints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"payment_addr"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"38686fff0672fda1afd792e4ee670a9d2094314b2dad8d303f1de16565b2d4da"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"num_msat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"50000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"features"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"8"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"tlv-onion"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"is_required"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"is_known"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Pay or satisfy the invoice created by &lt;code&gt;lnd2&lt;/code&gt; via &lt;code&gt;lnd1&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Time for &lt;code&gt;lnd1&lt;/code&gt; to pay up 🧾&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyvfj5g92ex7nidmz7qq7.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyvfj5g92ex7nidmz7qq7.gif" alt="payment" width="480" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run the command below and follow the prompts to confirm payment&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  lncli1 payinvoice lnbcrt500u1pja5y06pp59re4enmeely9g5634cmzkn7mp7z5xlwlg5kp467nny38vplqadhqdqqcqzzsxqyz5vqsp58p5xllcxwt76rt7hjtjwuec2n5sfgv2t9kkc6vplrhsk2edj6ndq9qyysgqs8aysfmfz60jexh03kq27cmpym5qw8hw55wac4mqmj6t684t48u89kqaw0m7y0xuyygh5uuj95643gde3vse7zxgtu4aycfwfwk5z3cqfwmtp7
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Payment hash: 28f35ccf79cfc8545351ae362b4fdb0f85437ddf452c1aebd399227607e0eb6e
Description:
Amount (in satoshis): 50000
Fee limit (in satoshis): 2500
Destination: 024baa5e16c118f42cddd95fd828b32fa8dfcfea55fa384e89e2da0f3b96fc4579
Confirm payment (yes/no): yes
+------------+--------------+--------------+--------------+-----+----------+-----------------+----------------------+
| HTLC_STATE | ATTEMPT_TIME | RESOLVE_TIME | RECEIVER_AMT | FEE | TIMELOCK | CHAN_OUT | ROUTE |
+------------+--------------+--------------+--------------+-----+----------+-----------------+----------------------+
| SUCCEEDED | 0.086 | 0.565 | 50000 | 0 | 761 | 735573279047680 | 024baa5e16c118f42cdd |
+------------+--------------+--------------+--------------+-----+----------+-----------------+----------------------+
Amount + fee: 50000 + 0 sat
Payment hash: 28f35ccf79cfc8545351ae362b4fdb0f85437ddf452c1aebd399227607e0eb6e
Payment status: SUCCEEDED, preimage: 071ae531770166a26d7b42a82a6215776a4f90f1e9935c1f225077158b3782c9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have made payment, let's look up the invoice on &lt;code&gt;lnd2&lt;/code&gt; we'll be using the &lt;code&gt;payment hash&lt;/code&gt; above&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    lncli2 lookupinvoice 28f35ccf79cfc8545351ae362b4fdb0f85437ddf452c1aebd399227607e0eb6e
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"memo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"r_preimage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"071ae531770166a26d7b42a82a6215776a4f90f1e9935c1f225077158b3782c9"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"r_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"28f35ccf79cfc8545351ae362b4fdb0f85437ddf452c1aebd399227607e0eb6e"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"50000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"value_msat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"50000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"settled"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;invoice&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;has&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;been&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;fulfilled&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;✅&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"creation_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"1708790266"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"settle_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"1708793723"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"payment_request"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"lnbcrt500u1pja5y06pp59re4enmeely9g5634cmzkn7mp7z5xlwlg5kp467nny38vplqadhqdqqcqzzsxqyz5vqsp58p5xllcxwt76rt7hjtjwuec2n5sfgv2t9kkc6vplrhsk2edj6ndq9qyysgqs8aysfmfz60jexh03kq27cmpym5qw8hw55wac4mqmj6t684t48u89kqaw0m7y0xuyygh5uuj95643gde3vse7zxgtu4aycfwfwk5z3cqfwmtp7"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"description_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"expiry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"86400"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"fallback_addr"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"cltv_expiry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"80"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"route_hints"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Close the payment channel, kill both Bitcoin and lightning daemons
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;"Eventually, all good things must come to an end"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwuz6l0nk9462cj9skg4w.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwuz6l0nk9462cj9skg4w.gif" alt="explosion" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are finally done with all lightning transactions so let's go ahead and close the payment channel and kill all running lightning and Bitcoin daemons as we close for the day.&lt;/p&gt;

&lt;p&gt;Run the command below from any of the two nodes&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    lncli2 closeallchannels
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"remote_pub_key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"02e0810d836946eebaeb9186c45ebb0c2d17294890ec67f488c9127de4d51dd3cd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"channel_point"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0e5e4d4f8f793cddd9370eb81140d5bc168b0e32200a3a17177d9e4da26607b0:0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"closing_txid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"9b9e88eec1d3708d97588088e6e40cd0d3cc65163baabb5215445785268f5b78"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check the list of channels&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    lncli2 listchannels
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;no&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;active&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;channel&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the command below to kill all running daemons&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;     lncli1 stop &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; lncli2 stop &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; bitcoin-cli stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Bitcoin Core stopping
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Conclusion
&lt;/h3&gt;

&lt;p&gt;Finally, an amazing end to a three part journey.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8itukffcfz5ywdis1fhd.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8itukffcfz5ywdis1fhd.gif" alt="happy" width="500" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this article helped you gain some hands-on experience in working with the lightning network. Remember, Lightning payments are faster, cheaper and less complex than the conventional bitcoin transaction. see you in the next one 👋🏿&lt;/p&gt;

</description>
      <category>bitcoin</category>
    </item>
    <item>
      <title>Simulate your first Lightning transaction on the Bitcoin regtest network Part 2 (MacOS)</title>
      <dc:creator>Abba Adamu</dc:creator>
      <pubDate>Tue, 26 Mar 2024 10:56:19 +0000</pubDate>
      <link>https://dev.to/shytypes1028/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-2-macos-2el0</link>
      <guid>https://dev.to/shytypes1028/simulate-your-first-lightning-transaction-on-the-bitcoin-regtest-network-part-2-macos-2el0</guid>
      <description>&lt;h3&gt;
  
  
  📜Objective
&lt;/h3&gt;

&lt;p&gt;The goal of this article is to help you&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;confirm that we have the correct bitcoin.conf settings&lt;/li&gt;
&lt;li&gt;spin up a Bitcoin network&lt;/li&gt;
&lt;li&gt;Ensure we are on the regtest network&lt;/li&gt;
&lt;li&gt;Prepare the first lightning node aka &lt;code&gt;lnd1&lt;/code&gt; for some action

&lt;ul&gt;
&lt;li&gt;Spin up node&lt;/li&gt;
&lt;li&gt;Create wallet&lt;/li&gt;
&lt;li&gt;Get some information about the node&lt;/li&gt;
&lt;li&gt;Generate an Address&lt;/li&gt;
&lt;li&gt;Fund the &lt;code&gt;lnd1&lt;/code&gt; wallet with some bitcoin&lt;/li&gt;
&lt;li&gt;load up our existing local Bitcoin wallet&lt;/li&gt;
&lt;li&gt;send some bitcoin to generated &lt;code&gt;lnd1&lt;/code&gt; wallet address (to be sent to &lt;code&gt;lnd2&lt;/code&gt; later on)&lt;/li&gt;
&lt;li&gt;Check wallet balance&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Prepare the second lightning node aka &lt;code&gt;lnd2&lt;/code&gt; for some action&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Introduction
&lt;/h3&gt;

&lt;p&gt;Welcome to Part 2 of our series, fellow Bitcoin/Lightning developers. I'm sure you're itching for some action...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04xn8e3pmb2e9pumg2gq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04xn8e3pmb2e9pumg2gq.gif" alt="morty cop" width="480" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the second part of a two-part series and in case you haven't already read the first part go over here &lt;a href="https://hashnode.com/post/clsctrvcp00000ale7n0pfur8" rel="noopener noreferrer"&gt;Part 1&lt;/a&gt; so you can fully maximize this second part.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Some boring but very important stuff to get us started
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtwbuxtqm2zfam97bh6x.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtwbuxtqm2zfam97bh6x.gif" alt="rick thinking" width="480" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Lightning Network is a second-layer protocol built on top of the &lt;code&gt;Bitcoin blockchain&lt;/code&gt; and it enables faster and cheaper transactions by creating off-chain payment &lt;code&gt;channels&lt;/code&gt; between &lt;code&gt;users&lt;/code&gt;. These &lt;code&gt;channels&lt;/code&gt; allow multiple transactions to occur without needing to be recorded on the main &lt;code&gt;Bitcoin blockchain&lt;/code&gt;. Instead, only the opening and closing &lt;code&gt;transactions&lt;/code&gt; of the channel are settled on the &lt;code&gt;blockchain&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The Regtest (regression test) Bitcoin network mode creates a &lt;code&gt;local private blockchain&lt;/code&gt; where you can adjust the parameters to what you want. For this demonstration, we would run our lightning network on top of an active Bitcoin network running a local private blockchain (regtest)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Quick note: throughout this article, long &lt;code&gt;output&lt;/code&gt; codeblock data are truncated&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;The easy part:&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ Confirming our Bitcoin environment and spinning up a Bitcoin daemon
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49iylmdp19idqiutxkce.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F49iylmdp19idqiutxkce.gif" alt="rick inspecting" width="480" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To confirm that our settings are correct to spin up the required Bitcoin network mode, open up the autogenerated &lt;code&gt;bitcoin.conf&lt;/code&gt; located at &lt;code&gt;/Users/user/Library/Application Support/Bitcoin/bitcoin.conf&lt;/code&gt; with a text editor&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nvim /Users/user/Library/Application Support/Bitcoin/bitcoin.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Daemon Options&lt;/span&gt;
&lt;span class="nv"&gt;server&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="nv"&gt;daemon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="nv"&gt;fallbackfee&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0.00072
&lt;span class="nv"&gt;txindex&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="nv"&gt;mintxfee&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0.0001
&lt;span class="nv"&gt;txconfirmtarget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;6

&lt;span class="c"&gt;# Network Options&lt;/span&gt;
&lt;span class="nv"&gt;regtest&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;span class="c"&gt;#signet=1&lt;/span&gt;
&lt;span class="c"&gt;#testnet=1&lt;/span&gt;

&lt;span class="o"&gt;[&lt;/span&gt;regtest]
&lt;span class="c"&gt;# RPC Options&lt;/span&gt;
&lt;span class="nv"&gt;rpcport&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;18443
&lt;span class="nv"&gt;rpcuser&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;bitcoin
&lt;span class="nv"&gt;rpcpassword&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;bitcoin

&lt;span class="c"&gt;# ZMQ Options&lt;/span&gt;
&lt;span class="nv"&gt;zmqpubrawblock&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tcp://127.0.0.1:28332
&lt;span class="nv"&gt;zmqpubrawtx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tcp://127.0.0.1:28333
&lt;span class="nv"&gt;zmqpubhashtx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tcp://127.0.0.1:28332
&lt;span class="nv"&gt;zmqpubhashblock&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;tcp://127.0.0.1:28332
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's follow through the following steps&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Spin up a Bitcoin network (regtest network)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bitcoind
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Bitcoin Core starting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Ensure we are on the regtest network
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bitcoin-cli  getblockchaininfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"chain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"regtest"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;just&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;making&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;sure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;we&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;are&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;'regtest'&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;network&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"blocks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;526&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;526&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Prepare the first lightning node aka &lt;code&gt;lnd1&lt;/code&gt; for some action
&lt;/h3&gt;

&lt;p&gt;We'll be preparing our first lightning node now so go ahead and open up two new shell tabs or terminal windows and follow the following steps to spin up both of our previously configured lightning nodes respectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First Tab:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's go ahead and start up our first node&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lnd1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;2024-02-14 02:38:18.958 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: Version: 0.17.0-beta &lt;span class="nv"&gt;commit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fn/v1.0.1-85-ge31d15989, &lt;span class="nv"&gt;build&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;production, &lt;span class="nv"&gt;logging&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;default, &lt;span class="nv"&gt;debuglevel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info
2024-02-14 02:38:18.958 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: Active chain: Bitcoin &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;network&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;regtest&lt;span class="o"&gt;)&lt;/span&gt;
2024-02-14 02:38:18.958 &lt;span class="o"&gt;[&lt;/span&gt;INF] RPCS: Generating TLS certificates...
2024-02-14 02:38:18.960 &lt;span class="o"&gt;[&lt;/span&gt;INF] RPCS: Done generating TLS certificates
2024-02-14 02:38:18.961 &lt;span class="o"&gt;[&lt;/span&gt;INF] RPCS: RPC server listening on 127.0.0.1:10009
2024-02-14 02:38:18.963 &lt;span class="o"&gt;[&lt;/span&gt;INF] RPCS: gRPC proxy started at 127.0.0.1:8080
2024-02-14 02:38:18.963 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: Opening the main database, this might take a few minutes...
2024-02-14 02:38:18.963 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: Opening bbolt database, &lt;span class="nv"&gt;sync_freelist&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;, &lt;span class="nv"&gt;auto_compact&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false
&lt;/span&gt;2024-02-14 02:38:19.003 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: Creating &lt;span class="nb"&gt;local &lt;/span&gt;graph and channel state DB instances
2024-02-14 02:38:19.069 &lt;span class="o"&gt;[&lt;/span&gt;INF] CHDB: Checking &lt;span class="k"&gt;for &lt;/span&gt;schema update: &lt;span class="nv"&gt;latest_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;31, &lt;span class="nv"&gt;db_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;31
2024-02-14 02:38:19.069 &lt;span class="o"&gt;[&lt;/span&gt;INF] CHDB: Checking &lt;span class="k"&gt;for &lt;/span&gt;optional update: &lt;span class="nv"&gt;prune_revocation_log&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;false&lt;/span&gt;, &lt;span class="nv"&gt;db_version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;empty
2024-02-14 02:38:19.069 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: Database&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt; now open &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;time_to_open&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;106.471482ms&lt;span class="o"&gt;)!&lt;/span&gt;
2024-02-14 02:38:19.069 &lt;span class="o"&gt;[&lt;/span&gt;INF] LTND: We&lt;span class="s1"&gt;'re not running within systemd or the service type is not '&lt;/span&gt;notify&lt;span class="s1"&gt;'
2024-02-14 02:38:19.069 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli changepassword` to change the password of an existing wallet and unlock it.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Second Tab:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now let's create a wallet, run the command below and follow through the wallet creation prompts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; lncli1 create

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Input wallet password:
Confirm password:

Do you have an existing cipher seed mnemonic or extended master root key you want to use?
Enter &lt;span class="s1"&gt;'y'&lt;/span&gt; to use an existing cipher seed mnemonic, &lt;span class="s1"&gt;'x'&lt;/span&gt; to use an extended master root key
or &lt;span class="s1"&gt;'n'&lt;/span&gt; to create a new seed &lt;span class="o"&gt;(&lt;/span&gt;Enter y/x/n&lt;span class="o"&gt;)&lt;/span&gt;: n

Your cipher seed can optionally be encrypted.
Input your passphrase &lt;span class="k"&gt;if &lt;/span&gt;you wish to encrypt it &lt;span class="o"&gt;(&lt;/span&gt;or press enter to proceed without a cipher seed passphrase&lt;span class="o"&gt;)&lt;/span&gt;:

Generating fresh cipher seed...

&lt;span class="o"&gt;!!!&lt;/span&gt;YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

&lt;span class="nt"&gt;---------------BEGIN&lt;/span&gt; LND CIPHER SEED---------------
 1. absorb     2. mammal    3. thank    4. isolate
 5. depart     6. trigger   7. legal    8. unhappy
 9. purchase  10. strong   11. effort  12. kangaroo
13. entry     14. solve    15. flower  16. mule
17. buyer     18. today    19. cancel  20. material
21. pupil     22. napkin   23. employ  24. ill
&lt;span class="nt"&gt;---------------END&lt;/span&gt; LND CIPHER SEED-----------------

&lt;span class="o"&gt;!!!&lt;/span&gt;YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!!!

lnd successfully initialized!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's go ahead and fetch some basic information about our node. Run the command below&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lncli1 getinfo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"0.17.0-beta commit=fn/v1.0.1-85-ge31d15989"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"commit_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"e31d1598932a814c2d44b774e5110746295df711"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"identity_pubkey"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"02e0810d836946eebaeb9186c45ebb0c2d17294890ec67f488c9127de4d51dd3cd"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"alias"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"02e0810d836946eebaeb"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"#3399ff"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"num_pending_channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"num_active_channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"num_inactive_channels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"num_peers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;take&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;note&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;this&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;(our&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;node&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;bit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;lonely&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;now)&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"block_height"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="mi"&gt;547&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"block_hash"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"10f9fb091fd2b83736ffde6621100d6db40b09fad3676c7930dce1821c31066a"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"best_header_timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"1707215728"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"synced_to_chain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"synced_to_graph"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"testnet"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"chains"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"chain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"bitcoin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"network"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="s2"&gt;"regtest"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="err"&gt;....&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Time to create an address that would receive the bitcoin sent to the lightning node wallet&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lncli1 newaddress np2wkh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2N5qZ8TNWbrkaYxmsLYjEd8g6U7CrjDfHky"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's load up our Bitcoin wallet from the previous tutorial, send some juicy &lt;code&gt;100&lt;/code&gt; Bitcoin from it to our lightning address above and then generate some blocks to give it some confirmations&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxgjznxfjyaw0vi1um6v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxgjznxfjyaw0vi1um6v.gif" alt="dancing" width="480" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"my oh my!!, what a man could do with some real &lt;code&gt;100&lt;/code&gt; btc just sitting in a wallet 🤤. Alight alright that's enough buddy, don't be weird let's get back to the article."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Run the commands below in sequence&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command 1:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bitcoin-cli loadwallet my_first_regtest_wallet
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"my_first_regtest_wallet"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;command 2:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bitcoin-cli sendtoaddress 2N5qZ8TNWbrkaYxmsLYjEd8g6U7CrjDfHky 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;3d36c8fc08f3ffd82bfa4e2aa33a63bf6c254bb46ffa1309fb9c7eb99adb3848
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;command 3:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bitcoin-cli generatetoaddress 10 &lt;span class="s2"&gt;"mhF5zQHNn7wzaaQTpzRmtsNgPgFF94fxeY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"2fb9db66a292f9f37260be1490833d7cb4b1d5442478be67fd3d7c48281271c5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"7f284d403862117a21461da7cfdc3437a870fd608d0afe5e672c5c378ea2bc73"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="s2"&gt;"4b4e867a02e49145f71b662fa4fea2a30eeff0d9a689953b655222ef2e336bd4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's go ahead and check our &lt;code&gt;lnd1&lt;/code&gt; wallet balance&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lncli1 walletbalance
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"total_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"10000000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//👈🏿&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;sweet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;our&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;wallet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;was&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;credited&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;successfully&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"confirmed_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"10000000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"unconfirmed_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"locked_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"reserved_balance_anchor_chan"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"account_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"default"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"confirmed_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"10000000000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"unconfirmed_balance"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📜 Prepare the second lightning node aka &lt;code&gt;lnd2&lt;/code&gt; for some action
&lt;/h3&gt;

&lt;p&gt;To get the second lnd node configured and running, repeat all the steps we followed above but this time around, funding the &lt;code&gt;lnd2&lt;/code&gt; wallet with some bitcoin is optional as this node would be on the receiving end of our transaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Conclusion
&lt;/h3&gt;

&lt;p&gt;We'll conclude here. Thank you for staying with us until the end of the second part. In the final part, we'll walk through connecting peers, opening payment channels, and other processes necessary for a valid lightning transaction.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Useful links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hashnode.com/post/clsctrvcp00000ale7n0pfur8" rel="noopener noreferrer"&gt;part 1 of the series&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>bitcoin</category>
      <category>lightning</category>
    </item>
    <item>
      <title>Bitcoin - A dummy's technical guide to the bitcoin ecosystem part 1</title>
      <dc:creator>Abba Adamu</dc:creator>
      <pubDate>Tue, 26 Mar 2024 10:31:31 +0000</pubDate>
      <link>https://dev.to/shytypes1028/bitcoin-a-dummys-technical-guide-to-the-bitcoin-ecosystem-part-1-oje</link>
      <guid>https://dev.to/shytypes1028/bitcoin-a-dummys-technical-guide-to-the-bitcoin-ecosystem-part-1-oje</guid>
      <description>&lt;h3&gt;
  
  
  📜Objective
&lt;/h3&gt;

&lt;p&gt;The goal of this article is to help you&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get a rough view of what a cryptocurrency is.&lt;/li&gt;
&lt;li&gt;Gain some foundational understanding of What Bitcoin is

&lt;ul&gt;
&lt;li&gt;make sense of the name &lt;code&gt;Satoshi Nakomoto&lt;/code&gt; (unfortunately the name of an anime protagonist)&lt;/li&gt;
&lt;li&gt;understand some Bitcoin terminologies&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;understand the difference between Bitcoin and bitcoin&lt;/li&gt;

&lt;li&gt;understand Bitcoin wallets&lt;/li&gt;

&lt;li&gt;understand Bitcoin addresses

&lt;ul&gt;
&lt;li&gt;Hashing&lt;/li&gt;
&lt;li&gt;Legacy (P2PKH)&lt;/li&gt;
&lt;li&gt;Nested SigWit (P2SH)&lt;/li&gt;
&lt;li&gt;Native SegWit (Bech32)&lt;/li&gt;
&lt;li&gt;Taproot (P2TR)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Introduction
&lt;/h3&gt;

&lt;p&gt;I know you must have heard a lot about Bitcoin and how it has made a lot of people filthy rich over the years.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdjps9nu1gtk5z9kt1y4j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdjps9nu1gtk5z9kt1y4j.gif" alt="filthy rich" width="480" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But beyond all the hype, do you understand the technology and infrastructure Bitcoin is layered upon? My job in this series is not to overload you with too many technicalities but to give you enough dumb down knowledge to help lean your curiosity in the right direction.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 What is a cryptocurrency
&lt;/h3&gt;

&lt;p&gt;The word &lt;code&gt;cryptocurrency&lt;/code&gt; can be broken down into two parts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;crypto&lt;/code&gt;: a short form for the word &lt;code&gt;cryptography&lt;/code&gt; which is a mathematical domain of knowledge that deals with the encryption and decryption of data. remember how Batman uses his &lt;code&gt;wrist computer thingy&lt;/code&gt; to decipher passwords for locked doors? now that process is data decryption which is a vital fragment of cryptography.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 What is &lt;code&gt;bitcoin (BTC))&lt;/code&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick note: Bitcoin was released in 2009 by some anonymous nerd or group of nerds under the name Satoshi Nakamoto.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9o3rof4mq8tr7smcnbf8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9o3rof4mq8tr7smcnbf8.gif" alt="interesting" width="480" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Who is Satoshi Nakamoto?&lt;/p&gt;

&lt;p&gt;After asking Google the same question I got this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Satoshi Nakamoto is the name used by the presumed pseudonymous person or persons who developed Bitcoin, authored the bitcoin white paper, and created and deployed bitcoin's original reference implementation."&lt;/em&gt;&lt;a href="https://en.wikipedia.org/wiki/Satoshi_Nakamoto" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I believe the developer or developers of bitcoin maintained anonymity for a good cause, seeing as the Bitcoin infrastructure promotes heavy anonymity by obfuscating various data on the network via encryption it maybe wouldn't have made sense to have attached a face to the invention. But don't take my word for it, I'm also a dummy trying to understand Bitcoin.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 A definition of sorts
&lt;/h3&gt;

&lt;p&gt;bitcoin (BTC) is a cryptocurrency, a virtual currency designed to act as money and a form of payment outside the control of a centralized system say your typical bank, so there's no need for third-party involvement in transactions. bitcoin (BTC) is also rewarded to &lt;code&gt;blockchain miners&lt;/code&gt; for &lt;code&gt;verifying transactions&lt;/code&gt; and can be purchased in specialized markets called exchanges.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 What is a cryptocurrency exchange?
&lt;/h3&gt;

&lt;p&gt;Well, it's a market that provides a platform for customers to swap one cryptocurrency into another and to also buy cryptocurrencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 The difference between &lt;code&gt;Bitcoin&lt;/code&gt; and &lt;code&gt;bitcoin&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Owing to my explanation above, &lt;code&gt;bitcoin (BTC)&lt;/code&gt; is simply the currency or &lt;code&gt;native token&lt;/code&gt; used in transactions on a cool type of network that connects computers/nodes to form peers called a &lt;code&gt;peer-to-peer network&lt;/code&gt;. What makes this type of network cool is that all participating nodes have the liberty to verify transactions and add them into a &lt;code&gt;book of records&lt;/code&gt; or you can call it a &lt;code&gt;ledger&lt;/code&gt; as part of a collection of other transactions called a &lt;code&gt;block&lt;/code&gt; which is then append it to the end of another &lt;code&gt;Block&lt;/code&gt; to form &lt;code&gt;a chain of blocks&lt;/code&gt;. hence the name &lt;code&gt;blockchain&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick Note: for clarity, &lt;code&gt;Transactions&lt;/code&gt; are grouped into &lt;code&gt;Blocks&lt;/code&gt; which are then appended to the previous block to form a &lt;code&gt;Blockchain&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;code&gt;node&lt;/code&gt; is any computer on the Bitcoin network which by default has the exact copy of the entire blockchain data&lt;/li&gt;
&lt;li&gt;A &lt;code&gt;block&lt;/code&gt; is a record made up of a collection of transactions and meta-data grouped together as a single entity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.researchgate.net%2Fprofile%2FKhaled-Salah-8%2Fpublication%2F321017113%2Ffigure%2Ffig2%2FAS%3A614287290679309%401523468911795%2FBlockchain-design-structure-showing-chained-blocks-with-header-and-body-fields.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.researchgate.net%2Fprofile%2FKhaled-Salah-8%2Fpublication%2F321017113%2Ffigure%2Ffig2%2FAS%3A614287290679309%401523468911795%2FBlockchain-design-structure-showing-chained-blocks-with-header-and-body-fields.png" alt="block image" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A compendium of all these concepts and technologies that facilitate the execution of activities on the &lt;code&gt;blockchain&lt;/code&gt; can be referred to as &lt;code&gt;Bitcoin&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick note: Going forward, i will be referring to the bitcoin cryptocurrency as BTC for ease of identification and understanding and it's shorter to write.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  📜 Bitcoin Wallets
&lt;/h3&gt;

&lt;p&gt;Just like with conventional wallets, A Bitcoin wallet stores BTC you have &lt;code&gt;ownership&lt;/code&gt; of. It is a single source of truth for determining your BTC balance and spending from the balance and also adding to the balance via a special set of alphanumeric characters called an &lt;code&gt;Address&lt;/code&gt;. Lastly, a bitcoin wallet can either be a physical device like a USB drive, SSD, or HDD, or it can also be a computer program.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Bitcoin Addresses
&lt;/h3&gt;

&lt;p&gt;Let's quickly talk about &lt;code&gt;hashing&lt;/code&gt;. Hashing is a cryptographic process of passing a set of data through a secure hash algorithm to produce an encrypted value called a &lt;code&gt;Digest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6qm1d5cs7lqa8osfx49.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj6qm1d5cs7lqa8osfx49.PNG" alt="Hashing" width="800" height="353"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;source: simplilearn&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On a more technical level, a Bitcoin wallet is a database file that contains a set of digital keys mathematically related to each other. they are key pairs that serve as&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A public id that serves as what you would call a bank account number in the centralized space. it is called a &lt;code&gt;Public key&lt;/code&gt; and is used to receive and send BTC on the network&lt;/li&gt;
&lt;li&gt;A private ID (&lt;code&gt;Private Key&lt;/code&gt;) which is more or less a &lt;code&gt;PIN&lt;/code&gt;. It is a secret set of alphanumeric characters that is used to generate &lt;code&gt;digital signatures&lt;/code&gt; for the sake of transaction validation.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick Note: the public/private key value pairs are generated through a cryptographic algorithm called an &lt;code&gt;Elliptic curve cryptographic function&lt;/code&gt;. if you care to read more about it and lose a little bit of your sanity then check out &lt;a href="https://learn.saylor.org/mod/book/view.php?id=36353#:~:text=to%20generate%20addresses.-,Elliptic%20Curve%20Cryptography%20Explained,-Elliptic%20curve%20cryptography" rel="noopener noreferrer"&gt;Elliptic Curve Cryptography Explained&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bitcoin Addresses are generated from a public key via a &lt;code&gt;one-way cryptographic hashing algorithm&lt;/code&gt; and are about 26 to 35 characters long.&lt;/p&gt;

&lt;p&gt;The algorithms mentioned above leverages on &lt;code&gt;double-hashing&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Secure Hash Algorithm (SHA256)&lt;/li&gt;
&lt;li&gt;RACE Integrity Primitives Evaluation Message Digest (RIPEMD160)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the final &lt;code&gt;digest&lt;/code&gt; is passed through Base58Check encoding to improve the human readability of the final address&lt;/p&gt;

&lt;p&gt;Mathematically:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;// one-way cryptographic hashing algorithm

Digest = SHA256(PublicKey)
DigestTwo = RIPEMD160(Digest)
finalAddress = Base58Check(DigestTwo) //encoding
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have gone over how to create a Bitcoin address, below is are the different types of Bitcoin address:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Legacy (P2PKH)&lt;/li&gt;
&lt;li&gt;Nested SigWit (P2SH)&lt;/li&gt;
&lt;li&gt;Native SegWit (Bech32)&lt;/li&gt;
&lt;li&gt;Taproot (P2TR)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 Conclusion
&lt;/h3&gt;

&lt;p&gt;This is the end of the first part of the series, I hope you were able to gain some surface-level understanding of Bitcoin at least. In the next part, we'll dive deep into the different types of Bitcoin addresses mentioned above. Thank you.&lt;/p&gt;

&lt;h3&gt;
  
  
  📜 Useful links
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/bitcoinbook/bitcoinbook" rel="noopener noreferrer"&gt;Bitcoinbook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/pulse/demystifying-bitcoin-address-types-legacy-segwit-native-soren-azorian/" rel="noopener noreferrer"&gt;Soren Azorian | Demystifying Bitcoin Address Types: Legacy, SegWit, Native SegWit, and Taproot&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>bitcoin</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
