upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2023-02-08 08:36:07 -0300
committerfiatjaf <fiatjaf@gmail.com>2023-02-08 08:36:07 -0300
commit3f39a241b170a4e11d5c162c03f03da4fedb0756 (patch)
treea0ed2e5551454dddec41ed929832120c5e7c904e
parentf9e38ed00f5b11694ff93c368aacbf47ec21437a (diff)
Revert "[NIP-26] Fix for multiple `kind`s in delegation conditions (#208)"
This reverts commit 6a11f4d4cd0159c517414ffa6cfc646f8c7c9da3.
-rw-r--r--26.md26
1 files changed, 6 insertions, 20 deletions
diff --git a/26.md b/26.md
index 0f8f64a..955a043 100644
--- a/26.md
+++ b/26.md
@@ -38,34 +38,20 @@ The following fields and operators are supported in the above query string:
38*Fields*: 38*Fields*:
391. `kind` 391. `kind`
40 - *Operators*: 40 - *Operators*:
41 - `=${KIND_NUMBERS}` - delegatee may only sign events of listed kind(s) (comma-separated) 41 - `=${KIND_NUMBER}` - delegatee may only sign events of this kind
422. `created_at` 422. `created_at`
43 - *Operators*: 43 - *Operators*:
44 - `<${TIMESTAMP}` - delegatee may only sign events whose `created_at` is ***before*** the specified timestamp 44 - `<${TIMESTAMP}` - delegatee may only sign events created ***before*** the specified timestamp
45 - `>${TIMESTAMP}` - delegatee may only sign events whose `created_at` is ***after*** the specified timestamp 45 - `>${TIMESTAMP}` - delegatee may only sign events created ***after*** the specified timestamp
46 46
47Multiple conditions can be used in a single query string, including on the same field. Conditions must be combined with `&`. 47In order to create a single condition, you must use a supported field and operator. Multiple conditions can be used in a single query string, including on the same field. Conditions must be combined with `&`.
48
49Multiple conditions should be treated as `AND` requirements; all conditions must be true for the delegated event to be valid.
50
51Multiple comma-separated `kind` values should be interpreted as:
52```
53# kind=0,1,3000
54... AND (kind == 0 OR kind == 1 OR kind == 3000) AND ...
55```
56 48
57For example, the following condition strings are valid: 49For example, the following condition strings are valid:
58- `kind=1` 50
59- `created_at<1675721813`
60- `kind=1&created_at<1675721813` 51- `kind=1&created_at<1675721813`
61- `kind=0,1,3000&created_at>1675721813` 52- `kind=0&kind=1&created_at>1675721813`
62- `kind=1&created_at>1674777689&created_at<1675721813` 53- `kind=1&created_at>1674777689&created_at<1675721813`
63 54
64However, specifying multiple _separate_ `kind` conditions is impossible to satisfy:
65- `kind=1&kind=5`
66
67There is no way for an event to satisfy the `AND` requirement of being both `kind`s simultaneously.
68
69For the vast majority of use-cases, it is advisable that query strings should include a `created_at` ***after*** condition reflecting the current time, to prevent the delegatee from publishing historic notes on the delegator's behalf. 55For the vast majority of use-cases, it is advisable that query strings should include a `created_at` ***after*** condition reflecting the current time, to prevent the delegatee from publishing historic notes on the delegator's behalf.
70 56
71#### Example 57#### Example