Home

Awesome

Nostr Market (NIP-15) - <small>LNbits extension</small>

<small>For more about LNBits extension check this tutorial.</small>

Demo at Nostrica <a href="https://www.youtube.com/live/2NueacYJovA?feature=share&t=6846">here</a>.

Original protocol for Diagon Alley (resilient marketplaces)

The concepts around resilience in Diagon Alley helped influence the creation of the NOSTR protocol, now we get to build Diagon Alley on NOSTR!

Prerequisites

This extension uses the LNbits nostrclient extension, an extension that makes nostrfying other extensions easy. image

Create, or import, a merchant account

As a merchant you need to provide a Nostr key pair, or the extension can generate one for you. create keys

Once you have a merchant "account", you can view the details on the merchant dropdown merchant dropdown

Create a Stall, or shop

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

Let's create the stall Click on New Stall button and fill the necessary fields Create stall Stall dialog

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

Fill the necessary fields on the dialog

product dialog

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

Create, update or delete products in Products tab products tab

And check your orders on the Orders tab

orders tab

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

order details

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

You also have a Chat Box to chat with customer

chat box

Diagon Alley Clients

LNbits also provides a Nostr Market client app. You can visit the client from the merchant dashboard by clicking on the "Market client" link market client link

or by visiting https://<LNbits instance URL>/nostrmarket/market

Make sure to add your merchant public key to the list: image

Styling

In order to create a customized Marketplace, we use naddr as defined in NIP-19. You must create an event (kind: 30019) that has all the custom properties, including merchants and relays, of your marketplace. Start by going to the marketplace page: vanilla market

You'll need to Login, and head over to Marketplace Info. Optionally import some merchants and relays, that will be included in the event. Click on Edit and fill out your marketplace custom info: edit

Fill in the optional fields:

By clicking Publish, a kind: 30019 event will be sent to the defined relays containing all the information about your custom Marketplace. On the left drawer, a button with Copy Naddr will show up. copy naddr

You can then share your Marketplace, with the merchants and relays, banner, and style by using that Nostr identifier. The URL for the marketplace will be for example: https://legend.lnbits.com/nostrmarket/market?naddr=naddr1qqfy6ctjddjhgurvv93k...., you need to include the URL parameter naddr=<your naddr>. When a user visits that URL, the client will get the 30019 event and configure the Marketplace to what you defined. In the example bellow, a couple of merchants, relays, autumn theme, name (Veggies Market) and a header banner: final

The nostr event is a replaceable event, so you can change it to what you like and publish a new one to replace a previous one. For example adding a new merchant, or remove, change theme, add more relays,e tc...

Troubleshoot

Check communication with Nostr

In order to test that the integration with Nostr is working fine, one can add an npub to the chat box and check that DMs are working as expected:

https://user-images.githubusercontent.com/2951406/236777983-259f81d8-136f-48b3-bb73-80749819b5f9.mov

Restart connection to Nostr

If the communication with Nostr is not working then an admin user can Restart the Nostr connection.

Merchants can afterwards re-publish their products.

https://user-images.githubusercontent.com/2951406/236778651-7ada9f6d-07a1-491c-ac9c-55530326c32a.mp4

Check Nostrclient extension

Aditional info

Stall and product are Parameterized Replaceable Events according to NIP-33 and use kind 30017 and 30018 respectivelly. See NIP-15 for more details.

Order placing, invoicing, payment details and order statuses are handled over Nostr using NIP-04.

Customer support is handled over whatever communication method was specified. If communicationg via nostr, NIP-04 is used.