* Recipient: A pubkey that receives recurring payments
* Subscriber: A pubkey that sends recurring payments
* Payment verifier: An optional pubkey recipients can designate to verify payments on their behalf
# Kinds
`kind:37001` - Tier Event -- Optionally published by recipients
`kind:7001` - Subscribe Event -- Published by subscribers
`kind:7002` - Unsubscribe Event -- Published by subscribers
`kind:7003` - Subscription Payment Receipt -- Published by payment-verifier-pubkey
## `kind:37001`: Tier Event
A pubkey that wants to provide others the ability to subscribe to them can create "tiers". These tiers might provide certain benefits to the supporters who subscribe to these.
Zero or more `zap` tags can exist as defined in NIP-57.
A `zap` tag with no pubkey indicates that the client can include any pubkey in the `kind:7001` event (and in the resulting recurring zaps). This way, users can offer a "referral" fee to other clients.
* The `amount` tag specifies what the supporters is committing to pay to the supported pubkey and the cadence. MUST be equal to one of the amounts specified in the
`kind:37001` event if one is tagged. There MUST be exactly 1 `amount` tag.
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.
`kind:7001` events can include zap splits as defined in NIP-57. Zap splits MUST be copied by clients as they exist in the `kind:37001` event being subscribed to. When an event has a `zap` tag with no pubkey, clients can discard it, or add the client developer's pubkey, or any other user they wish to receive a share of recurring subscriptions.
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.
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.
The same `kind:7001` is re-zapped on a regular basis per the cadence specified in the event.
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.
When a subscription payment is made and a `payment-verifier-pubkey` is set on the `kind:37001` this pubkey publishes `kind:7003` events tagging the `kind:7001` event that was paid and `p`-tagging the pubkey that received the payment.
```js
{
"kind": 7003,
"content": "<optional-message>",
"tags": [
[ "p", "<recipient-pubkey>" ],
[ "P", "<subscriber-pubkey>" ],
[ "e", "<kind-7001-event-id>" ],
[ "valid", "<from-timestamp>", "<to-timestamp>" ]
[ "tier", "kind:37001-d-tag" ]
]
}
```
`p` is the pubkey that received the payment.
`P` is the pubkey that made the payment.
`e` is the `kind:7001` event that was paid.
`valid` is the period for which the payment is valid.
`tier` is the d-tag of the `kind:37001` that this subscription is for.
# Appendix 0: Verifying Payment
The following conditions must be met to verify a payment:
* Time between zap receipts should be equal or less than the cadence specified in the `kind:7001` event.
* Amount of the zap receipt should be equal or greater than the amount specified in the `kind:7001` event. For currencies not directly supported by the zap spec, clients should do a best effort conversion to the currency specified in the `kind:7001` event at the time of zap receipt.
* Zap-receipts should include a zap request `e`-tagging the `kind:7001` event. Zap-receipts might not include a signature (for NWC-automated payments where the subscriber is not present to sign the zap request).
* Validations specified in [NIP-57](https://github.com/nostr-protocol/nips/blob/master/57.md).
If `kind:7003` events are published by the payment-verifier-pubkey, clients can use these to verify payments more simply.