Giter Club home page Giter Club logo

nips's People

Contributors

0xtlt avatar alexgleason avatar arthurfranca avatar asaitoshiya avatar benthecarman avatar brugeman avatar cameri avatar dzdidi avatar erskingardner avatar fiatjaf avatar frbitten avatar giszmo avatar git-sgmoore avatar gzuuus avatar jb55 avatar jeffthibault avatar jiftechnify avatar ktecho avatar mariano-perez-rodriguez avatar mattn avatar mikedilger avatar monlovesmango avatar pablof7z avatar semisol avatar sethforprivacy avatar sistemd avatar staab avatar unclebob avatar v0l avatar vitorpamplona avatar

nips's Issues

Lightning Superchat in NIP28

NIP-??

Lightning Superchat

draft optional author: cjchua

  • Lightning Superchat is akin to superchats on Youtube Livestreams, but done via lightning.
  • This activity(Lightning Superchat) requires a service provider that actively manages the list of superchats and lightning payment requests.
  • This NIP is designed to build off of NIP28.

Introducing 3 special events:

  1. superchat service request: kind 1111 regular event with p tag referencing service provider, e tag referencing a kind40 channel. Clients register for a superchat service using this event.
{
  "kind": 1111,
  "pubkey": <kind40_creator>
  "tags": [
        ["p", <service_provider>, <relay_url>],
        ["e", <kind40_event_id>, <relay_url>],
    ],
}
  1. superchats: kind 33333 parameterized replaceable event with d tag referencing the channel requesting the service. This event contains a dynamic list of active superchats.
{
  "kind": 33333,
  "pubkey": <service_provider>,
  "tags": [
        ["d", <kind40_event_id>],
        ["superchat", <amount_sat>, <created_timestamp>, <user_pubkey>, <content>],  // example
        ["superchat", "50", "1678443555", "bfd121a3.....4f063e7", "this is a superchat"],
    ],
}
  1. An ephemeral event used for communication between the service provider and users. Below outlines the only 2 possible scenarios (for now)
    a. superchat request: kind 22222 event with a tag referencing superchats
    b. payment request: kind 22222 event with a tag referencing superchats and p tag referencing user
// Scenario 1: User making a `superchat request`
{
 "kind": 22222,
 "pubkey": <user>,
 "content": <amount_sat>,
 "tags": [
       ["a", "33333:<service_provider>:<kind40_event_id>", <relay_url>],
   ],
}
// Scenario 2: Service provider providing a `payment request`
{
  "kind": 22222,
  "pubkey": <service_provider>,
  "content": "optional comment",
  "tags": [
        ["a", "33333:<service_provider>:<kind40_event_id>", <relay_url>],
        ["p", <user>, <relay_url>],
        ["bolt11", "lnbc...."],
    ],
}

Implementation Guideline:

a. Service Provider

  • Subscribe to superchat service request. Validate the provided kind40 event and that the requester is the channel creator
  • Publish superchats and subscribe to superchat request
  • Handle superchat request by replying with a payment request
  • Once payment request is paid, update and publish superchats
  • Service Provider could update superchats at will

b. Client

  • Subscribe to superchats and display to the user. There may be more than one service provider offering this service. It is the client's prerogative to either default to a service provider, or provide more flexibility by allowing users to pick a service provider
  • Send superchat request on user's request
  • Handle payment request by presenting the bolt11 to the user

Notes:

  1. Upon payment, service provider could publish a regular event that acts as a receipt for both the room creator and users. Clients could also use it as a signal that payment has been made and handle the UI accordingly. Excluded for now in favor of simplicity
  2. Why not use Zaps? Avoiding the complexity of implementing a lnurl server and nip57/58
  3. There is the problem of service provider discovery not addressed in this NIP. Hopefully this NIP will get the conversation around it going

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.