<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>sandwich: writing</title>
    <link>https://sandwich.farm/writing/</link>
    <description>sandwich builds open-source software for individual sovereignty: Nostr relay monitoring and NIPs, the napplet protocol for sandboxed apps, and Hyprland desktop plugins. 25+ years of shipping, two companies co-founded.</description>
    <language>en</language>
    <atom:link href="https://sandwich.farm/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>A paint app shouldn’t need to understand Nostr</title>
      <link>https://sandwich.farm/writing/a-paint-app-shouldnt-need-to-understand-nostr/</link>
      <guid isPermaLink="true">https://sandwich.farm/writing/a-paint-app-shouldnt-need-to-understand-nostr/</guid>
      <pubDate>Wed, 28 Oct 2026 19:08:13 GMT</pubDate>
      <dc:creator>sandwich</dc:creator>
      
      <content:encoded><![CDATA[<p>A paint app needs a canvas, some colors, and a way to undo a bad brushstroke. The user probably wants to copy or save the image locally. None of that requires a relay connection or a signing key. If you want to build one, you should be able to spend your time on the editor. And if someone wants to try it, they shouldn't have to trust you with everything else they do.</p>
<p>That's the thinking behind napplets and <a href="https://github.com/nostr-protocol/nips/pull/2303" rel="noopener">NIP-5D</a>. A napplet is a small, focused app that runs inside a shell. The shell hosts the app, mediates its requests, and lets the user compose it with other apps. We deliberately put most of the weight on the shell so that building a napplet can stay simple.</p>
<h2>Start with the app you want to make</h2>
<p>There's already a paint napplet, an image editor called Fotohop, and plenty of games. They don't need to be about Nostr to belong here. Drawing a picture or playing a game doesn't require a social graph or an event to publish.</p>
<p><img src="https://cdn.hzrd149.com/bf425dacaefd37ad5498b024a2043313db6cab3048d49997ae03eb0161252008.png" alt="Fotohop image editor running as a napplet, with a simple mountain-and-sun drawing on its canvas." loading="lazy" decoding="async" /></p>
<p><em>Fotohop running in the <a href="https://applesauce.build/examples/#/example/napplet/loader" rel="noopener">Applesauce napplet loader</a>. Drawing made for this article.</em></p>
<p>Nostr provides the foundation for publishing and discovering napplets. Inside the app, you can use ordinary browser capabilities for the interface and computation, then ask the shell for any additional capabilities you need. You could build a drawing tool and add sharing later. The limits are the host environment and the capabilities the shell exposes; your app's purpose is yours to choose.</p>
<p><video controls preload="none" playsinline src="https://cdn.hzrd149.com/95be3bb45b50a27c2279983677250a9773f1784611955d8308b0512ebc8d42cb.mp4"></video></p>
<p><em><a href="https://applesauce.build/examples/#/example/napplet/loader?pointer=naddr1qvzqqqyf8ypzpem34u9stj8ftlxldl4n2qz5f5hmrnxns3uga86fpwe7u28ga4n0qqyhqatyv3kx26r0wq5cthp5" rel="noopener">Play Dodgy Duck</a>, an endless voxel crossing game. <a href="https://cdn.hzrd149.com/95be3bb45b50a27c2279983677250a9773f1784611955d8308b0512ebc8d42cb.mp4" rel="noopener">Watch the gameplay preview</a></em></p>
<p>For developers arriving from outside Nostr, that matters. Knowing how to build a useful app should be enough to get started. If the idea needs Nostr features, you can learn the relevant event formats and conventions as you go. Some specialized apps will need quite a lot of protocol knowledge. A paint tool may need none of it.</p>
<h2>Why put so much in the shell?</h2>
<p>We arrived at this split through research and iteration, including the <a href="https://github.com/sandwichfarm/napp.run" rel="noopener">early prototypes</a>. We looked at the security constraints, the infrastructure developers kept rebuilding, and what users had to understand before they could comfortably try an app. The goal was to make decisions against practical requirements rather than pick an architecture because it sounded elegant.</p>
<p>The balance involves three groups. Protocol developers need somewhere to handle Nostr properly. App developers need a manageable API. Users need a foundation they can trust. Moving protocol infrastructure and privileged operations into the shell gives each group a clearer job: protocol developers work on the shared services, app developers build their apps, and users choose how to put them together.</p>
<p>An app can ask for data and request actions through the shell's capabilities without building its own relay connection manager or signing flow. When someone improves the shell's routing or security, many apps can benefit. Shell developers take on more complexity, but each napplet author has less infrastructure to maintain.</p>
<p><video controls preload="none" playsinline src="https://cdn.hzrd149.com/ccc178d603389c403521f631f547a163c8748cc3e7609b115c51b010e331859c.mp4"></video></p>
<p><em>The <a href="https://napplet.run/#how" rel="noopener">animated diagram on napplet.run</a> cycles through relay, storage, media, notify, theme, value, upload, resource, and CVM. Requests and responses pass through the shell. <a href="https://cdn.hzrd149.com/ccc178d603389c403521f631f547a163c8748cc3e7609b115c51b010e331859c.mp4" rel="noopener">Watch the full cycle</a>.</em></p>
<p>The common contract between a napplet and the runtime providing its capabilities is called the capability seam. NIP-5D defines how it works on the web; individual NAPs define capabilities such as storage, relay access, and resource fetching. The <a href="https://github.com/napplet/naps" rel="noopener">NAP registry</a> describes those contracts. Keeping them separate lets capabilities develop without putting every feature into the core specification, and gives different shells a common contract to implement.</p>
<h2>Trust your shell. Distrust the napplets.</h2>
<p>That's the footing we want users to have. The system treats napplet code as untrusted because an app can be buggy, carelessly generated, or deliberately malicious. Users shouldn't have to work out which one they're dealing with before the protections apply.</p>
<p>In the web model, the shell verifies the signed manifest and the hash of the app file before running it in a restricted iframe. It then binds incoming requests to the iframe it created. Privileged requests go through shell policy; napplets don't receive signing keys or a general signing and encryption API. The <a href="https://github.com/dskvr/nips/blob/nip/5d/5D.md" rel="noopener">current draft</a> defines that boundary.</p>
<p>Verification establishes which artifact is running, not whether its author means well. The restrictions still have to hold. An iframe sandbox alone doesn't block every network request, either, so shells need appropriate network restrictions. The draft discusses Content Security Policy for that purpose.</p>
<p>This makes the shell a serious responsibility. A bad shell can undermine the model. Broad permissions can weaken the protection, constant approval dialogs can become background noise, and excessive restrictions can prevent useful apps from working. Putting the decisions in one place gives users a place to make an informed trust decision, but shell developers still have to get them right.</p>
<p>That's where <a href="https://github.com/napplet/evil" rel="noopener">napplet/evil</a> comes in. Its deliberately hostile napplets probe sandbox escapes, forged messages, manifest confusion, and access to another app's stored data. A configurable victim shell lets developers weaken protections and observe the consequences. The tests examine what happens when an app claims another app's identity, when a shell renders an attacker-written manifest title as HTML, or when a changed artifact inherits data it shouldn't have.</p>
<p>The project's <a href="https://github.com/napplet/evil/blob/main/ROADMAP.md" rel="noopener">research roadmap</a> also reports fingerprinting exposure, WebRTC API availability despite the baseline Content Security Policy, and a test where a busy napplet stalled the shell's message handling. These are reported results from its harness, not an audit of every deployed shell. They give developers repeatable ways to challenge the assumptions and check fixes; a passing suite isn't a blanket security guarantee.</p>
<p>Protecting users this way is part of the adoption work. Trying a new app becomes a more reasonable choice when the shell can limit what it does. We want people to enjoy a tool without having to trust its author with everything.</p>
<h2>The earlier approach, and NAPP</h2>
<p>The <a href="https://github.com/eskema/nostrapps/blob/main/NAPP.md" rel="noopener">NAPP protocol</a> resembles a much earlier approach we explored before writing the napplet spec. We abandoned our own earlier design because it didn't satisfy the adoption requirements we were working toward. The resemblance is in the architecture; NAPP is a separate project.</p>
<p>Both approaches have small apps, a host, and a bridge to shared services. NAPP documents permissions and prompts for sensitive operations, but its bridge exposes NIP-07 signing and encryption methods. NIP-5D deliberately keeps those primitives out of the napplet. We want app developers to request useful operations while the shell handles more of the protocol and security responsibility.</p>
<p>NAPP's application surface is also more Nostr-forward: signing, event-store access, relay helpers, and Nostr actions are prominent. Napplets put Nostr services behind capability contracts alongside storage, media, and resource access. A paint tool or game is as much the point as a feed viewer. NAPP can host non-Nostr apps too; the benefit we're aiming for is making general applications a natural starting point without requiring them to organize themselves around Nostr.</p>
<p>Much like <code>napplet/evil</code> I put together <a href="https://github.com/sandwichfarm/evil-napps" rel="noopener">evil-napps</a> to test that model. It probes launcher isolation, forged bridge messages, action routing, shared-store abuse, and signing permissions. Its documentation distinguishes harness demonstrations from findings checked against the reference launcher's source. As with evil napplets, those findings aren't a fresh audit of every launcher. Both models deserve to have their assumptions tested.</p>
<h2>Less code to carry around</h2>
<p>A focused napplet can leave much of the infrastructure out of its own codebase. That's less code for a person to maintain and less context for a coding agent to consume. An agent building a paint tool can concentrate on drawing, the interface, and the capability contracts it uses.</p>
<p>That smaller scope and shared infrastructure can make napplets cheaper and faster to produce. There isn't a universal token saving or speedup to promise, and an app that pulls in a huge framework or tries to do everything can give much of the advantage back. Runtime costs need the same care: the shell consumes resources, and separate iframes have overhead. A smaller app and less duplicated infrastructure don't guarantee lower total memory use in every setup.</p>
<h2>There are shells to try, and gaps to close</h2>
<p>This is still alpha. The protocol is changing, and specifications, SDKs, and shells can drift apart. Capability coverage, interoperability, tooling, and the experience of building and using these apps all need work. The intended model and what a particular implementation delivers aren't always the same.</p>
<p>A napplet declares the capabilities it needs, and the shell decides what it can expose. Those declarations aren't permission grants. Optional features need fallbacks, and developers need to check what their chosen shell provides.</p>
<p>You can already explore different takes on the shell in <a href="https://amethyst.social/" rel="noopener">Amethyst</a>, <a href="https://github.com/Origami74/myco" rel="noopener">Myco</a>, <a href="https://nostrudel.ninja/" rel="noopener">noStrudel</a>, <a href="https://grimoire.rocks/" rel="noopener">Grimoire</a>, and <a href="https://napplet.soy/" rel="noopener">napplet.soy</a>. <a href="https://kehto.github.io/web/paja/" rel="noopener">Paja</a> is a developer shell for loading napplets and inspecting their behavior. These projects are at different stages, with different capability support.</p>
<p>The <a href="https://applesauce.build/examples/#/example/napplet/store" rel="noopener">Applesauce napplet store example</a> shows a live list of apps discovered from Nostr relays. Browse it to see what people are making.</p>
<p><img src="https://cdn.hzrd149.com/fe577867552b0322aac53107aa6ca3fb5183183b0e165f880a5db1d19781e2b3.png" alt="Applesauce Napplet Store showing relay filters and a live selection of games and a radio app." loading="lazy" decoding="async" /></p>
<p><em>The <a href="https://applesauce.build/examples/#/example/napplet/store" rel="noopener">Applesauce store example</a> discovers napplets from relays. This screenshot is a snapshot; the live list changes.</em></p>
<p>Developers are working to close the gaps through the <a href="https://github.com/napplet/web" rel="noopener">SDK and tooling</a>, <a href="https://github.com/kehto/web" rel="noopener">runtime work</a>, and other implementations linked from the <a href="https://github.com/nostr-protocol/nips/pull/2303" rel="noopener">NIP-5D discussion</a>. Those projects give us somewhere to test the design and improve it. Their existence doesn't make the protocol mature yet.</p>
<h2>Make it together</h2>
<p><a href="https://napplet.soy/studio/create" rel="noopener">napplet.soy's Studio</a> gives you an interface for building in the browser: describe an idea, play the preview, and ask for changes. You connect a Nostr account and your own AI provider, then review the result before publishing. Its local tools let you work in your own editor or coding agent too.</p>
<p><img src="https://cdn.hzrd149.com/99a238afe12cf1ad1d80f2302db3ae13310ea1db9299e8bf1b44ca1cc9b8b74e.jpg" alt="napplet.soy Studio showing an agent conversation beside a playable breakout-game preview." loading="lazy" decoding="async" /></p>
<p><em><a href="https://napplet.soy/studio/create" rel="noopener">napplet.soy Studio</a>: ask for changes on the left and try the game on the right. Screenshot supplied by the author.</em></p>
<p>You can also build on someone else's work. The <a href="https://napplet.soy/docs" rel="noopener">remix and contribution workflow</a> lets you make your own version of a napplet or propose improvements to the original. For projects with Git source, a proposal includes a playable preview. The author can compare the original and proposed versions, inspect the code changes, discuss them, and merge locally. Publishing the updated app is a separate step.</p>
<p>Say someone makes a game you like, but the controls are awkward on your phone. You could remix it, improve the touch controls with your agent, and send back a version the author can actually play. Other people can try and discuss the proposal on the site. That gives the conversation something concrete to work with before the author decides what to release.</p>
<h2>Try making something small</h2>
<p>Run <code>npx skills add napplet/web</code>, open your coding agent, and ask it to use the <code>napplet-make</code> skill. Try: “Use napplet-make to build a simple paint napplet with a canvas, a color picker, and an undo button.”</p>
<p>Pick one small thing you'd like to use. Ask the agent to verify it and preview it in Paja, then try it yourself.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Find historical bitcoin block number with unix timestamp</title>
      <link>https://sandwich.farm/writing/find-bitcoin-block-number-with-timestamp/</link>
      <guid isPermaLink="true">https://sandwich.farm/writing/find-bitcoin-block-number-with-timestamp/</guid>
      <pubDate>Thu, 05 Sep 2024 22:12:02 GMT</pubDate>
      <dc:creator>sandwich</dc:creator>
      <description>Script to find historical block number from timestamp.</description>
      <content:encoded><![CDATA[<p>I have searched the web for "Find bitcoin block number from historical date" maybe 100 times in my life. </p>
<p><strong>Never again.</strong></p>
<p>You'll need a bitcoin node for this to work. The script is fast. </p>
<h2>Install</h2>
<h2>WoT Install</h2>
<p><em>one liner</em></p>
<pre><code># curl
curl -o fjb.sh https://gist.githubusercontent.com/dskvr/18252c16cf85c06c1ee6cb5ae04a3197/raw/34bad6a35d98501978c8cd0c25b1628db1191cfe/fjb.sh &amp;&amp; chmod +x fjb.sh

#wget
wget -O fjb.sh https://gist.githubusercontent.com/dskvr/18252c16cf85c06c1ee6cb5ae04a3197/raw/34bad6a35d98501978c8cd0c25b1628db1191cfe/fjb.sh &amp;&amp; chmod +x fjb.sh
</code></pre>
<h2>Trust no one.</h2>
<p><em>create file</em></p>
<pre><code>vi fjb.sh
#or
nano fjb.sh
</code></pre>
<p><em>review, copy and past into file</em></p>
<pre><code>TIMESTAMP=$1
LOWER=0
UPPER=$(bitcoin-cli getblockcount)

while (( LOWER &lt;= UPPER )); do
    MID=$(( (LOWER + UPPER) / 2 ))
    BLOCKHASH=$(bitcoin-cli getblockhash $MID)
    BLOCKTIME=$(bitcoin-cli getblockheader $BLOCKHASH | jq .time)

    if (( BLOCKTIME &lt; TIMESTAMP )); then
        LOWER=$(( MID + 1 ))
    elif (( BLOCKTIME &gt; TIMESTAMP )); then
        UPPER=$(( MID - 1 ))
    else
        echo "$BLOCKTIME"
        exit 0
    fi
done

echo "$UPPER"
</code></pre>
<p><em>give executable permissions</em></p>
<pre><code>chmod +x ./fjb.sh
</code></pre>
<h2>Usage</h2>
<pre><code>./fjb.sh &lt;timestampSeconds&gt; 
</code></pre>
<p><em>It returns block number only</em></p>
<h2>Example</h2>
<pre><code>$: ./fjb.sh 1668779310
763719
</code></pre>
]]></content:encoded>
    </item>
    <item>
      <title>myrelay.page transforms your relay's landing page into a customizable micro-client</title>
      <link>https://sandwich.farm/writing/myrelay-page-v0-2-0/</link>
      <guid isPermaLink="true">https://sandwich.farm/writing/myrelay-page-v0-2-0/</guid>
      <pubDate>Fri, 19 Apr 2024 18:49:56 GMT</pubDate>
      <dc:creator>sandwich</dc:creator>
      <description>An article about new myrelay.page features and NIP-78 </description>
      <content:encoded><![CDATA[<p>Have you ever seen a relay and out of curiosity visited the https canonical of a relay by swapping out the <code>wss</code> with <code>https</code>? I sure have, and I believe others have too. When I ran <code>https://nostr.sandwich.farm</code> in late 2022/2023, I had thousands of hits to my relay's https canonical. Since then, I've dreamed of improving the look and feel of these generic default <em>landing pages</em>.</p>
<p>With the release of <a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page v0.2</a>, relays can now host their own customizable micro-client at their <em>https canonical</em>.</p>
<p>Transform your relay's landing page from this:
<img src="https://image.nostr.build/de9d56c610fe164e51e255a829a292a437359e8c23cfe26b931f5fdd33d04b2d.png" alt="strfry default page" loading="lazy" decoding="async" /></p>
<p>or this:
<img src="https://image.nostr.build/4b320b11f664de0484d00e53a33d7fbe6737116bfc0d5ce330c427719eb9b5ab.png" alt="nostr-rs-relay default page" loading="lazy" decoding="async" /></p>
<p>to something <em>like</em> this: 
<img src="https://image.nostr.build/90bd6370e45aab262dea3f68731b7f756ce66602d55b4bbc1cf8bc809cafb216.png" alt="nostr-rs-relay default page" loading="lazy" decoding="async" /></p>
<p>I say "something <em>like</em> this" because each page is customizable at runtime via the page itself.</p>
<h2>In a nutshell</h2>
<p><a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page</a> is a self-configuring, Client-Side Rendered (CSR) micro-client specifically built to be hosted at relay canonicals, customizable at runtime via NIP-78. Check out a <a href="https://lunchbox.sandwich.farm" rel="noopener">live example</a>.</p>
<h2>Features:</h2>
<ol>
<li>Dark or light theme</li>
<li>Join relay</li>
<li>Relay operator profile and feed</li>
<li>Zap relay operator </li>
<li>See people you follow who are on the relay </li>
<li>Customizable by the relay operator</li>
</ol>
<ul>
<li>Enable/disable blocks</li>
<li>Sort blocks</li>
<li>Add HTML blocks</li>
<li>Add image blocks</li>
<li>Add markdown blocks</li>
<li>Add feed blocks, with two layouts (grid/list) and customizable filters.</li>
</ul>
<p><strong>You can find a full list of features complete and todo <a href="https://github.com/sandwichfarm/myrelay.page?tab=readme-ov-file#todo" rel="noopener">here</a></strong></p>
<h2>Why I created myrelay.page</h2>
<p>For several different reasons. </p>
<p>Firstly, the default, bland relay pages always seemed like a missed opportunity. I jotted down an idea to build a relay micro-client in early January 2023, but never had the time to start it.</p>
<p>Next, I've been ramping up the refactor of <a href="https://nostr.watch" rel="noopener">nostr.watch</a> and first need to catch up on client-side technologies and validate a few of my ideas. To do this, I have been conducting short research &amp; development projects to prepare and validate ideas before integrating them into an app I intend to support long-term. One of those R&amp;D projects is <a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page</a>.</p>
<p>Additionally, I wanted to explore NIP-78 a bit more, a NIP that came into fruition after a conversation I had with @fiatjaf on February 23rd, 2023. It stemmed from the desire to store application-specific data for app customization. I have seen clients use NIP-78, but from what I've seen, their implementations are limited and do not demonstrate the full potential of NIP-78. <em>There's more on NIP-78 towards the end of this article</em></p>
<p>The convergence of these needs and ideas, in addition to having an itch I needed to scratch, resulted in the creation of myrelay.page.</p>
<blockquote>
<p>*<em>Could be wrong, please let me know in the comments if you have examples of nostr clients that utilize NIP-78 for propagating customizations to other visitors</em>.</p>
</blockquote>
<h2>Editor Flow</h2>
<p>Now I'm going to give you a brief example of the Editor Flow on myrelay.page. There's a lot that isn't covered here, but I want to be as brief as possible.</p>
<p><em>Note: <a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page</a> is alpha, there are bugs, quality of life issues and things are far from perfect.</em></p>
<h2>Login</h2>
<blockquote>
<p>Presently, myrelay.page only supports NIP-07 authentication, but other authentication methods will be implemented at a later date.</p>
</blockquote>
<blockquote>
<p>In order to customize your page, you need to have a <strong>valid NIP-11</strong> document that provides a valid <strong>hex</strong> <code>pubkey</code> value that is the same as the key you use to login.</p>
</blockquote>
<p><img src="https://image.nostr.build/9beab8ce9d863f75d0dcaad44f44f99e59361900c27d458b0f0cb77ec499e2bf.png" alt="image of the header with login button" loading="lazy" decoding="async" /></p>
<h2>Click "Edit"</h2>
<p><img src="https://image.nostr.build/b70d5c96bd0999e5556323b5b0c135931ac95b0e162fdcb4b2981f79e95032a8.png" alt="image of the header with edit button" loading="lazy" decoding="async" /></p>
<h2>Add a block</h2>
<p>For brevity, I'm going to add a markdown block</p>
<p><img src="https://image.nostr.build/9ec7ba8a87053f55f1434993efc78218b10d3aaa82650b1a78058eb2104378a9.png" alt="add block interface" loading="lazy" decoding="async" /></p>
<h2>Configure the block</h2>
<p>Add a title to the block and a sentence with markdown syntax. </p>
<p><img src="https://image.nostr.build/6fdeb917b1cc9dda49479419f85a897f531b641a4be947b89d5176c04b76a20f.png" alt="image of the page editor" loading="lazy" decoding="async" /></p>
<h2>Publish the configuration</h2>
<p>Click publish and confirm the event, once it's been published to relays the page will refresh. </p>
<p><em>Note: Again it's alpha, so the page doesn't refresh after a few seconds, the publish probably failed. Press publish until it refreshes. Error handling here will improve with time.</em></p>
<h2>Confirm state persistence</h2>
<p>After reload, you should see your block persisted. Anyone who visits your page will see your newly configured page. Big caveat: Given the blessing of relays who store your configuration note, if your configuration cannot be found or you cannot connect to your relays, visitors will only see your relay's NIP-11.</p>
<p><img src="https://image.nostr.build/ed97a9c818371aaf28a4c99e93bd2ecbc7448a88dd5a9bce07383c92e5959965.png" alt="updated page" loading="lazy" decoding="async" /></p>
<h2>Interested?</h2>
<p><a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page</a> is alpha and only has two releases, so if you want to be an early adopter, you'll need the skillset and patience of an early adopter. That said, as long as you have some basic development and sysadmin skills as well as understand your reverse-proxy of choice, it's a quick, easy and low-risk side project that can be completed in about 20 minutes.</p>
<h2>1. Build</h2>
<p><code>yarn build</code> or <code>npm run build</code> or <code>pnpm run build</code> (note: I had issues with pnpm and cannot guarantee they are resolved!)</p>
<h2>2. Deploy</h2>
<p>Move the contents of <code>build</code> folder to your relay server (or another server that you can reverse-proxy to from your relay)</p>
<h2>3. Update your reverse-proxy configuration</h2>
<p>You'll need to split your relay traffic from the http traffic, this ranges from easy to difficult, depending on your server of choice. </p>
<ul>
<li><strong>caddy</strong>: By far the easiest, see an example configuration for strfry <a href="https://github.com/sandwichfarm/myrelay.page/blob/main/caddy/strfry/Caddyfile" rel="noopener">here</a> (easily adapted by those with experience to other relay software)</li>
<li><strong>nginx</strong>: A little more stubborn, here's the <a href="https://gist.github.com/dskvr/4ea1937bd5c2161249146bc1edd2682e" rel="noopener">most recent nginx config I got to work</a>. You'll need to serve the static site from an internal port (<code>8080</code> in the aforementioned nginx conf)</li>
<li><strong>haproxy</strong>: Should be easier than nginx or maybe even caddy, haven't tried yet.</li>
<li><strong>no reverse-proxy</strong>: <strong>shrugs</strong></li>
</ul>
<p>If any of that's over your head, I'll be providing detailed guides for various deployment shapes within the next few weeks.</p>
<h2>Exploring NIP-78</h2>
<p>One of the special things about NIP-78 is that it is application specific, meaning, you don't need to conform to any existing NIP to make magic happen. Granted there are limits to this, as interoperability reigns supreme on nostr. However, there are many use cases where interoperability is not particularly desirable nor beneficial. It doesn't change the care needed to craft events, but it does enable a bunch of unique opportunities.</p>
<ol>
<li>A nostr client that is fully configurable and customized by the user.</li>
<li>A nostr powered CMS that can be edited entirely on the client-side.</li>
<li>Any use case where an application has special functionality or complex data structures that present no benefit in the context of interoperability (since they are "Application Specific").</li>
</ol>
<h2>Final thoughts</h2>
<p>I was surprised at how quickly I was able to get <a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page</a> customizable and loading within an acceptable timeframe; <code>NIP-11</code>, the operator's <code>NIP-65</code> and the <em>myrelay.page</em> <code>NIP-78</code> events all need to be fetched before the page is hydrated! While there is much to do around optimization, progressive page-loading, and general functionality, I'm very happy with the outcome of this short side project.</p>
<p>I'll be shifting my focus over to another micro-app to validate a few concepts, and then on to the next <a href="https://nostr.watch" rel="noopener">nostr.watch</a>. Rebuilding nostr.watch has been a high-priority item since shortly after Jack lit a flame under nostr in late 2022, but due to personal circumstances in 2023, I was unable to tackle it. Thanks to <a href="https://opensats.org/" rel="noopener">@opensats</a> I am able to realize my ideas and explore ideas that have been keeping me up at night for a year or more.</p>
<p>Also, if you're a relay developer and are curious about making it easier for developers to deploy <a href="https://github.com/sandwichfarm/myrelay.page" rel="noopener">myrelay.page</a>, get in touch. </p>
<p>Next article will likely be about the micro-app I briefly mentioned and <a href="https://nostr.watch" rel="noopener">nostr.watch</a>. Until then, be well.</p>
]]></content:encoded>
    </item>
    <item>
      <title>nostr.watch update November 2023</title>
      <link>https://sandwich.farm/writing/nostr-watch-update-november-2023/</link>
      <guid isPermaLink="true">https://sandwich.farm/writing/nostr-watch-update-november-2023/</guid>
      <pubDate>Tue, 28 Nov 2023 03:17:07 GMT</pubDate>
      <dc:creator>sandwich</dc:creator>
      <description>A quick update on nostr.watch</description>
      <content:encoded><![CDATA[<p>The last 6 months has been full full of unexpected surprises, of the unpleasant variety.  So it was welcomed news that <code>nostrwatch</code> was awarded a grant by OpenSats recently which has allowed me to revisit this project and build out my original vision, the one I had before nostr went vertical. </p>
<p>The last month has been a bit of a joyride, in that I have met little friction meeting goals. For example I was able to rewrite <code>nostrwatch-js</code> in an evening, tests another evening and did most of the Typescript conversion in 30 minutes (thanks AI!) </p>
<p>Here's a quick summary of the last month, I'm probably missing a handful of details, but these are the important bits. </p>
<ol>
<li>Went through all the new NIPs, prototyped and experimented</li>
<li>Nearly completed a full rewrite of <code>nostrwatch-js</code>, now <a href="https://github.com/sandwichfarm/nostr-watch/tree/next/packages/nocap" rel="noopener"><code>nocap</code></a>. Presently porting to Typescript. Still alpha, don’t use it. </li>
<li>Released <a href="https://github.com/sandwichfarm/nostrawl" rel="noopener"><code>nostrawl</code></a>, a wrapper for <code>nostr-fetch</code> that has Queue adapters for persistent fetching. Nothing special, but needed to factor out the functionality from the legacy trawler and the requirements were general enough to make it a package.</li>
<li>Starting porting the nostr.watch trawler, cache layer and rest API, but much work is still needed there. Aiming to have the current infrastructure updated with new daemons by end of year. </li>
<li>In concert with the cache layer testing, I ran some experiments by patching in a rough trend engine prototype from earlier this year and a novel outbox solution, both with promising results.</li>
<li>Wrote a few small CLI tools to assist with developments, got acquainted with <code>ink</code>, and reacquainted myself with wonderful world of ES Module conflicts.</li>
</ol>
<p>The rest of this year will be mostly backend work, tests and data engineering. Early next year I will begin iterative development on a new GUI and a string of CLI tools.</p>
<p>Luckily, nostr.watch and it's underlying infrastructure, as abysmal as it is, hasn't completely sank. Traffic is much lower than the ATH but still hovering between 2-3k unique visitors a month. I can't express in words how happy I will be when I can put the legacy nostr.watch to rest. </p>
<p>Next update will include a bit more of the why and how, and where I am trying to get to with this project. </p>
<p>Until next time. </p>
]]></content:encoded>
    </item>
  </channel>
</rss>
