Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sovbiz patch 1 #1703

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Sovbiz patch 1 #1703

wants to merge 2 commits into from

Conversation

sovbiz
Copy link

@sovbiz sovbiz commented Jan 20, 2025

No description provided.

gzuuus and others added 2 commits December 4, 2024 12:08
General Updates from our call containing a overview to the other parts of the process (payment, shipping order communication, general checkout procedure)

Small outline for the Payment flow
@vitorpamplona
Copy link
Collaborator

It shouldn't use kind 14 directly. It should use a new kind just for for this. We already have kind 15 for images on DMs, so orders could be 16, maybe?

@amunrarara
Copy link

Cheers @vitorpamplona ,

There's been a larger thread happening over on a fork, if you're interested in reading: https://github.com/gzuuus/nips/blob/7d59ffe1e81bb0bedd64752f34298118c6e57ce6/XX.md

I'm curious about kind 15. That's the kind used for a NIP-17 rumor that includes an image? What's the thinkin' there with using a specific kind for "message that includes an image". Are there other specific kinds for different message types? I don't see 'em on the NIP-17 spec.

@vitorpamplona
Copy link
Collaborator

PR is here for kind 15: #1537 This kind has been used by 0xchat of over a year now and we just integrated into Amethyst.

The key part is that most chat clients will never implement orders (or images). So, keeping the kinds separate helps them make sure they can ignore a message instead of just showing an empty or unreadable message to the user.

@vitorpamplona
Copy link
Collaborator

vitorpamplona commented Jan 20, 2025

The other way to do this is to keep everything you need to run in the content and the tags are just extra information. For instance, on 2, you can do something like:

{
  "kind": 14,
  "tags": [
    ["p", "<buyer-pubkey>"],
    ["subject", "order-payment"],
    ["order", "<order-id>"],
    ["amount", "<total-amount>", "<currency>"],
    ["payment", "lightning", "<bolt11-invoice>"],
    ["payment", "bitcoin", "<btc-address>"],
    ["expiry", "<unix-timestamp>"]
  ],
  "content": "Your order <order-id> with items <item1, item2, item3> has been received. 
Your total is <amount>. Please pay lightning:<bolt11-invoice - same as in the tag> 
or send XXX BTC to <btc-address - same as in the tag> to complete the transaction. 
This offer expires in <expiry>."
}

In this case, the app doesn't need to support any of the tags to show the information to the user. And the user can pay the invoice externally if needed. The tags just help the app offer additional information.

@vitorpamplona
Copy link
Collaborator

To me, it is either kind 14 with the complete description in ".content" for humans and all tags helpful but optional to understanding the message OR a new kind if you require clients to parse the tags to make sense of the message and help the user go through the order.

}
```

### Product Draft (Kind: 30403)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for a new kind here you can just use: https://github.com/nostr-protocol/nips/blob/master/37.md

"kind": 14,
"tags": [
["p", "<merchant-pubkey>"],
["subject", "order-info"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subject is displayed as a title of the message, like the subject of an email. If "order-info" is a code that might not be human friendly, it might be better to choose a better tag name.

["order", "<order-id>"],
["item", "<product-id>", "<quantity>"],
["item", "<product-id>", "<quantity>"], // Multiple items possible
["shipping", "<shipping-option-id>"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a standard on how to write this shipping info.

"content": "Payment details provided by merchant's payment server."
}
```
4. Payment Receipt (buyer → merchant) (subject "order-receipt")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't receipts be a kind on its own? This is the only message that is not a "temporary" update. I can forsee users wanting to see a list of all of their purchases. It would be nice to have a separate kind so that there is no need to parse all DMs to find all receipts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants