mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-13 23:39:08 -05:00
Changed g tag to e tag
This commit is contained in:
parent
cab55281f3
commit
67d4b261e6
12
108.md
12
108.md
|
@ -9,8 +9,8 @@ Lightning Gated Notes
|
|||
This NIP defines three events for gating Notes behind lightning paywalls:
|
||||
|
||||
- Lightning-Gated Note ( `kind:55` ): This note allows you wrap any type of note behind a lightning gated paywall by encrypting the payload with a purchasable decrypt key.
|
||||
- Key Note ( `kind:56` ): This note encrypts the key for a given note, per user, using [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) between the corresponding gate creator's public key and the purchasers. It is linked to the gated note with the `g` tag.
|
||||
- Announcement Note ( `kind:54` ): This note acts as the announcement of the gated note, giving a short preview of the content. It is linked to the gated note with the `g` tag.
|
||||
- Key Note ( `kind:56` ): This note encrypts the key for a given note, per user, using [NIP-04](https://github.com/nostr-protocol/nips/blob/master/04.md) between the corresponding gate creator's public key and the purchasers. It is linked to the gated note with the `e` tag.
|
||||
- Announcement Note ( `kind:54` ): This note acts as the announcement of the gated note, giving a short preview of the content. It is linked to the gated note with the `e` tag.
|
||||
|
||||
A complete open-source implantation of [NIP-108 is available](https://github.com/project-excalibur/Nostr-Playground/tree/main/apps/nip108).
|
||||
|
||||
|
@ -22,11 +22,11 @@ An example client can be found at [Nostr Playground](https://nip-108.nostrplaygr
|
|||
2. Poster `JSON.stringify`s the whole note.
|
||||
3. Poster encrypts the note string with a new nsec `secret`, and `iv` using `aes-256-cbc`.
|
||||
4. Poster creates the gated note `kind:55` with the encrypted note json string in the `content` field, while putting `iv`, `cost` (mSats), and `endpoint` as tags. The `endpoint` tag is the server endpoint you use to hold your `secret`'s and issue lightning invoices from your `lud16`.
|
||||
5. Poster then creates an announcement note `kind:54` with the `g` tag (gated note's id) to preview the gated content.
|
||||
5. Poster then creates an announcement note `kind:54` with the `e` tag (gated note's id) to preview the gated content.
|
||||
|
||||
### Consuming Gated Notes
|
||||
1. Client finds gated content they want to purchase by browsing `kind:54` announcement notes.
|
||||
2. Client loads the associated gated note of `kind:55` found in the `g` tag
|
||||
2. Client loads the associated gated note of `kind:55` found in the `e` tag
|
||||
3. Client then GETs the `[endpoint]/[id]`
|
||||
4. Gate server will respond with a 402 PR requesting a payment for the `cost` tag's amount in mSats
|
||||
5. Client pays the amount
|
||||
|
@ -107,7 +107,7 @@ APP.get("/:noteId/:paymentHash")
|
|||
|
||||
`.tag` MUST include the following:
|
||||
|
||||
- `g`, the id of the gated event.
|
||||
- `e`, the id of the gated event.
|
||||
|
||||
### Key Note ( Kind:56 )
|
||||
|
||||
|
@ -117,7 +117,7 @@ APP.get("/:noteId/:paymentHash")
|
|||
|
||||
`.tag` MUST include the following:
|
||||
|
||||
- `g`, the id of the gated event.
|
||||
- `e`, the id of the gated event.
|
||||
|
||||
### Encryption/Decryption
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user