diff options
| author | Pablo Fernandez <p@f7z.io> | 2023-11-23 15:46:37 +0000 |
|---|---|---|
| committer | Pablo Fernandez <p@f7z.io> | 2023-11-23 15:46:37 +0000 |
| commit | 81480824adca735c8e5eb31646dacd48673fc814 (patch) | |
| tree | ae1c8ed1feb79121d8474757300b152269a18d31 | |
| parent | 470d656f984417e9068c12d88d662e44cf464cdf (diff) | |
move tier description to NIP-33 event and add 7002 as unsubscribe event
| -rw-r--r-- | 88.md | 30 |
1 files changed, 23 insertions, 7 deletions
| @@ -13,11 +13,13 @@ A pubkey can create "tiers". These tiers might provide certain benefits to the s | |||
| 13 | 13 | ||
| 14 | ```json | 14 | ```json |
| 15 | { | 15 | { |
| 16 | "kind": 7002, | 16 | "kind": 37001, |
| 17 | "content": "<description of the tier>", | 17 | "content": "<description of the tier>", |
| 18 | "tags": [ | 18 | "tags": [ |
| 19 | [ "title", "..." ], | 19 | [ "title", "..." ], |
| 20 | [ "amount", "<amount-in-base-unit>", "currency", "<cadence>" ] | 20 | [ "image", "..." ], |
| 21 | [ "amount", "<amount-in-base-unit>", "currency", "<monthly>" ], | ||
| 22 | [ "amount", "<amount-in-base-unit>", "currency", "<quarterly>" ] | ||
| 21 | ] | 23 | ] |
| 22 | } | 24 | } |
| 23 | ``` | 25 | ``` |
| @@ -26,6 +28,7 @@ This event is generated by a pubkey who wants to allow users to support with dif | |||
| 26 | 28 | ||
| 27 | `.content` SHOULD be a description of what users who subscribe can expect. | 29 | `.content` SHOULD be a description of what users who subscribe can expect. |
| 28 | Tag `title` is an optional title for the tier. | 30 | Tag `title` is an optional title for the tier. |
| 31 | Tag `image` is an optional image for the tier. | ||
| 29 | Tag `amount` MUST specify the payment required for this tier and its cadence. | 32 | Tag `amount` MUST specify the payment required for this tier and its cadence. |
| 30 | * The first argument should be the stringified amount and the second argument the currency | 33 | * The first argument should be the stringified amount and the second argument the currency |
| 31 | * The third argument SHOULD be one of `daily`, `monthly`, `yearly` | 34 | * The third argument SHOULD be one of `daily`, `monthly`, `yearly` |
| @@ -43,7 +46,8 @@ One or more `amount` tags MUST exist. | |||
| 43 | "content": "<optional-message>", | 46 | "content": "<optional-message>", |
| 44 | "tags": [ | 47 | "tags": [ |
| 45 | [ "p", "<recipient-pubkey>" ], | 48 | [ "p", "<recipient-pubkey>" ], |
| 46 | [ "e", "<supporting-tier-id>" ], | 49 | [ "a", "<supporting-tier-event-id>" ], |
| 50 | [ "event", "<stringied-event-subscribed-to>" ], | ||
| 47 | [ "amount", "<amount-in-base-unit>", "currency", "<cadence>" ] | 51 | [ "amount", "<amount-in-base-unit>", "currency", "<cadence>" ] |
| 48 | ] | 52 | ] |
| 49 | } | 53 | } |
| @@ -53,13 +57,14 @@ When a user wants to subscribe to support a user they create a `kind:7001` event | |||
| 53 | 57 | ||
| 54 | * `.content` is an optional message the supporter can write. | 58 | * `.content` is an optional message the supporter can write. |
| 55 | * The `p` tag MUST tag the pubkey being supported. | 59 | * The `p` tag MUST tag the pubkey being supported. |
| 56 | * The `e` tag is optional, and should point to a `kind:7001` support tier event. There MUST be exactly 0 or 1 `e` tags. | 60 | * The `a` tag is optional; it should point to a `kind:37001` support tier event. There MUST be exactly 0 or 1 `a` tag. |
| 57 | * The `amount` tag specifies what the supporters is committing to pay to the supported pubkey and the candence. | 61 | * The `event` tag is optional; subscribers can opt to keep the version of the event they subscribed to. There MUST be exactly 0 or 1 `event` tag. |
| 62 | * The `amount` tag specifies what the supporters is committing to pay to the supported pubkey and the candence. MUST be equal to one of the amounts specified in the `kind:37001` event. There MUST be exactly 1 `amount` tag. | ||
| 58 | 63 | ||
| 59 | The `kind:7001` event can be created without an `e` tag so that users can create recurring support events without the pubkey receiving the support having explicitly created a support tier. | 64 | The `kind:7001` event can be created without an `e` tag so that users can create recurring support events without the pubkey receiving the support having explicitly created a support tier. |
| 60 | 65 | ||
| 61 | ## Paying | 66 | ## Paying |
| 62 | The supporting user should create a zap p-tagging the receiver and e-tagging the `kind:7001`. There MUST be a single `p` and a single `e` tag in the zap request. | 67 | The supporting user should create a zap `p`-tagging the receiver and e-tagging the `kind:7001`. There MUST be a single `p` and a single `e` tag in the zap request. |
| 63 | 68 | ||
| 64 | ```json | 69 | ```json |
| 65 | { | 70 | { |
| @@ -84,4 +89,15 @@ The following conditions must be met to verify a payment: | |||
| 84 | * Validations specified in [NIP-57](https://github.com/nostr-protocol/nips/blob/master/57.md). | 89 | * Validations specified in [NIP-57](https://github.com/nostr-protocol/nips/blob/master/57.md). |
| 85 | 90 | ||
| 86 | ## Stopping a subscription | 91 | ## Stopping a subscription |
| 87 | A user who wants to stop a subscription by publishing a `kind:5` deletion request of the `kind:7001` event. | 92 | A user who wants to signal they are no longer subscribed can publish a `kind:7002` event tagging the `kind:7001` they are stopping and `p`-tagging the pubkey they are no longer subscribed to. |
| 93 | |||
| 94 | ```json | ||
| 95 | { | ||
| 96 | "kind": 7002, | ||
| 97 | "content": "<optional-message>", | ||
| 98 | "tags": [ | ||
| 99 | [ "p", "<recipient-pubkey>" ], | ||
| 100 | [ "e", "<kind-7001-event-id>" ], | ||
| 101 | ] | ||
| 102 | } | ||
| 103 | ``` \ No newline at end of file | ||