{"id":1789,"date":"2020-03-02T13:49:24","date_gmt":"2020-03-02T21:49:24","guid":{"rendered":"https:\/\/www.opennode.com\/blog\/?page_id=1789"},"modified":"2020-03-02T13:49:25","modified_gmt":"2020-03-02T21:49:25","slug":"closing-transaction","status":"publish","type":"page","link":"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/","title":{"rendered":"Closing Transaction"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute<\/span><\/span>\n<h1 class=\"wp-block-heading\">Closing Transaction<\/h1>\n\n\n\n<p>The closing transaction is how two parties end a payment channel. This transaction spends the funding output and splits funds within the channel based on the final channel state which is agreed on by both parties in the channel. The closing transaction is one of two <a href=\"https:\/\/www.opennode.com\/blog\/glossary\/lightning-network\/\">Lightning Network<\/a> transactions that occur on the <a href=\"https:\/\/www.opennode.com\/blog\/glossary\/bitcoin\/\">Bitcoin<\/a> <a href=\"https:\/\/www.opennode.com\/blog\/glossary\/blockchain\/\">blockchain<\/a>; the other being the funding transaction.<\/p>\n\n\n\n<p>In other words, the closing transaction essentially overrides everything that has happened within the channel and allocates the funds each party is owed as one transaction less any fees, dust, and sub-satoshis. If Bob and Alice transact 100 times over the channel, they will only show up as one transaction on the Bitcoin blockchain, with the value equal to the final channel state.<\/p>\n\n\n\n<p>The incentives for closing channels are mutually beneficial. Let\u2019s say Bob and Alice have a channel where Bob is owed 3 Bitcoin and Alice 7. If either Bob or Alice requests to close the channel, the other will likely agree because it just means that they will get their funds. There is no reason not to &#8211; it\u2019s not like anyone is getting the short end of the stick!<\/p>\n\n\n\n<p>Each node signing a closing transaction:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>MUST round each output down to a whole satoshi<\/li><li>MUST subtract the fees from the output to the funder<\/li><li>MUST remove any output below its own dust limit<\/li><li>MAY eliminate itself as an output.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Links<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><em>Understanding The Lightning Network, Part 3: Completing The Puzzle And Closing The Channel <\/em>&#8211; <a href=\"https:\/\/bitcoinmagazine.com\/articles\/understanding-the-lightning-network-part-completing-the-puzzle-and-closing-the-channel-1466178980\">Bitcoin Magazine<\/a><\/li><li><em>BOLT #3: Bitcoin Transaction and Script Formats<\/em> &#8211; <a href=\"https:\/\/github.com\/lightningnetwork\/lightning-rfc\/blob\/master\/03-transactions.md#funding-transaction-output\">Github<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute<\/span><\/span>Closing Transaction The closing transaction is how two parties end a payment channel. This transaction spends the funding output and splits funds within the channel based on the final channel state which is agreed on by both parties in the channel. The closing transaction is one of two Lightning Network transactions that occur on the  &#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":172,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-notitle.php","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1789","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Closing Transaction - OpenNode Blog<\/title>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Closing Transaction - OpenNode Blog\" \/>\n<meta property=\"og:description\" content=\"Reading Time:  &lt; 1 minuteClosing Transaction The closing transaction is how two parties end a payment channel. This transaction spends the funding output and splits funds within the channel based on the final channel state which is agreed on by both parties in the channel. The closing transaction is one of two Lightning Network transactions that occur on the ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenNode Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/OpenNodeco\/\" \/>\n<meta property=\"article:modified_time\" content=\"2020-03-02T21:49:25+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@opennode\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/glossary\\\/closing-transaction\\\/\",\"url\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/glossary\\\/closing-transaction\\\/\",\"name\":\"Closing Transaction - OpenNode Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#website\"},\"datePublished\":\"2020-03-02T21:49:24+00:00\",\"dateModified\":\"2020-03-02T21:49:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/glossary\\\/closing-transaction\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/glossary\\\/closing-transaction\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/glossary\\\/closing-transaction\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Main\",\"item\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bitcoin Glossary\",\"item\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/glossary\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Closing Transaction\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/\",\"name\":\"OpenNode Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#organization\",\"name\":\"OpenNode\",\"url\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.opennode.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Logomark-1.png\",\"contentUrl\":\"https:\\\/\\\/www.opennode.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/04\\\/Logomark-1.png\",\"width\":1920,\"height\":1920,\"caption\":\"OpenNode\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/OpenNodeco\\\/\",\"https:\\\/\\\/x.com\\\/opennode\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Closing Transaction - OpenNode Blog","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"Closing Transaction - OpenNode Blog","og_description":"Reading Time:  &lt; 1 minuteClosing Transaction The closing transaction is how two parties end a payment channel. This transaction spends the funding output and splits funds within the channel based on the final channel state which is agreed on by both parties in the channel. The closing transaction is one of two Lightning Network transactions that occur on the ...","og_url":"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/","og_site_name":"OpenNode Blog","article_publisher":"https:\/\/www.facebook.com\/OpenNodeco\/","article_modified_time":"2020-03-02T21:49:25+00:00","twitter_card":"summary_large_image","twitter_site":"@opennode","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/","url":"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/","name":"Closing Transaction - OpenNode Blog","isPartOf":{"@id":"https:\/\/blog.opennode.com\/blog\/#website"},"datePublished":"2020-03-02T21:49:24+00:00","dateModified":"2020-03-02T21:49:25+00:00","breadcrumb":{"@id":"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.opennode.com\/blog\/glossary\/closing-transaction\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Main","item":"https:\/\/blog.opennode.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Bitcoin Glossary","item":"https:\/\/blog.opennode.com\/blog\/glossary\/"},{"@type":"ListItem","position":3,"name":"Closing Transaction"}]},{"@type":"WebSite","@id":"https:\/\/blog.opennode.com\/blog\/#website","url":"https:\/\/blog.opennode.com\/blog\/","name":"OpenNode Blog","description":"","publisher":{"@id":"https:\/\/blog.opennode.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.opennode.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/blog.opennode.com\/blog\/#organization","name":"OpenNode","url":"https:\/\/blog.opennode.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.opennode.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.opennode.com\/blog\/wp-content\/uploads\/2019\/04\/Logomark-1.png","contentUrl":"https:\/\/www.opennode.com\/blog\/wp-content\/uploads\/2019\/04\/Logomark-1.png","width":1920,"height":1920,"caption":"OpenNode"},"image":{"@id":"https:\/\/blog.opennode.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/OpenNodeco\/","https:\/\/x.com\/opennode"]}]}},"_links":{"self":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/pages\/1789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/comments?post=1789"}],"version-history":[{"count":1,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/pages\/1789\/revisions"}],"predecessor-version":[{"id":1790,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/pages\/1789\/revisions\/1790"}],"up":[{"embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/pages\/172"}],"wp:attachment":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/media?parent=1789"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/categories?post=1789"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/tags?post=1789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}