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