Improve <subscription_id> specification

- "random" is not an accurate description
- I've noticed long (sha256 hashes in hex) being rejected by some relays. So there seems a need to specify a max length.
- "non empty", cause an empty string could be interpreted as `null` 

To be decided:
- Max length number
- Are `subscription_id`s case sensitive?
- Will `subscription_id`s be white space trimmed?
This commit is contained in:
Mike O'Bank 2023-02-25 07:02:48 +01:00 committed by fiatjaf_
parent ab1f26a3fd
commit 5a80a906d4

2
01.md
View File

@ -55,7 +55,7 @@ Clients can send 3 types of messages, which must be JSON arrays, according to th
* `["REQ", <subscription_id>, <filters JSON>...]`, used to request events and subscribe to new updates. * `["REQ", <subscription_id>, <filters JSON>...]`, used to request events and subscribe to new updates.
* `["CLOSE", <subscription_id>]`, used to stop previous subscriptions. * `["CLOSE", <subscription_id>]`, used to stop previous subscriptions.
`<subscription_id>` is a random string that should be used to represent a subscription. `<subscription_id>` is an arbitrary, non-empty string of max length 64 chars, that should be used to represent a subscription.
`<filters>` is a JSON object that determines what events will be sent in that subscription, it can have the following attributes: `<filters>` is a JSON object that determines what events will be sent in that subscription, it can have the following attributes: