diff options
| author | William Casarin <jb55@jb55.com> | 2022-11-10 12:14:18 -0800 |
|---|---|---|
| committer | William Casarin <jb55@jb55.com> | 2022-11-10 12:20:32 -0800 |
| commit | 7569773ad6e162333155905f9f1ea620c732ff71 (patch) | |
| tree | 2feb30e506692285b790606c36c4510c385f88a3 | |
| parent | e7f74d21c48e255181d93eda317f36f9702a14ad (diff) | |
NIP-20: add a note about client handling
| -rw-r--r-- | 20.md | 13 |
1 files changed, 13 insertions, 0 deletions
| @@ -68,6 +68,19 @@ Event rejected, insufficient proof-of-work difficulty | |||
| 68 | ["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"] | 68 | ["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"] |
| 69 | 69 | ||
| 70 | 70 | ||
| 71 | |||
| 72 | Client Handling | ||
| 73 | --------------- | ||
| 74 | |||
| 75 | `messages` are meant for humans, with `reason:` prefixes so that clients can be slightly more intelligent with what to do with them. For example, with a `rate-limited:` reason the client may not show anything and simply try again with a longer timeout. | ||
| 76 | |||
| 77 | For the `pow:` prefix it may query relay metadata to get the updated difficulty requirement and try again in the background. | ||
| 78 | |||
| 79 | For the `invalid:` and `blocked`: prefix the client may wish to show these as styled error popups. | ||
| 80 | |||
| 81 | The prefixes include a colon so that the message can be cleanly separated from the prefix by taking everything after `:` and trimming it. | ||
| 82 | |||
| 83 | |||
| 71 | Future Extensions | 84 | Future Extensions |
| 72 | ----------------- | 85 | ----------------- |
| 73 | 86 | ||