diff options
| author | Pablo Fernandez <p@f7z.io> | 2023-11-05 13:14:43 +0200 |
|---|---|---|
| committer | Pablo Fernandez <p@f7z.io> | 2023-11-05 13:14:43 +0200 |
| commit | 7ad40d5159a806f2ae97bdbb2fc2a8bbb6fa89a2 (patch) | |
| tree | d1b94dd3a4587311bee62c89ef0557275703d40b /88.md | |
| parent | 08d3eff350d11657160eca78459da34d9254252b (diff) | |
Recurring Subscriptionspatron
Diffstat (limited to '88.md')
| -rw-r--r-- | 88.md | 79 |
1 files changed, 79 insertions, 0 deletions
| @@ -0,0 +1,79 @@ | |||
| 1 | NIP-88 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Recurring Subscriptions | ||
| 5 | ----------------------- | ||
| 6 | |||
| 7 | `draft` `optional` `author:pablof7z` | ||
| 8 | |||
| 9 | This NIP defines a way for a pubkey to create recurring subscription payments to another pubkey. | ||
| 10 | |||
| 11 | ## Tier Event | ||
| 12 | A pubkey can create "tiers". These tiers might provide certain benefits to the supporters who subscribe to these. | ||
| 13 | |||
| 14 | ```json | ||
| 15 | { | ||
| 16 | "kind": 7002, | ||
| 17 | "content": "<description of the tier>", | ||
| 18 | "tags": [ | ||
| 19 | [ "title", "..." ], | ||
| 20 | [ "amount", "<amount-in-base-unit>", "currency", "<cadence>" ] | ||
| 21 | ] | ||
| 22 | } | ||
| 23 | ``` | ||
| 24 | |||
| 25 | This event is generated by a pubkey who wants to allow users to support with different tiers. | ||
| 26 | |||
| 27 | `.content` SHOULD be a description of what users who subscribe can expect. | ||
| 28 | Tag `title` is an optional title for the tier. | ||
| 29 | 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 | ||
| 31 | * The third argument SHOULD be one of `daily`, `monthly`, `yearly` | ||
| 32 | One or more `amount` tags MUST exist. | ||
| 33 | |||
| 34 | #### Examples | ||
| 35 | * `[ "amount", "100", "usd", "daily" ]`, $1.00 a day. | ||
| 36 | * `[ "amount", "1000000", "btc", "daily" ]`, 1000000 millisats a day. | ||
| 37 | |||
| 38 | ## Subscribe Event | ||
| 39 | |||
| 40 | ```json | ||
| 41 | { | ||
| 42 | "kind": 7001, | ||
| 43 | "content": "<optional-message>", | ||
| 44 | "tags": [ | ||
| 45 | [ "p", "<recipient-pubkey>" ], | ||
| 46 | [ "e", "<supporting-tier-id>" ], | ||
| 47 | [ "amount", "<amount-in-base-unit>", "currency", "<cadence>" ] | ||
| 48 | ] | ||
| 49 | } | ||
| 50 | ``` | ||
| 51 | |||
| 52 | When a user wants to subscribe to subscribe to support a user they create a `kind:7001` event. | ||
| 53 | |||
| 54 | * `.content` is an optional message the supporter can write. | ||
| 55 | * 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. | ||
| 57 | * The `amount` tag specifies what the supporters is committing to pay to the supported pubkey and the candence. | ||
| 58 | |||
| 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. | ||
| 60 | |||
| 61 | ## 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. | ||
| 63 | |||
| 64 | ```json | ||
| 65 | { | ||
| 66 | "kind": 9734, | ||
| 67 | "content": "", | ||
| 68 | "tags": [ | ||
| 69 | [ "p", "<recipient-pubkey>" ], | ||
| 70 | [ "e", "<kind-7001-event-id>" ] | ||
| 71 | ] | ||
| 72 | ``` | ||
| 73 | |||
| 74 | Clients supporting this NIP can check for zaps e-tagging the `kind:7001` event to find the pubkeys that have a valid, paid subscriptions at each different period. | ||
| 75 | |||
| 76 | The same `kind:7001` is re-zapped on a regular basis per the cadence specified in the event. | ||
| 77 | |||
| 78 | ## Stopping a subscription | ||
| 79 | A user who wants to stop a subscription by publishing a `kind:5` deletion request of the `kind:7001` event. | ||