diff options
| author | Alejandro <bandarra+gith@protonmail.com> | 2023-09-01 15:07:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-01 15:07:52 +0200 |
| commit | 08bd050598e078179eea71cb9de777d887a9e9f8 (patch) | |
| tree | adca6cf96a0c33e776388be93f2bec2714a2caf9 /75.md | |
| parent | d784820309dba0447d6a0a351ad0230ba6c5c5fb (diff) | |
NIP-75: Zap Goals (#757)
Diffstat (limited to '75.md')
| -rw-r--r-- | 75.md | 76 |
1 files changed, 76 insertions, 0 deletions
| @@ -0,0 +1,76 @@ | |||
| 1 | # NIP-75 | ||
| 2 | |||
| 3 | ## Zap Goals | ||
| 4 | |||
| 5 | `draft` `optional` `author:verbiricha` | ||
| 6 | |||
| 7 | This NIP defines an event for creating fundraising goals. Users can contribute funds towards the goal by zapping the goal event. | ||
| 8 | |||
| 9 | ## Nostr Event | ||
| 10 | |||
| 11 | A `kind:9041` event is used. | ||
| 12 | |||
| 13 | The `.content` contains a human-readable description of the goal. | ||
| 14 | |||
| 15 | The following tags are defined as REQUIRED. | ||
| 16 | |||
| 17 | - `amount` - target amount in milisats. | ||
| 18 | - `relays` - a list of relays the zaps to this goal will be sent to and tallied from. | ||
| 19 | |||
| 20 | Example event: | ||
| 21 | |||
| 22 | ```json | ||
| 23 | { | ||
| 24 | "kind": 9041, | ||
| 25 | "tags": [ | ||
| 26 | ["relays", "wss://alicerelay.example.com", "wss://bobrelay.example.com", ...], | ||
| 27 | ["amount", "210000"], | ||
| 28 | ], | ||
| 29 | "content": "Nostrasia travel expenses", | ||
| 30 | ...other fields | ||
| 31 | ``` | ||
| 32 | |||
| 33 | The following tags are OPTIONAL. | ||
| 34 | |||
| 35 | - `closed_at` - timestamp for determining which zaps are included in the tally. Zap receipts published after the `closed_at` timestamp SHOULD NOT count towards the goal progress. | ||
| 36 | |||
| 37 | ```json | ||
| 38 | { | ||
| 39 | "kind": 9041, | ||
| 40 | "tags": [ | ||
| 41 | ["relays", "wss://alicerelay.example.com", "wss://bobrelay.example.com", ...], | ||
| 42 | ["amount", "210000"], | ||
| 43 | ["closed_at", "<unix timestamp in seconds>"], | ||
| 44 | ], | ||
| 45 | "content": "Nostrasia travel expenses", | ||
| 46 | ...other fields | ||
| 47 | ``` | ||
| 48 | |||
| 49 | The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event. | ||
| 50 | |||
| 51 | The goal MAY include multiple beneficiary pubkeys by specifying [`zap` tags](57.md#appendix-g-zap-tag-on-other-events). | ||
| 52 | |||
| 53 | Parameterized replaceable events can link to a goal by using a `goal` tag specifying the event id and an optional relay hint. | ||
| 54 | |||
| 55 | ```json | ||
| 56 | { | ||
| 57 | "kind": 3XXXX, | ||
| 58 | "tags": [ | ||
| 59 | ... | ||
| 60 | ["goal", "<event id>", "<Relay URL (optional)>"], | ||
| 61 | ], | ||
| 62 | ...other fields | ||
| 63 | ``` | ||
| 64 | |||
| 65 | ## Client behavior | ||
| 66 | |||
| 67 | Clients MAY display funding goals on user profiles. | ||
| 68 | |||
| 69 | When zapping a goal event, clients MUST include the relays in the `relays` tag of the goal event in the zap request `relays` tag. | ||
| 70 | |||
| 71 | When zapping a parameterized replaceable event with a `goal` tag, clients SHOULD tag the goal event id in the `e` tag of the zap request. | ||
| 72 | |||
| 73 | ## Use cases | ||
| 74 | |||
| 75 | - Fundraising clients | ||
| 76 | - Adding funding goals to events such as long form posts, badges or live streams | ||