{"id":8008,"date":"2022-09-26T18:43:49","date_gmt":"2022-09-26T18:43:49","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=8008"},"modified":"2022-09-26T18:43:49","modified_gmt":"2022-09-26T18:43:49","slug":"lightning-network-channels-and-invoices","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/09\/26\/lightning-network-channels-and-invoices\/","title":{"rendered":"Lightning Network: Channels and Invoices"},"content":{"rendered":"\n<p>The Lightning Network is an example of Layer 2 bitcoin service. It is an off-chain approach first formally proposed in a paper by Joseph Poon and Thaddeus Dryja in 2015.<\/p>\n\n\n\n<p>The technology uses&nbsp;<strong>micropayment channels<\/strong>&nbsp;to scale the bitcoin blockchain\u2019s capability by processing transactions more efficiently.&nbsp;<\/p>\n\n\n\n<p>Micropayment channels are opened between two parties looking to conduct a transaction. This channel is opened off-chain and without the overhead of the consensus mechanism, can process transactions much more efficiently than those that occur on-chain.<\/p>\n\n\n\n<p>Transactions are added to the chain once both parties have closed the channel, i.e. agreed to the transaction&#8217;s validity.&nbsp;<\/p>\n\n\n\n<p>Think of it like having credit at your local convenience store, agreed up to a fixed point, say \u20ac50. Once that limit is reached, you get an invoice and settle up.<\/p>\n\n\n\n<p>On the Lightning Network, payment channels are opened between two parties through&nbsp;<em><strong>multi-signature addresses<\/strong><\/em>. These act as mutual vaults that both parties can deposit funds into; multi-signature means that more than one signature is needed to release funds, a fail-safe ensuring one side cannot walk away with the funds within the channel.<\/p>\n\n\n\n<p>When funds are deposited, a channel is opened, creating a balance sheet between the two parties; this is then added to the main chain.&nbsp;<\/p>\n\n\n\n<p>Transactions between the two parties are recorded by updating this balance sheet to include the new balance between the two parties. These updates come in the form of<strong><em>&nbsp;Invoices<\/em><\/strong>.&nbsp;<\/p>\n\n\n\n<p>An invoice is a request for payment via the Lightning Network. Just like a traditional Invoice, say from your builder, includes instructions of where to remit the payment for services rendered, a Lightning Invoice is a structured set of instructions.<\/p>\n\n\n\n<ul><li>The payment amount<\/li><li>Which blockchain the invoice applies to&nbsp;<\/li><li>An expiry date<\/li><li>Payee pubkey<\/li><\/ul>\n\n\n\n<p>Rather than using Bitcoin-style addresses Lightning Invoices are generally generated as QR codes, to ease the user experience, though they can be presented as alphanumeric strings.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Lightning Network is an example of Layer 2 bitcoin service. It is an off-chain approach first formally proposed in a paper by Joseph Poon and Thaddeus Dryja in 2015. The technology uses&nbsp;micropayment channels&nbsp;to scale the bitcoin blockchain\u2019s capability by processing transactions more efficiently.&nbsp; Micropayment channels are opened between two parties looking to conduct a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[545],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/8008"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=8008"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/8008\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=8008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=8008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=8008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}