Skip to the content.
Español ES | Deutsch DE | Français FR | Italiano IT | Dutch NL | Hrvatski HR | Hindi HI

Originaly posted on Substack on Apr 14, 2023. Updated here on Dec 28, 2024.

This article was also registered with OP_RETURN at block height #785362

How to run a free, decentralized, private, unstoppable marketplace with LNbits, using the NOSTR-market extension, over wss relays, with no http traffic whatsoever and even without DNS/domain..

This is a great achievement for NOSTR and LNbits, a revolutionary protocol to be able to trade in a total decentralized way, announced by Ben Arc here.

If you are new to this and don't know what is NOSTR, start reading here: nostr.com | nostr.how /

If you are new to LNbits, never use it, never heard of it, start reading here:

The original protocol was Diagon-Alley, that later became NOSTR-Market (NIP-15).

Diagon Alley is a decentralized market-stall protocol, that shifts emphasis from the front-end market to the merchants stall. If a front-end market (indexer) gets taken down, merchants just point their stalls elsewhere. Game-theoretically the winner of Diagon Alley is the most forthright, although suggestions on limiting bad behavior are very welcome.

Indexers

Indexer is a simple front-end server and GUI that routes product, payment and shipping information between merchant and buyer. Each merchant has products in a stall. The stall chooses what products to list with the indexer. An indexer has one endpoint.

Stalls

A stall has a keypair it uses to register itself to indexes and sign invoices. That keypair isn't related to any Lightning Network keypair, it's independent.

A stall can choose to list some/all products with an indexer. A stall is a small server that has three endpoints.

But all that was based on http protocol, so still was depending on domain/DNS and traffic over http.

Now, NOSTR-market is build over NOSTR protocol, where all the traffic is over wss relays. HTTP access it can be optional in case the merchant want to publish a public web-shop.

But practically anybody can run a shop stall in a local instance of LNbits (on 127.0.0.1) and broadcast as notes all the items from its stall to the relays is connected.

Same as for customers, could just run a local NOSTR-client and a NOSTR-market and connect to any merchant pubkey over wss relays. Then shop freely, decentralized, anonymously with no http traffic whatsoever, using for payments the Bitcoin Lightning Network.

Let's get started!

AS A MERCHANT

Let's consider you already have installed LNbits (see the links above about LNbits). Will not enter into those details now, will make this guide too long.

A short checklist before starting with NOSTR-market:

Step 1 - Install required LNbits extensions

A - Activate the adminUI feature

For an easy management of your LNbits server (funding sources, users, admins, install extensions etc).

To remember:
B - Install User Manager (UM) extension

This is a very useful extension to manage and create users, wallets and levels of access. See more instructions here.

Login with the Super Admin user, install the UM, then create a user with its wallet too.

Login with that user and save the URL in your bookmarks. This user could be also acting as an admin user (if you give full rights in the "Manage server" section).

Inside this "admin user" you can create several other normal users, same procedure using the UM extension. But only if are needed.

With this "admin user" we are going to create the merchant and stall with the NOSTR-market extension.

C - Install NOSTR-client extension

This is a required extension for NOSTR-market, because your market needs to connect to several NOSTR relays in order to be able to broadcast your stall.

NOSTR-client is an always-on extension that can open multiple connections to nostr relays and act as a multiplexer for other clients: You open a single websocket to nostrclient which then sends the data to multiple relays. The responses from these relays are then sent back to the client.

Add some NOSTR relays into the client. If you can add a proxy relay (one that is connected to many other relays) will be better to limit the sync traffic.

D - Install NOSTR-Market extension

This is the important extension you will use to create and manage your merchant profile, the stalls, products, interact with customers over NOSTR private messages, manage orders etc.

See more instructions here.


Step 2 - Configure your NOSTR-Merchant Stall and products

As a merchant you need to provide a Nostr key pair, or the extension can generate one for you. If you already use NOSTR for posting notes and chat you can use the same keys, to use the already created reputation and verification NIP-05. But is preferable to have a separate one for the shop and just publish into your "public NOSTR profile" the additional shop pubkey.

Once you have a merchant "account", you can view the details on the merchant dropdown, save the keys separately and/or announce your shop pubkey (not private key!) to your followers / customers.

SAVE YOUR PRIVATE KEY into a safe place! In case you need to migrate your LNbits NOSTR market or restore a LNbits instance to another machine, you could use that merchant private key to import your previous stall and items.

To create a stall, you first need to set a Shipping zone. Click on the Zones button and fill in the fields:

Now you can create the stall. Click on New Stall button and fill the necessary fields.

Click on the "Plus" button to open the stall details and click "New Product" to create a product:

Fill the necessary fields on the dialog

On the Stall section you can also see (update or delete) the stall details in Stall Info tab

Create, update or delete products in Products tab

Done! Your Merchant Stall is ready to be visited by your customers.

To test locally your stall, open the link of the local Market page, located on the main page of NOSTR-Market, on the right-side panel:

This link will open a new tab like: http:127.0.0.1/nostrmarket/market or https://your-lnbits.domain.com/nostrmarket/market (if you access it in clearnet).

Click on the Market menu and go to Merchants. Then paste your merchant pubkey (see the beginning of this chapter about displaying / saving your pubkey).

Once you add your pubkey, your stall will be displayed and broadcast to the relays.

The Login button is to be used as of customer or as you the owner of the Stall or as with your personal NOSTR profile.

You could test your NOSTR Stall also from any other public NOSTR Market page, like https://market.nostr.com/ for example. You just have to add your pubkey into the “Merchants” section and done. Any of your customers can do the same procedure or from their own local LNbits instance if they have it.

In a Market page you can add multiple merchants and shop from there directly. As you can see in the image above, are 3 different merchants, with their stalls and all accessed from a local LNbits instance, just by adding their pubkeys.

When you get an order, you can see the details by clicking on the "Plus" sign for the order.

If applicable, you can set as shipped when shipping is processed.

You also have a Chat Box to chat with customer and all these messages are done over NOSTR protocol, privately and encrypted.


AS A CUSTOMER

LNbits also provides a Nostr Market client app.

You can share with your customers the client URL from the merchant dashboard by clicking on the "Market client" link or by visiting https://your-LNbits-instance-URL/nostrmarket/market.

Or they can visit https://market.nostr.com/ for example and just add your Stall pubkey. Or even using the search box and put one of your specific tags.

If they already have a LNbits instance installed, they can even access it from a local URL like http://127.0.0.1/nostrmarket/market and adding the stall pubkey.

HAPPY DECENTRALIZED SHOPPING OVER NOSTR WITH BTC/LN!