• Stars
    star
    131
  • Rank 275,798 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Nostr Market

Nostr Market (NIP-15) - LNbits extension

For more about LNBits extension check this tutorial.

Demo at Nostrica here.

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

  • before you continue, please make sure that nostrclient extension is installed, activated and correctly configured.
  • nostrclient is usually installed as admin-only extension, so if you do not have admin access please ask an admin to confirm that nostrclient is OK.
  • see the Troubleshoot section for more details on how to check the health of nostrclient extension

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

  • Give your shipping zone a name
  • Select to which countries does this Shipping zone applies to (you can set a "Free" zone for digital goods)
  • Select the unit of account. If your will list products in EUR, the shipping zone must be in the same currency
  • Select the cost to ship

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

  • Give your stall/shop a name
  • An optional description (this can be used by client to search shops)
  • Select which wallet to use for this shop
  • Select the unit
  • select a Shipping Zone (multiple zones can be selected)

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

  • The product name
  • Give it a description
  • Add some categories (this can be used by clients to search for products)
  • Supply an URL for your product image (you can upload an image but it's recommended that the images are hosted outside of LNbits)
  • A price for the product, in the currency selected for the shop (this will be converted to sats when a customer buys)
  • The quantity you have in stock, for the product. This will update when orders are made/paid

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

  • Ordered products
  • The order ID
  • Customer's shipping address
  • Customer's public key
  • Invoice ID

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:

  • Add a name to the Marketplace
  • Add a small description
  • Add a logo image URL
  • Add a banner image URL (max height: 250px)
  • Choose a theme

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:

nostrmarket_chat_test.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.

nostrmarket-restart-and-republish.mp4

Check Nostrclient extension

  • see the Troubleshoot section for more details on how to check the health of 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.

More Repositories

1

lnbits

LNbits, free and open-source Lightning wallet and accounts system.
Python
1,027
star
2

nostr-signing-device

Signing device for Nostr
C
123
star
3

hardware-wallet

Use a world of microcontrollers to contruct your own bitcoin hardware wallet
C
68
star
4

lnurl

LNURL implementation for Python.
Python
64
star
5

nostrmesh

microcontroller mesh
54
star
6

arduino-nostr

C++
51
star
7

horse

hardware remote nostr event signer with webserial
JavaScript
37
star
8

Diagon-Alley

Diagon Alley: a decentralised market-stall protocol.
36
star
9

nostrrelay

One click nostr relay
Python
32
star
10

infinity

A multipurpose extensible web Lightning wallet provider and framework
Go
30
star
11

nostrclient

Python
22
star
12

lnbits-extensions

Registry for vetted LNbits extensions
JavaScript
21
star
13

gerty-hardware

A low power eink display that pairs with LNbits
C
20
star
14

nostr-zap-lamp

Get a visual Zap! when someone zaps your or anyone on Nostr.
C++
15
star
15

boltcards

Bolt Cards (NXP NTAG424) - LNbits extension
Python
14
star
16

tpos

Secure, mobile-ready, instant and shareable point of sale
HTML
14
star
17

splitpayments

Python
13
star
18

woocommerce-payment-gateway

Woocommerce Payment Gateway
PHP
12
star
19

legend-regtest-enviroment

Easy docker LNbits regtest enviroment
Shell
12
star
20

bolt11

Lightning BOLT11 implementation for Python.
Python
11
star
21

nostr.org

Home of nostr.org, proudly supported by LNbits
HTML
11
star
22

relampago

Abstraction over multiple Lightning backends.
Go
10
star
23

nostr-market-app

Nostr Marketplace App
JavaScript
10
star
24

cashu

Python
9
star
25

satspay

Create onchain and LN charges
Python
8
star
26

lnurlp

Python
8
star
27

gerty

Gerty bitcoin assistant
Python
6
star
28

withdraw

LNbits Withdraw Extension
Python
5
star
29

lnurldevice

For offline and online LNURL devices
Python
5
star
30

market

market extension, inspired by nostrmarket
HTML
4
star
31

scrub

Python
4
star
32

jukebox

Spotify jukebox middleware
HTML
3
star
33

usermanager

Generate users and wallets
HTML
3
star
34

paywall

HTML
3
star
35

jitsi

Host a Jitsi meeting with a chatBot that allows participants to send funds to each other.
JavaScript
3
star
36

free-lnaddress-extension

Give out free lnaddress
Python
3
star
37

tipjar

Accept Bitcoin donations, with messages attached!
HTML
3
star
38

discordbot

Python
3
star
39

myextension

Python
3
star
40

lnaddress

Sell LN addresses for your domain
HTML
3
star
41

lndhub

Access lnbits from BlueWallet or Zeus
Python
3
star
42

wp-donate-lnbits

PHP
2
star
43

example

Extension building guide
HTML
2
star
44

ngrok

Python
2
star
45

tpos-receipt-printer

An ESP32 controlled thermal printer solution to print payment receipts as payments are made to the LNbits TPoS extension.
C++
2
star
46

nostr-iot-device

C
2
star
47

nostrnip5

HTML
2
star
48

events

Sell and register event tickets
HTML
2
star
49

LNbits-on-Phoenixd

Run LNbits on Pheonixd
2
star
50

sdk

LNbits SDK
2
star
51

bitcoinswitch-extension

LNBits Extensions for the bitcoin switch
Python
2
star
52

my.lnbits.com

LNbits SaaS Frontend
Vue
2
star
53

invoices

HTML
1
star
54

satsdice

LNURL Satoshi dice
HTML
1
star
55

smtp

LNbits - SMTP Extension
HTML
1
star
56

pegging

Kollider powered stable wallets
Python
1
star
57

bleskomat

Python
1
star
58

compliance

Whalebooks supported overview and advice on bitcoin compliance
HTML
1
star
59

SatoshiGO

PokemonGO like game but with user places sats
Python
1
star
60

lnbits-jmeter

LNbits JMeter Testsuite
1
star
61

lnbits.github.io

Simple splash page for LNbits.com
HTML
1
star
62

lncalendar

A paid scheduling extension for LNBits that lets you schedule blocks of time on your calendar and get paid in Bitcoin.
HTML
1
star
63

watchonly

JavaScript
1
star
64

boltz

Python
1
star
65

lnticket

Have users pay sats for support questions
HTML
1
star
66

strike

Strike extension
Python
1
star