{"id":2435,"date":"2020-10-22T09:40:23","date_gmt":"2020-10-22T16:40:23","guid":{"rendered":"https:\/\/www.opennode.com\/blog\/?p=2435"},"modified":"2022-08-09T09:27:44","modified_gmt":"2022-08-09T16:27:44","slug":"lightning-network-app","status":"publish","type":"post","link":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/","title":{"rendered":"Building a Lightning Network app with the OpenNode API"},"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\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p>Like physical infrastructure, digital infrastructure requires solid foundations and the right tools. At OpenNode, we believe that our API is the perfect tool for building an optimized payment solution supported by our trusted, reliable platform. With 10 lines of code, our <a href=\"https:\/\/www.opennode.com\/blog\/glossary\/API\/\">API<\/a> can be integrated by any business or app to power <a href=\"https:\/\/www.opennode.com\/blog\/glossary\/bitcoin\/\">Bitcoin<\/a> payments and payouts for any number of use cases.&nbsp;<\/p>\n\n\n\n<p>In this guide, we will walk through the creation of a simple application powered by our <a href=\"https:\/\/www.opennode.com\/blog\/glossary\/lightning-network\/\">Lightning Network<\/a> Bitcoin API. By the end of this guide, you will be able to create a public message board where every message published is paid for using Bitcoin over the Lightning Network. Check out what we will end up with: <a href=\"https:\/\/opennode-workshop-final--ruigomes.repl.co\/\">Demo Message Board<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Working on Bitcoin&#8217;s Testnet<\/strong><\/h2>\n\n\n\n<p>Testing development changes using real money is risky and unnecessary. We strongly encourage you to use the Lightning Network test-net. To easily pay for test-net Lightning invoices, check out the <a href=\"https:\/\/htlc.me\/\">HTLC.me wallet<\/a>.<\/p>\n\n\n\n<p>The first step is to create an account on OpenNode Dev &#8211; <a href=\"https:\/\/dev.opennode.co\/\">https:\/\/dev.opennode.co<\/a>. If you can see the &#8220;Dev Environment&#8221; tag next to the OpenNode logo you&#8217;re in the right place!<\/p>\n\n\n\n<p>Note:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>API keys generated on a regular OpenNode account will <em>not<\/em> work on the test-net.<\/li><li>To run this app on mainnet instead, create a regular OpenNode account at <a href=\"https:\/\/opennode.co\/signup\">https:\/\/opennode.co\/signup<\/a> and change the API base URL from https:\/\/dev-api.opennode.co to <a href=\"https:\/\/api.opennode.com\">https:\/\/api.opennode.com<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Creating invoices <\/strong>\u26a1\ufe0f<\/h2>\n\n\n\n<p>Creating an invoice is Lightning Network lingo for \u201ccreating a charge\u201d or \u201ccreating a payment request\u201d. First things first, you will need an OpenNode API key. You can get yours at <a href=\"https:\/\/dev.opennode.co\/settings\/api\">https:\/\/dev.opennode.co\/settings\/api<\/a>. Click on &#8220;Add key&#8221; and select the &#8220;Invoices&#8221; permission-type.<\/p>\n\n\n\n<p>Copy the generated key. Now create a new variable on your index.js file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const opennodeKey = 'YOUR_API_KEY';<\/pre>\n\n\n\n<p>You can start creating Lightning invoices using the OpenNode API now. We want every message in our message board to be paid for using Lightning. To achieve this, we need to edit the app.post(&#8216;\/messages&#8217;) endpoint. Remove the temporary res.redirect(&#8216;\/&#8217;); and add the following snippet to create a charge:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">axios.post('https:\/\/dev-api.opennode.co\/v1\/charges', {\n    amount: 1,\n    description: 'New message',\n    order_id: id,\n  }, { headers: { Authorization: opennodeKey } })\n    .then(response =&gt; {\n      res.render('payment.ejs', { payreq: response.data.data.lightning_invoice.payreq });\n    })\n    .catch(error =&gt; console.log(error.response.data));<\/pre>\n\n\n\n<p>This will call the OpenNode API and request a new invoice for 1 satoshi. It will also pass in the created message ID to the order_id field, which we will use to mark the message as paid in a later stage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Checking for payments <\/strong>\ud83d\udcb5<\/h2>\n\n\n\n<p>We are programmatically creating Lightning invoices and displaying them to our users. Our users can pay invoices using any Lightning wallet. We now need to check if the payment was made and mark the message as paid in our database. OpenNode&#8217;s API can send you Webhooks that inform your server of any updates in any of your invoices. Let&#8217;s use that to check for payments!<\/p>\n\n\n\n<p>Our Repl.it instance is open to the internet, which means that the OpenNode API can reach it. Lets create a variable that holds our public Repl URL:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const replUrl = 'https:\/\/opennode-workshop--ruigomes.repl.co';<\/pre>\n\n\n\n<p>Remember to replace the actual URL with your own \ud83d\ude42<\/p>\n\n\n\n<p>Now we need to tell OpenNode where to send the webhooks. To do so, let&#8217;s edit the <strong>axios.post()<\/strong> sent data, and right below <strong>order_id: id,<\/strong> add the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">callback_url: replUrl + '\/webhook'<\/pre>\n\n\n\n<p>OpenNode will call the callback_url field with any updates that happen with this invoice! We just need to make sure we are listening to these webhooks. To do so, add the following snippet to the index.js file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">app.post('\/webhook', (req, res) =&gt; {\n  console.log('OpenNode Webhook', req.body);\n\n  const status = req.body.status;\n\n  if(status !== 'paid') {\n    return res.send('Order not paid');\n  }\n\n  db.markMessageAsPaid(req.body.order_id);\n\n  return res.send('Order paid');\n});<\/pre>\n\n\n\n<p>When OpenNode sends a webhook to this endpoint, we will get the status of that webhook and make sure it is set to <strong>paid.<\/strong><\/p>\n\n\n\n<p>If it is, we will then fetch the order_id which we previously set to our internal message ID and mark that message as paid.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Validating callbacks <\/strong>\ud83d\udd75\ufe0f\u200d\u2642\ufe0f<\/h2>\n\n\n\n<p>Your app is now handling Lightning invoices, but how can you be sure that it was OpenNode sending you the webhook, and not a malicious third-party?<\/p>\n\n\n\n<p>Inside every webhook, OpenNode sends you a <strong>hashed_order<\/strong> field that is hashed using your API key. If you recreate this hashed_order field in your own application and verify that they match, you can be sure that OpenNode sent this webhook!<\/p>\n\n\n\n<p>Within the <strong>axios.post(&#8216;webhook&#8217;)<\/strong> method, replace:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const status = req.body.status;\n\nconst { id, order_id, hashed_order, status } = req.body;<\/pre>\n\n\n\n<p>Immediately after that line, add the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const ourHashedOrder = crypto\n    .createHmac('sha256', opennodeKey)\n    .update(id)\n    .digest('hex');\n\n  if(hashed_order !== ourHashedOrder) {\n    return res.send('Fake callback');\n  }<\/pre>\n\n\n\n<p>We are recreating the hashed_order by hashing the OpenNode invoice ID with our API key, and then we make sure they match. If they don&#8217;t, we return immediately, not marking the order as paid!<\/p>\n\n\n\n<p>And there you have it, you just created a simple app powered by Lightning Network Bitcoin payments! Now that you know how to power an application with our API we encourage you to keep building. Bitcoin is a new technology and the Lightning Network is even newer. The possibilities for new applications are uncharted limitless.&nbsp;<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>With OpenNode guides, our goal is to complement developer tools with education and resources for businesses. We\u2019re always looking for new and valuable ways to expand these resources and we\u2019re open to your suggestions.&nbsp;<\/p>\n\n\n\n<p>Are there guides or resources that you would like to see added to OpenNode guides? Send us an email at <a href=\"mailto:hello@opennode.com\">hello@opennode.com<\/a> or send us a direct message on Twitter and we\u2019re happy to hear your ideas!<\/p>\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\"> 4<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>Like physical infrastructure, digital infrastructure requires solid foundations and the right tools. At OpenNode, we believe that our API is the perfect tool for building an optimized payment solution supported by our trusted, reliable platform. With 10 lines of code, our API can be integrated by any business or app to power Bitcoin payments and  &#8230;<\/p>\n","protected":false},"author":5,"featured_media":2441,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[106],"class_list":["post-2435","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guides","tag-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Building a Lightning Network app with the OpenNode API - OpenNode Blog<\/title>\n<meta name=\"description\" content=\"Want to accept Bitcoin payments using the Lightning Network? Learn how to build a Bitcoin powered app in the OpenNode guides.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Lightning Network app with the OpenNode API - OpenNode Blog\" \/>\n<meta property=\"og:description\" content=\"Want to accept Bitcoin payments using the Lightning Network? Learn how to build a Bitcoin powered app in the OpenNode guides.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenNode Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/OpenNodeco\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-22T16:40:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-09T16:27:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.opennode.com\/blog\/wp-content\/uploads\/2020\/10\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Rui Gomes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@opennode\" \/>\n<meta name=\"twitter:site\" content=\"@opennode\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rui Gomes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/\"},\"author\":{\"name\":\"Rui Gomes\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#\\\/schema\\\/person\\\/b8840d73960958e1a5c3c7a77b400d0f\"},\"headline\":\"Building a Lightning Network app with the OpenNode API\",\"datePublished\":\"2020-10-22T16:40:23+00:00\",\"dateModified\":\"2022-08-09T16:27:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/\"},\"wordCount\":884,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg\",\"keywords\":[\"Guides\"],\"articleSection\":[\"Guides\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/\",\"url\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/\",\"name\":\"Building a Lightning Network app with the OpenNode API - OpenNode Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg\",\"datePublished\":\"2020-10-22T16:40:23+00:00\",\"dateModified\":\"2022-08-09T16:27:44+00:00\",\"description\":\"Want to accept Bitcoin payments using the Lightning Network? Learn how to build a Bitcoin powered app in the OpenNode guides.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg\",\"contentUrl\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg\",\"width\":2560,\"height\":1280},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/lightning-network-app\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Main\",\"item\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Lightning Network app with the OpenNode API\"}]},{\"@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\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/#\\\/schema\\\/person\\\/b8840d73960958e1a5c3c7a77b400d0f\",\"name\":\"Rui Gomes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e76f412bfd04b7c1ca03120de61aa5fdf43c11a9091ab2d48aeb48b2cf3358c?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e76f412bfd04b7c1ca03120de61aa5fdf43c11a9091ab2d48aeb48b2cf3358c?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0e76f412bfd04b7c1ca03120de61aa5fdf43c11a9091ab2d48aeb48b2cf3358c?s=96&d=identicon&r=g\",\"caption\":\"Rui Gomes\"},\"url\":\"https:\\\/\\\/blog.opennode.com\\\/blog\\\/author\\\/rui\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building a Lightning Network app with the OpenNode API - OpenNode Blog","description":"Want to accept Bitcoin payments using the Lightning Network? Learn how to build a Bitcoin powered app in the OpenNode guides.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/","og_locale":"en_US","og_type":"article","og_title":"Building a Lightning Network app with the OpenNode API - OpenNode Blog","og_description":"Want to accept Bitcoin payments using the Lightning Network? Learn how to build a Bitcoin powered app in the OpenNode guides.","og_url":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/","og_site_name":"OpenNode Blog","article_publisher":"https:\/\/www.facebook.com\/OpenNodeco\/","article_published_time":"2020-10-22T16:40:23+00:00","article_modified_time":"2022-08-09T16:27:44+00:00","og_image":[{"width":2560,"height":1280,"url":"https:\/\/blog.opennode.com\/blog\/wp-content\/uploads\/2020\/10\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg","type":"image\/jpeg"}],"author":"Rui Gomes","twitter_card":"summary_large_image","twitter_creator":"@opennode","twitter_site":"@opennode","twitter_misc":{"Written by":"Rui Gomes","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#article","isPartOf":{"@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/"},"author":{"name":"Rui Gomes","@id":"https:\/\/blog.opennode.com\/blog\/#\/schema\/person\/b8840d73960958e1a5c3c7a77b400d0f"},"headline":"Building a Lightning Network app with the OpenNode API","datePublished":"2020-10-22T16:40:23+00:00","dateModified":"2022-08-09T16:27:44+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/"},"wordCount":884,"publisher":{"@id":"https:\/\/blog.opennode.com\/blog\/#organization"},"image":{"@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.opennode.com\/blog\/wp-content\/uploads\/2020\/10\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg","keywords":["Guides"],"articleSection":["Guides"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/","url":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/","name":"Building a Lightning Network app with the OpenNode API - OpenNode Blog","isPartOf":{"@id":"https:\/\/blog.opennode.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#primaryimage"},"image":{"@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.opennode.com\/blog\/wp-content\/uploads\/2020\/10\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg","datePublished":"2020-10-22T16:40:23+00:00","dateModified":"2022-08-09T16:27:44+00:00","description":"Want to accept Bitcoin payments using the Lightning Network? Learn how to build a Bitcoin powered app in the OpenNode guides.","breadcrumb":{"@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.opennode.com\/blog\/lightning-network-app\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#primaryimage","url":"https:\/\/blog.opennode.com\/blog\/wp-content\/uploads\/2020\/10\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg","contentUrl":"https:\/\/blog.opennode.com\/blog\/wp-content\/uploads\/2020\/10\/nordwood-themes-bJjsKbToY34-unsplash-scaled-e1613528518703.jpg","width":2560,"height":1280},{"@type":"BreadcrumbList","@id":"https:\/\/blog.opennode.com\/blog\/lightning-network-app\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Main","item":"https:\/\/blog.opennode.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Building a Lightning Network app with the OpenNode API"}]},{"@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"]},{"@type":"Person","@id":"https:\/\/blog.opennode.com\/blog\/#\/schema\/person\/b8840d73960958e1a5c3c7a77b400d0f","name":"Rui Gomes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0e76f412bfd04b7c1ca03120de61aa5fdf43c11a9091ab2d48aeb48b2cf3358c?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0e76f412bfd04b7c1ca03120de61aa5fdf43c11a9091ab2d48aeb48b2cf3358c?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0e76f412bfd04b7c1ca03120de61aa5fdf43c11a9091ab2d48aeb48b2cf3358c?s=96&d=identicon&r=g","caption":"Rui Gomes"},"url":"https:\/\/blog.opennode.com\/blog\/author\/rui\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/posts\/2435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/comments?post=2435"}],"version-history":[{"count":11,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/posts\/2435\/revisions"}],"predecessor-version":[{"id":2449,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/posts\/2435\/revisions\/2449"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/media\/2441"}],"wp:attachment":[{"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/media?parent=2435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/categories?post=2435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.opennode.com\/blog\/wp-json\/wp\/v2\/tags?post=2435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}