What is WASM?
All web browser today are almost like a virtual machine, inside which program code can run. In the olden days it would just be JavaScript or VBScript or, via a plug-in, Java code running in an JVM inside the browser. (Or Flash, in the FlashPlayer, but let's not talk about that).
Nowadays, all modern browsers support WASM aka WebAssembly[1]. This allows us to create programs that run “close to the metal”. This means that games or video/audio editing [5] or other very demanding tasks can run without the hindrance of one extra conversion step.
Other techniques [2], [3] allow us to save and later retrieve data inside the browser.
Can I install and run a BTC/LN node inside a browser?
You can see where this is going. A BTC node needs to download, process, and store large amounts of data to run (less storage if it's running in “pruned” mode). A LN node, however, needs only to connect to a full BTC node to function. It should be relatively simple to program a LN node that runs entirely inside a browser. [4]
Why would you want a NOSTR client (or a relay) in wasm inside a browser?
One weak point of Nostr is that there is a distinction between participating clients and those with more technical skills that support the network by running a relay. This is different from P2P models like BitTorrent uses, where to download you also need to upload [6].
Now, imagine a world in which every Nostr web client doesn't need a server that collects all messages and forwards those to your browser. Rather, the Nostr client fully runs inside the browser. There would be no more choke points, and all users would (even unknowingly) be full participants in this decentralized network.
A man's gotta dream...
Links
[1] https://medium.com/commencis/what-is-the-webassembly-wasm-c19bfcfb34ad
[2] https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
[3] https://html.spec.whatwg.org/multipage/webstorage.html#webstorage
[4] one wonko even ported parts of a BTC node to WASM, see: https://github.com/donpdonp/bitcoin-wasm
[5] https://github.com/ffmpegwasm/ffmpeg.wasm
[6] Although you can set your upload and download bandwidths independently and thereby be more of a leecher than a seeder.