From 244e733637aae7d180a68fa7f130f96e677d2d76 Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Sat, 10 Aug 2024 01:11:10 -0700 Subject: [PATCH 1/7] NIP-15-Use-Nip-17.md Replaced NIP-04 (deprecated) with NIP-17: Private Direct Messages --- 15.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/15.md b/15.md index 6daa8019..89e4251a 100644 --- a/15.md +++ b/15.md @@ -139,7 +139,7 @@ Fields that are not self-explanatory: ## Checkout events -All checkout events are sent as JSON strings using [NIP-04](04.md). +All checkout events are sent as JSON strings using [NIP-17](17.md). The `merchant` and the `customer` can exchange JSON messages that represent different actions. Each `JSON` message `MUST` have a `type` field indicating the what the JSON represents. Possible types: @@ -150,7 +150,7 @@ The `merchant` and the `customer` can exchange JSON messages that represent diff | 2 | Merchant | Order Status Update | ### Step 1: `customer` order (event) -The below JSON goes in content of [NIP-04](04.md). +The below JSON goes in content of [NIP-17](17.md). ```json { @@ -182,7 +182,7 @@ _Open_: is `contact.nostr` required? Sent back from the merchant for payment. Any payment option is valid that the merchant can check. -The below JSON goes in `content` of [NIP-04](04.md). +The below JSON goes in `content` of [NIP-17](17.md). `payment_options`/`type` include: @@ -217,7 +217,7 @@ The below JSON goes in `content` of [NIP-04](04.md). Once payment has been received and processed. -The below JSON goes in `content` of [NIP-04](04.md). +The below JSON goes in `content` of [NIP-17](17.md). ```json { @@ -331,7 +331,7 @@ Another thing that can happen is - if bids happen very close to the end date of ## Customer support events -Customer support is handled over whatever communication method was specified. If communicating via nostr, [NIP-04](04.md) is used. +Customer support is handled over whatever communication method was specified. If communicating via nostr, [NIP-17](17.md) is used. ## Additional From 8aa5f22d162dcec79a3906509ea7ad416e0b6375 Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Sat, 24 Aug 2024 23:39:24 -0700 Subject: [PATCH 2/7] WIP Update 15.md --- 15.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/15.md b/15.md index 89e4251a..fc78df3b 100644 --- a/15.md +++ b/15.md @@ -38,7 +38,11 @@ A merchant can publish these events: | `0` | `set_meta` | The merchant description (similar with any `nostr` public key). | | `30017` | `set_stall` | Create or update a stall. | | `30018` | `set_product` | Create or update a product. | -| `4` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | +| `30019` | `submit_order` | Customer submits order to merchant for product. | +| `30020` | `request_payment` | Merchant requests payment for order from customer. | +| `30021` | `confirm_payment` | Merchant confirms payment is received for order. | +| `30022` | `confirm_shipment` | Merchant confirms order has been shipped. | +| `14` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | | `5` | `delete` | Delete a product or a stall. | ### Event `30017`: Create or update a stall. From e5f1b3f5db98f9fb7c561dd109fbfa3a574e4533 Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Sat, 24 Aug 2024 23:54:28 -0700 Subject: [PATCH 3/7] Update 15.md --- 15.md | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/15.md b/15.md index fc78df3b..11a90f8d 100644 --- a/15.md +++ b/15.md @@ -1,5 +1,5 @@ -NIP-15 ====== +NIP-15 Nostr Marketplace ----------------- @@ -36,14 +36,18 @@ A merchant can publish these events: | Kind | | Description | | --------- | ------------------ | --------------------------------------------------------------------------------------------------------------- | | `0` | `set_meta` | The merchant description (similar with any `nostr` public key). | +| `5` | `delete` | Delete a product or a stall. | +| `14` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | +| `1021` | `bid` | Customer places bid on auctioned product. | +| `1022` | `bid_success` | Merchant accepts customer's bid for auctioned product. | | `30017` | `set_stall` | Create or update a stall. | | `30018` | `set_product` | Create or update a product. | -| `30019` | `submit_order` | Customer submits order to merchant for product. | -| `30020` | `request_payment` | Merchant requests payment for order from customer. | -| `30021` | `confirm_payment` | Merchant confirms payment is received for order. | -| `30022` | `confirm_shipment` | Merchant confirms order has been shipped. | -| `14` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | -| `5` | `delete` | Delete a product or a stall. | +| `30018` | `customize_market` | Save customizations for marketplace experience. | +| `30020` | `set_auction` | Create or update a product sold as an auction | +| `30030` | `request_payment` | Merchant requests payment for order from customer. | +| `30031` | `submit_order` | Customer submits order to merchant for product. | +| `30032` | `confirm_payment` | Merchant confirms payment is received for order. | +| `30033` | `confirm_shipment` | Merchant confirms order has been shipped. | ### Event `30017`: Create or update a stall. @@ -153,8 +157,9 @@ The `merchant` and the `customer` can exchange JSON messages that represent diff | 1 | Merchant | Payment Request | | 2 | Merchant | Order Status Update | -### Step 1: `customer` order (event) -The below JSON goes in content of [NIP-17](17.md). +### Event `30030` - Step 1: `customer` order + +The below JSON goes in content of a kind: `30019` event. ```json { @@ -182,11 +187,11 @@ The below JSON goes in content of [NIP-17](17.md). _Open_: is `contact.nostr` required? -### Step 2: `merchant` request payment (event) +### Event `30031` - Step 2: `merchant` request payment Sent back from the merchant for payment. Any payment option is valid that the merchant can check. -The below JSON goes in `content` of [NIP-17](17.md). +The below JSON goes in `content` of a kind: `30020` event. `payment_options`/`type` include: @@ -217,11 +222,27 @@ The below JSON goes in `content` of [NIP-17](17.md). } ``` -### Step 3: `merchant` verify payment/shipped (event) +### Event `30032` - Step 3: `merchant` confirms payment is accepted Once payment has been received and processed. -The below JSON goes in `content` of [NIP-17](17.md). +The below JSON goes in `content` of a kind: `30021` event. + +```json +{ + "id": , + "type": 2, + "message": , + "paid": , + "shipped": , +} + +``` +### Event `30033` - Step 4: `merchant` confirms order has shipped + +Once order has been shipped. + +The below JSON goes in `content` of a kind: `30021` event. ```json { From 6c16f8e2c9e194cea3bdaa3608dd137f6936e19d Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Sun, 25 Aug 2024 00:07:09 -0700 Subject: [PATCH 4/7] Update 15.md --- 15.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/15.md b/15.md index 11a90f8d..2d62db86 100644 --- a/15.md +++ b/15.md @@ -147,7 +147,7 @@ Fields that are not self-explanatory: ## Checkout events -All checkout events are sent as JSON strings using [NIP-17](17.md). +All checkout events are signed then sent as [NIP-17](17.md) Private Direct Messages between `customer` and `merchant`. Every checkout event contains the event's details as JSON in the `content` field. The `merchant` and the `customer` can exchange JSON messages that represent different actions. Each `JSON` message `MUST` have a `type` field indicating the what the JSON represents. Possible types: @@ -159,7 +159,7 @@ The `merchant` and the `customer` can exchange JSON messages that represent diff ### Event `30030` - Step 1: `customer` order -The below JSON goes in content of a kind: `30019` event. +The below JSON goes in `content` of a kind: `30019` event. The event is signed, then sent to `merchant` in a [NIP-17](17.md) Private Direct Message. ```json { @@ -189,9 +189,9 @@ _Open_: is `contact.nostr` required? ### Event `30031` - Step 2: `merchant` request payment -Sent back from the merchant for payment. Any payment option is valid that the merchant can check. +Sent from the `merchant` to the `customer` for payment. Any payment option is valid that the merchant can check. -The below JSON goes in `content` of a kind: `30020` event. +The below JSON goes in `content` of a kind: `30020` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. `payment_options`/`type` include: @@ -226,7 +226,7 @@ The below JSON goes in `content` of a kind: `30020` event. Once payment has been received and processed. -The below JSON goes in `content` of a kind: `30021` event. +The below JSON goes in `content` of a kind: `30021` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. ```json { @@ -242,7 +242,7 @@ The below JSON goes in `content` of a kind: `30021` event. Once order has been shipped. -The below JSON goes in `content` of a kind: `30021` event. +The below JSON goes in `content` of a kind: `30021` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. ```json { From 0d7914b145e619b57112ae92ceaba8c484067bda Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Sun, 25 Aug 2024 00:11:18 -0700 Subject: [PATCH 5/7] Update 15.md --- 15.md | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/15.md b/15.md index 2d62db86..4fc6ba80 100644 --- a/15.md +++ b/15.md @@ -10,6 +10,27 @@ Based on [Diagon-Alley](https://github.com/lnbits/Diagon-Alley). Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market). +## Kinds + +The following kinds are utilized by this NIP: + +| Kind | | Description | +| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------- | +| `0` | `set_meta` | The merchant description (similar with any `nostr` public key). | +| `5` | `delete` | Delete a product or a stall. | +| `14` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | +| `1021` | `bid` | Customer places bid on auctioned product. | +| `1022` | `bid_success` | Merchant accepts customer's bid for auctioned product. | +| `30017` | `set_stall` | Create or update a stall. | +| `30018` | `set_product` | Create or update a product. | +| `30018` | `customize_market` | Save customizations for marketplace experience. | +| `30020` | `set_auction` | Create or update a product sold as an auction | +| `30030` | `request_payment` | Merchant requests payment for order from customer. | +| `30031` | `submit_order` | Customer submits order to merchant for product. | +| `30032` | `confirm_payment` | Merchant confirms payment is received for order. | +| `30033` | `confirm_shipment` | Merchant confirms order has been shipped. | + + ## Terms - `merchant` - seller of products with NOSTR key-pair @@ -20,6 +41,16 @@ Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeia ## Nostr Marketplace Clients +### Customer Events + +A customer can publish these events: +| Kind | | Description | +| --------- | ------------------ | --------------------------------------------------------------------------------------------------------------- | +| `14` | `direct_message` | Communicate with the merchant. The messages can be plain-text or JSON. | +| `1021` | `bid` | Customer places bid on auctioned product. | +| `30018` | `customize_market` | Save customizations for marketplace experience. | +| `30031` | `submit_order` | Customer submits order to merchant for product. | + ### Merchant admin Where the `merchant` creates, updates and deletes `stalls` and `products`, as well as where they manage sales, payments and communication with `customers`. @@ -38,14 +69,11 @@ A merchant can publish these events: | `0` | `set_meta` | The merchant description (similar with any `nostr` public key). | | `5` | `delete` | Delete a product or a stall. | | `14` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | -| `1021` | `bid` | Customer places bid on auctioned product. | | `1022` | `bid_success` | Merchant accepts customer's bid for auctioned product. | | `30017` | `set_stall` | Create or update a stall. | | `30018` | `set_product` | Create or update a product. | -| `30018` | `customize_market` | Save customizations for marketplace experience. | | `30020` | `set_auction` | Create or update a product sold as an auction | | `30030` | `request_payment` | Merchant requests payment for order from customer. | -| `30031` | `submit_order` | Customer submits order to merchant for product. | | `30032` | `confirm_payment` | Merchant confirms payment is received for order. | | `30033` | `confirm_shipment` | Merchant confirms order has been shipped. | From 5bdc3b3718e30c35f8fb0e012c1f3fd38c533db1 Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Sun, 25 Aug 2024 00:14:24 -0700 Subject: [PATCH 6/7] Update 15.md --- 15.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/15.md b/15.md index 4fc6ba80..43c5dc22 100644 --- a/15.md +++ b/15.md @@ -187,7 +187,7 @@ The `merchant` and the `customer` can exchange JSON messages that represent diff ### Event `30030` - Step 1: `customer` order -The below JSON goes in `content` of a kind: `30019` event. The event is signed, then sent to `merchant` in a [NIP-17](17.md) Private Direct Message. +The below JSON goes in `content` of a kind: `30030` event. The event is signed, then sent to `merchant` in a [NIP-17](17.md) Private Direct Message. ```json { @@ -219,7 +219,7 @@ _Open_: is `contact.nostr` required? Sent from the `merchant` to the `customer` for payment. Any payment option is valid that the merchant can check. -The below JSON goes in `content` of a kind: `30020` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. +The below JSON goes in `content` of a kind: `30031` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. `payment_options`/`type` include: @@ -254,7 +254,7 @@ The below JSON goes in `content` of a kind: `30020` event. The event is signed, Once payment has been received and processed. -The below JSON goes in `content` of a kind: `30021` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. +The below JSON goes in `content` of a kind: `30032` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. ```json { @@ -270,7 +270,7 @@ The below JSON goes in `content` of a kind: `30021` event. The event is signed, Once order has been shipped. -The below JSON goes in `content` of a kind: `30021` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. +The below JSON goes in `content` of a kind: `30033` event. The event is signed, then sent to the `customer` in a [NIP-17](17.md) Private Direct Message. ```json { From 101dfd1c18db56a0604222243466e5844e1605c0 Mon Sep 17 00:00:00 2001 From: Acea Spades Date: Wed, 16 Oct 2024 08:53:41 -0700 Subject: [PATCH 7/7] Update 15.md --- 15.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/15.md b/15.md index 43c5dc22..621b5b41 100644 --- a/15.md +++ b/15.md @@ -25,8 +25,8 @@ The following kinds are utilized by this NIP: | `30018` | `set_product` | Create or update a product. | | `30018` | `customize_market` | Save customizations for marketplace experience. | | `30020` | `set_auction` | Create or update a product sold as an auction | -| `30030` | `request_payment` | Merchant requests payment for order from customer. | -| `30031` | `submit_order` | Customer submits order to merchant for product. | +| `30030` | `submit_order` | Customer submits order to merchant for product. | +| `30031` | `request_payment` | Merchant requests payment for order from customer. | | `30032` | `confirm_payment` | Merchant confirms payment is received for order. | | `30033` | `confirm_shipment` | Merchant confirms order has been shipped. | @@ -49,7 +49,7 @@ A customer can publish these events: | `14` | `direct_message` | Communicate with the merchant. The messages can be plain-text or JSON. | | `1021` | `bid` | Customer places bid on auctioned product. | | `30018` | `customize_market` | Save customizations for marketplace experience. | -| `30031` | `submit_order` | Customer submits order to merchant for product. | +| `30030` | `submit_order` | Customer submits order to merchant for product. | ### Merchant admin @@ -73,7 +73,7 @@ A merchant can publish these events: | `30017` | `set_stall` | Create or update a stall. | | `30018` | `set_product` | Create or update a product. | | `30020` | `set_auction` | Create or update a product sold as an auction | -| `30030` | `request_payment` | Merchant requests payment for order from customer. | +| `30031` | `request_payment` | Merchant requests payment for order from customer. | | `30032` | `confirm_payment` | Merchant confirms payment is received for order. | | `30033` | `confirm_shipment` | Merchant confirms order has been shipped. |