<rss
      xmlns:atom="http://www.w3.org/2005/Atom"
      xmlns:media="http://search.yahoo.com/mrss/"
      xmlns:content="http://purl.org/rss/1.0/modules/content/"
      xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      version="2.0"
    >
      <channel>
        <title><![CDATA[COMPILADOS NOSTR]]></title>
        <description><![CDATA[Compilados de artigos, notícias e tutoriais publicados na rede Nostr em português.]]></description>
        <link>https://compilados.npub.pro/tag/i2p/</link>
        <atom:link href="https://compilados.npub.pro/tag/i2p/rss/" rel="self" type="application/rss+xml"/>
        <itunes:new-feed-url>https://compilados.npub.pro/tag/i2p/rss/</itunes:new-feed-url>
        <itunes:author><![CDATA[idsera]]></itunes:author>
        <itunes:subtitle><![CDATA[Compilados de artigos, notícias e tutoriais publicados na rede Nostr em português.]]></itunes:subtitle>
        <itunes:type>episodic</itunes:type>
        <itunes:owner>
          <itunes:name><![CDATA[idsera]]></itunes:name>
          <itunes:email><![CDATA[idsera]]></itunes:email>
        </itunes:owner>
            
      <pubDate>Wed, 23 Apr 2025 01:57:53 GMT</pubDate>
      <lastBuildDate>Wed, 23 Apr 2025 01:57:53 GMT</lastBuildDate>
      
      <itunes:image href="https://pfp.nostr.build/d04bb7baa476bbb67c4b0bb02e676d0fb8cd20b809f6956ed68d2adc647b91b1.jpg" />
      <image>
        <title><![CDATA[COMPILADOS NOSTR]]></title>
        <link>https://compilados.npub.pro/tag/i2p/</link>
        <url>https://pfp.nostr.build/d04bb7baa476bbb67c4b0bb02e676d0fb8cd20b809f6956ed68d2adc647b91b1.jpg</url>
      </image>
      <item>
      <title><![CDATA[🛡️ Running a Secure Lightning Node on Raspberry Pi 5]]></title>
      <description><![CDATA[This guide explains how to build a secure, privacy-respecting Bitcoin and Lightning Network node on a Raspberry Pi 5. Using Docker, ZFS, Tor, I2P, and Cloudflare Tunnel, you’ll achieve strong isolation, encrypted communication, and controlled public access.]]></description>
             <itunes:subtitle><![CDATA[This guide explains how to build a secure, privacy-respecting Bitcoin and Lightning Network node on a Raspberry Pi 5. Using Docker, ZFS, Tor, I2P, and Cloudflare Tunnel, you’ll achieve strong isolation, encrypted communication, and controlled public access.]]></itunes:subtitle>
      <pubDate>Wed, 23 Apr 2025 01:57:53 GMT</pubDate>
      <link>https://compilados.npub.pro/post/1745372780948/</link>
      <comments>https://compilados.npub.pro/post/1745372780948/</comments>
      <guid isPermaLink="false">naddr1qqxnzde5x5enwv3h8qcrjdpcqgsrl7kr5my9n6423nwaktrsq2nwzzenal4e95p9k9826mu294jkv4crqsqqqa28hzgv35</guid>
      <category>Bitcoin</category>
      
        <media:content url=" https://haven.girino.org/3cd2c25c6e227d0ac0c69e73b4112aeccc3dc8a8782543895e167b9cf2412126.png" medium="image"/>
        <enclosure 
          url=" https://haven.girino.org/3cd2c25c6e227d0ac0c69e73b4112aeccc3dc8a8782543895e167b9cf2412126.png" length="0" 
          type="image/png" 
        />
      <noteId>naddr1qqxnzde5x5enwv3h8qcrjdpcqgsrl7kr5my9n6423nwaktrsq2nwzzenal4e95p9k9826mu294jkv4crqsqqqa28hzgv35</noteId>
      <npub>npub18lav8fkgt8424rxamvk8qq4xuy9n8mltjtgztv2w44hc5tt9vets0hcfsz</npub>
      <dc:creator><![CDATA[Girino Vey!]]></dc:creator>
      <content:encoded><![CDATA[<h2>🔧 Infrastructure Overview</h2>
<ul>
<li><strong>Hardware</strong>: Raspberry Pi 5 with PCIe NVMe HAT and 2TB NVMe SSD</li>
<li><strong>Filesystem</strong>: ZFS with separate datasets for each service</li>
<li><strong>Networking</strong>: Docker bridge networks for service segmentation</li>
<li><strong>Privacy</strong>: Tor and I2P routing for anonymous communication</li>
<li><strong>Public Access</strong>: Cloudflare Tunnel to securely expose LNbits</li>
</ul>
<h2>📊 Architecture Diagram</h2>
<p><img src="https://haven.girino.org/56ccad7f49c6c9b73bf1377277cef91a3e5f09bc1ff1bbe7eef0c686a2b7cd31.png" alt="Architecture Diagram"></p>
<h2>🛠️ Setup Steps</h2>
<h3>1. Prepare the System</h3>
<ul>
<li>Install Raspberry Pi OS (64-bit)</li>
<li>Set up ZFS on the NVMe disk</li>
<li>Create a ZFS dataset for each service (e.g., <code>bitcoin</code>, <code>lnd</code>, <code>rtl</code>, <code>lnbits</code>, <code>tor-data</code>)</li>
<li>Install Docker and Docker Compose</li>
</ul>
<h3>2. Create Shared Docker Network and Privacy Layers</h3>
<p>Create a shared Docker bridge network:</p>
<pre><code class="language-bash">docker network create \
  --driver=bridge \
  --subnet=192.168.100.0/24 \
  bitcoin-net
</code></pre>
<blockquote>
<p><strong>Note:</strong> Connect <code>bitcoind</code>, <code>lnd</code>, <code>rtl</code>, internal <code>lnbits</code>, <code>tor</code>, and <code>i2p</code> to this <code>bitcoin-net</code> network.</p>
</blockquote>
<h4>Tor</h4>
<ul>
<li>Run Tor in a container</li>
<li>Configure it to expose LND's gRPC and REST ports via hidden services:<pre><code>HiddenServicePort 10009 192.168.100.31:10009
HiddenServicePort 8080  192.168.100.31:8080
</code></pre>
</li>
<li>Set correct permissions:<pre><code class="language-bash">sudo chown -R 102:102 /zfs/datasets/tor-data
</code></pre>
</li>
</ul>
<h4>I2P</h4>
<ul>
<li>Run I2P in a container with SAM and SOCKS proxies</li>
<li>Update <code>bitcoin.conf</code>:<pre><code>i2psam=192.168.100.20:7656
i2pacceptincoming=1
</code></pre>
</li>
</ul>
<h3>3. Set Up Bitcoin Core</h3>
<ul>
<li>Create a <code>bitcoin.conf</code> with Tor/I2P/proxy settings and ZMQ enabled</li>
<li>Sync the blockchain in a container using its ZFS dataset</li>
</ul>
<h3>4. Set Up LND</h3>
<ul>
<li>Configure <code>lnd.conf</code> to connect to <code>bitcoind</code> and use Tor:<pre><code class="language-ini">[Bitcoind]
bitcoind.rpchost=bitcoin:8332
bitcoind.rpcuser=bitcoin
bitcoind.rpcpass=very-hard-password
bitcoind.zmqpubrawblock=tcp://bitcoin:28332
bitcoind.zmqpubrawtx=tcp://bitcoin:28333

[Application Options]
externalip=xxxxxxxx.onion
</code></pre>
</li>
<li>Don’t expose gRPC or REST ports publicly</li>
<li>Mount the ZFS dataset at <code>/root/.lnd</code></li>
<li>Optionally enable Watchtower</li>
</ul>
<h3>5. Set Up RTL</h3>
<ul>
<li>Mount <code>RTL-Config.json</code> and data volumes</li>
<li>Expose RTL's web interface locally:<pre><code class="language-yaml">ports:
  - "3000:3000"
</code></pre>
</li>
</ul>
<h3>6. Set Up Internal LNbits</h3>
<ul>
<li>Connect the LNbits container to <code>bitcoin-net</code></li>
<li>Mount the data directory and LND cert/macaroons (read-only)</li>
<li>Expose the LNbits UI on the local network:<pre><code class="language-yaml">ports:
  - "5000:5000"
</code></pre>
</li>
<li>In the web UI, configure the funding source to point to the LND REST <code>.onion</code> address and paste the hex macaroon</li>
<li>Create and fund a wallet, and copy its Admin Key for external use</li>
</ul>
<h3>7. Set Up External LNbits + Cloudflare Tunnel</h3>
<ul>
<li>Run another LNbits container on a separate Docker network</li>
<li>Access the internal LNbits via the host IP and port 5000</li>
<li>Use the Admin Key from the internal wallet to configure funding</li>
<li>In the Cloudflare Zero Trust dashboard:<ul>
<li>Create a tunnel</li>
<li>Select Docker, copy the <code>--token</code> command</li>
<li>Add to Docker Compose:<pre><code class="language-yaml">command: tunnel --no-autoupdate run --token eyJ...your_token...
</code></pre>
</li>
</ul>
</li>
</ul>
<h2>💾 Backup Strategy</h2>
<ul>
<li><strong>Bitcoin Core</strong>: hourly ZFS snapshots, retained for 6 hours</li>
<li><strong>Other Services</strong>: hourly snapshots with remote <code>.tar.gz</code> backups<ul>
<li>Retention: 7d hourly, 30d daily, 12mo weekly, monthly forever</li>
</ul>
</li>
<li>Back up ZFS snapshots to avoid inconsistencies</li>
</ul>
<h2>🔐 Security Isolation Benefits</h2>
<p>This architecture isolates services by scope and function:</p>
<ul>
<li>Internal traffic stays on <code>bitcoin-net</code></li>
<li>Sensitive APIs (gRPC, REST) are reachable only via Tor</li>
<li>Public access is controlled by Cloudflare Tunnel</li>
</ul>
<blockquote>
<p><strong>Extra Security</strong>: Host the public LNbits on a separate machine (e.g., hardened VPS) with strict firewall rules:</p>
<ul>
<li>Allow only Cloudflare egress</li>
<li>Allow ingress from your local IP</li>
<li>Allow outbound access to internal LNbits (port 5000)</li>
</ul>
</blockquote>
<p>Use <strong>WireGuard VPN</strong> to secure the connection between external and internal LNbits:</p>
<ul>
<li>Ensures encrypted communication</li>
<li>Restricts access to authenticated VPN peers</li>
<li>Keeps the internal interface isolated from the public internet</li>
</ul>
<h2>✅ Final Notes</h2>
<ul>
<li>Internal services communicate over <code>bitcoin-net</code></li>
<li>LND interfaces are accessed via Tor only</li>
<li>LNbits and RTL UIs are locally accessible</li>
<li>Cloudflare Tunnel secures external access to LNbits</li>
</ul>
<p>Monitor system health using <code>monit</code>, <code>watchtower</code>, or Prometheus.</p>
<p>Create all configuration files manually (<code>bitcoin.conf</code>, <code>lnd.conf</code>, <code>RTL-Config.json</code>), and keep credentials secure. Test every component locally before exposing it externally.</p>
<p>⚡</p>
]]></content:encoded>
      <itunes:author><![CDATA[Girino Vey!]]></itunes:author>
      <itunes:summary><![CDATA[<h2>🔧 Infrastructure Overview</h2>
<ul>
<li><strong>Hardware</strong>: Raspberry Pi 5 with PCIe NVMe HAT and 2TB NVMe SSD</li>
<li><strong>Filesystem</strong>: ZFS with separate datasets for each service</li>
<li><strong>Networking</strong>: Docker bridge networks for service segmentation</li>
<li><strong>Privacy</strong>: Tor and I2P routing for anonymous communication</li>
<li><strong>Public Access</strong>: Cloudflare Tunnel to securely expose LNbits</li>
</ul>
<h2>📊 Architecture Diagram</h2>
<p><img src="https://haven.girino.org/56ccad7f49c6c9b73bf1377277cef91a3e5f09bc1ff1bbe7eef0c686a2b7cd31.png" alt="Architecture Diagram"></p>
<h2>🛠️ Setup Steps</h2>
<h3>1. Prepare the System</h3>
<ul>
<li>Install Raspberry Pi OS (64-bit)</li>
<li>Set up ZFS on the NVMe disk</li>
<li>Create a ZFS dataset for each service (e.g., <code>bitcoin</code>, <code>lnd</code>, <code>rtl</code>, <code>lnbits</code>, <code>tor-data</code>)</li>
<li>Install Docker and Docker Compose</li>
</ul>
<h3>2. Create Shared Docker Network and Privacy Layers</h3>
<p>Create a shared Docker bridge network:</p>
<pre><code class="language-bash">docker network create \
  --driver=bridge \
  --subnet=192.168.100.0/24 \
  bitcoin-net
</code></pre>
<blockquote>
<p><strong>Note:</strong> Connect <code>bitcoind</code>, <code>lnd</code>, <code>rtl</code>, internal <code>lnbits</code>, <code>tor</code>, and <code>i2p</code> to this <code>bitcoin-net</code> network.</p>
</blockquote>
<h4>Tor</h4>
<ul>
<li>Run Tor in a container</li>
<li>Configure it to expose LND's gRPC and REST ports via hidden services:<pre><code>HiddenServicePort 10009 192.168.100.31:10009
HiddenServicePort 8080  192.168.100.31:8080
</code></pre>
</li>
<li>Set correct permissions:<pre><code class="language-bash">sudo chown -R 102:102 /zfs/datasets/tor-data
</code></pre>
</li>
</ul>
<h4>I2P</h4>
<ul>
<li>Run I2P in a container with SAM and SOCKS proxies</li>
<li>Update <code>bitcoin.conf</code>:<pre><code>i2psam=192.168.100.20:7656
i2pacceptincoming=1
</code></pre>
</li>
</ul>
<h3>3. Set Up Bitcoin Core</h3>
<ul>
<li>Create a <code>bitcoin.conf</code> with Tor/I2P/proxy settings and ZMQ enabled</li>
<li>Sync the blockchain in a container using its ZFS dataset</li>
</ul>
<h3>4. Set Up LND</h3>
<ul>
<li>Configure <code>lnd.conf</code> to connect to <code>bitcoind</code> and use Tor:<pre><code class="language-ini">[Bitcoind]
bitcoind.rpchost=bitcoin:8332
bitcoind.rpcuser=bitcoin
bitcoind.rpcpass=very-hard-password
bitcoind.zmqpubrawblock=tcp://bitcoin:28332
bitcoind.zmqpubrawtx=tcp://bitcoin:28333

[Application Options]
externalip=xxxxxxxx.onion
</code></pre>
</li>
<li>Don’t expose gRPC or REST ports publicly</li>
<li>Mount the ZFS dataset at <code>/root/.lnd</code></li>
<li>Optionally enable Watchtower</li>
</ul>
<h3>5. Set Up RTL</h3>
<ul>
<li>Mount <code>RTL-Config.json</code> and data volumes</li>
<li>Expose RTL's web interface locally:<pre><code class="language-yaml">ports:
  - "3000:3000"
</code></pre>
</li>
</ul>
<h3>6. Set Up Internal LNbits</h3>
<ul>
<li>Connect the LNbits container to <code>bitcoin-net</code></li>
<li>Mount the data directory and LND cert/macaroons (read-only)</li>
<li>Expose the LNbits UI on the local network:<pre><code class="language-yaml">ports:
  - "5000:5000"
</code></pre>
</li>
<li>In the web UI, configure the funding source to point to the LND REST <code>.onion</code> address and paste the hex macaroon</li>
<li>Create and fund a wallet, and copy its Admin Key for external use</li>
</ul>
<h3>7. Set Up External LNbits + Cloudflare Tunnel</h3>
<ul>
<li>Run another LNbits container on a separate Docker network</li>
<li>Access the internal LNbits via the host IP and port 5000</li>
<li>Use the Admin Key from the internal wallet to configure funding</li>
<li>In the Cloudflare Zero Trust dashboard:<ul>
<li>Create a tunnel</li>
<li>Select Docker, copy the <code>--token</code> command</li>
<li>Add to Docker Compose:<pre><code class="language-yaml">command: tunnel --no-autoupdate run --token eyJ...your_token...
</code></pre>
</li>
</ul>
</li>
</ul>
<h2>💾 Backup Strategy</h2>
<ul>
<li><strong>Bitcoin Core</strong>: hourly ZFS snapshots, retained for 6 hours</li>
<li><strong>Other Services</strong>: hourly snapshots with remote <code>.tar.gz</code> backups<ul>
<li>Retention: 7d hourly, 30d daily, 12mo weekly, monthly forever</li>
</ul>
</li>
<li>Back up ZFS snapshots to avoid inconsistencies</li>
</ul>
<h2>🔐 Security Isolation Benefits</h2>
<p>This architecture isolates services by scope and function:</p>
<ul>
<li>Internal traffic stays on <code>bitcoin-net</code></li>
<li>Sensitive APIs (gRPC, REST) are reachable only via Tor</li>
<li>Public access is controlled by Cloudflare Tunnel</li>
</ul>
<blockquote>
<p><strong>Extra Security</strong>: Host the public LNbits on a separate machine (e.g., hardened VPS) with strict firewall rules:</p>
<ul>
<li>Allow only Cloudflare egress</li>
<li>Allow ingress from your local IP</li>
<li>Allow outbound access to internal LNbits (port 5000)</li>
</ul>
</blockquote>
<p>Use <strong>WireGuard VPN</strong> to secure the connection between external and internal LNbits:</p>
<ul>
<li>Ensures encrypted communication</li>
<li>Restricts access to authenticated VPN peers</li>
<li>Keeps the internal interface isolated from the public internet</li>
</ul>
<h2>✅ Final Notes</h2>
<ul>
<li>Internal services communicate over <code>bitcoin-net</code></li>
<li>LND interfaces are accessed via Tor only</li>
<li>LNbits and RTL UIs are locally accessible</li>
<li>Cloudflare Tunnel secures external access to LNbits</li>
</ul>
<p>Monitor system health using <code>monit</code>, <code>watchtower</code>, or Prometheus.</p>
<p>Create all configuration files manually (<code>bitcoin.conf</code>, <code>lnd.conf</code>, <code>RTL-Config.json</code>), and keep credentials secure. Test every component locally before exposing it externally.</p>
<p>⚡</p>
]]></itunes:summary>
      <itunes:image href=" https://haven.girino.org/3cd2c25c6e227d0ac0c69e73b4112aeccc3dc8a8782543895e167b9cf2412126.png"/>
      </item>
      
      </channel>
      </rss>
    