diff options
| -rw-r--r-- | 25.md | 20 | ||||
| -rw-r--r-- | 64.md | 146 | ||||
| -rw-r--r-- | README.md | 5 |
3 files changed, 170 insertions, 1 deletions
| @@ -52,6 +52,26 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost | |||
| 52 | } | 52 | } |
| 53 | ``` | 53 | ``` |
| 54 | 54 | ||
| 55 | Reactions to a website | ||
| 56 | --------------------- | ||
| 57 | |||
| 58 | If the target of the reaction is a website, the reaction MUST be a `kind 17` event and MUST include an `r` tag with the website's URL. | ||
| 59 | |||
| 60 | ```json | ||
| 61 | { | ||
| 62 | "kind": 17, | ||
| 63 | "content": "⭐", | ||
| 64 | "tags": [ | ||
| 65 | ["r", "https://example.com/"] | ||
| 66 | ], | ||
| 67 | ...other fields | ||
| 68 | } | ||
| 69 | ``` | ||
| 70 | |||
| 71 | URLs SHOULD be [normalized](https://datatracker.ietf.org/doc/html/rfc3986#section-6), so that reactions to the same website are not omitted from queries. | ||
| 72 | A fragment MAY be attached to the URL, to react to a section of the page. | ||
| 73 | It should be noted that a URL with a fragment is not considered to be the same URL as the original. | ||
| 74 | |||
| 55 | Custom Emoji Reaction | 75 | Custom Emoji Reaction |
| 56 | --------------------- | 76 | --------------------- |
| 57 | 77 | ||
| @@ -0,0 +1,146 @@ | |||
| 1 | NIP-64 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Chess (Portable Game Notation) | ||
| 5 | ----- | ||
| 6 | |||
| 7 | `draft` `optional` | ||
| 8 | |||
| 9 | This NIP defines `kind:64` notes representing chess games in [PGN][pgn_specification] format, which can be read by humans and is also supported by most chess software. | ||
| 10 | |||
| 11 | ## Note | ||
| 12 | |||
| 13 | ### Content | ||
| 14 | |||
| 15 | The `.content` of these notes is a string representing a [PGN-database][pgn_formal_syntax]. | ||
| 16 | |||
| 17 | ### Notes | ||
| 18 | |||
| 19 | ```json | ||
| 20 | { | ||
| 21 | "kind": 64, | ||
| 22 | "content": "1. e4 *", | ||
| 23 | ... | ||
| 24 | } | ||
| 25 | ``` | ||
| 26 | |||
| 27 | ```json | ||
| 28 | { | ||
| 29 | "kind": 64, | ||
| 30 | "tags": [ | ||
| 31 | ["alt", "Fischer vs. Spassky in Belgrade on 1992-11-04 (F/S Return Match, Round 29)"], | ||
| 32 | ... | ||
| 33 | ], | ||
| 34 | "content": "[Event \"F/S Return Match\"]\n[Site \"Belgrade, Serbia JUG\"]\n[Date \"1992.11.04\"]\n[Round \"29\"]\n[White \"Fischer, Robert J.\"]\n[Black \"Spassky, Boris V.\"]\n[Result \"1/2-1/2\"]\n\n1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} 3... a6\n4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7\n11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5\nNxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6\n23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5\nhxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5\n35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6\nNf2 42. g4 Bd3 43. Re6 1/2-1/2" | ||
| 35 | ... | ||
| 36 | } | ||
| 37 | ``` | ||
| 38 | |||
| 39 | ## Client Behavior | ||
| 40 | |||
| 41 | Clients SHOULD display the content represented as chessboard. | ||
| 42 | |||
| 43 | Clients SHOULD publish PGN notes in ["export format"][pgn_export_format] ("strict mode", i.e. created by machines) but expect incoming notes to be in ["import format"][pgn_import_format] ("lax mode", i.e. created by humans). | ||
| 44 | |||
| 45 | Clients SHOULD check whether the formatting is valid and all moves comply with chess rules. | ||
| 46 | |||
| 47 | Clients MAY include additional tags (e.g. like [`"alt"`](https://github.com/nostr-protocol/nips/blob/master/31.md)) in order to represent the note to users of non-supporting clients. | ||
| 48 | |||
| 49 | ## Relay Behavior | ||
| 50 | |||
| 51 | Relays MAY validate PGN contents and reject invalid notes. | ||
| 52 | |||
| 53 | |||
| 54 | ## Examples | ||
| 55 | |||
| 56 | ```pgn | ||
| 57 | // A game where nothing is known. Game still in progress, game abandoned, or result otherwise unknown. | ||
| 58 | // Maybe players died before a move has been made. | ||
| 59 | * | ||
| 60 | ``` | ||
| 61 | |||
| 62 | ```pgn | ||
| 63 | 1. e4 * | ||
| 64 | ``` | ||
| 65 | |||
| 66 | ```pgn | ||
| 67 | [White "Fischer, Robert J."] | ||
| 68 | [Black "Spassky, Boris V."] | ||
| 69 | |||
| 70 | 1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} * | ||
| 71 | ``` | ||
| 72 | |||
| 73 | ```pgn | ||
| 74 | [Event "F/S Return Match"] | ||
| 75 | [Site "Belgrade, Serbia JUG"] | ||
| 76 | [Date "1992.11.04"] | ||
| 77 | [Round "29"] | ||
| 78 | [White "Fischer, Robert J."] | ||
| 79 | [Black "Spassky, Boris V."] | ||
| 80 | [Result "1/2-1/2"] | ||
| 81 | |||
| 82 | 1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} 3... a6 | ||
| 83 | 4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7 | ||
| 84 | 11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5 | ||
| 85 | Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6 | ||
| 86 | 23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5 | ||
| 87 | hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5 | ||
| 88 | 35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6 | ||
| 89 | Nf2 42. g4 Bd3 43. Re6 1/2-1/2 | ||
| 90 | ``` | ||
| 91 | |||
| 92 | ```pgn | ||
| 93 | [Event "Hourly HyperBullet Arena"] | ||
| 94 | [Site "https://lichess.org/wxx4GldJ"] | ||
| 95 | [Date "2017.04.01"] | ||
| 96 | [White "T_LUKE"] | ||
| 97 | [Black "decidement"] | ||
| 98 | [Result "1-0"] | ||
| 99 | [UTCDate "2017.04.01"] | ||
| 100 | [UTCTime "11:56:14"] | ||
| 101 | [WhiteElo "2047"] | ||
| 102 | [BlackElo "1984"] | ||
| 103 | [WhiteRatingDiff "+10"] | ||
| 104 | [BlackRatingDiff "-7"] | ||
| 105 | [Variant "Standard"] | ||
| 106 | [TimeControl "30+0"] | ||
| 107 | [ECO "B00"] | ||
| 108 | [Termination "Abandoned"] | ||
| 109 | |||
| 110 | 1. e4 1-0 | ||
| 111 | |||
| 112 | |||
| 113 | [Event "Hourly HyperBullet Arena"] | ||
| 114 | [Site "https://lichess.org/rospUdSk"] | ||
| 115 | [Date "2017.04.01"] | ||
| 116 | [White "Bastel"] | ||
| 117 | [Black "oslochess"] | ||
| 118 | [Result "1-0"] | ||
| 119 | [UTCDate "2017.04.01"] | ||
| 120 | [UTCTime "11:55:56"] | ||
| 121 | [WhiteElo "2212"] | ||
| 122 | [BlackElo "2000"] | ||
| 123 | [WhiteRatingDiff "+6"] | ||
| 124 | [BlackRatingDiff "-4"] | ||
| 125 | [Variant "Standard"] | ||
| 126 | [TimeControl "30+0"] | ||
| 127 | [ECO "A01"] | ||
| 128 | [Termination "Normal"] | ||
| 129 | |||
| 130 | 1. b3 d5 2. Bb2 c6 3. Nc3 Bf5 4. d4 Nf6 5. e3 Nbd7 6. f4 Bg6 7. Nf3 Bh5 8. Bd3 e6 9. O-O Be7 10. Qe1 O-O 11. Ne5 Bg6 12. Nxg6 hxg6 13. e4 dxe4 14. Nxe4 Nxe4 15. Bxe4 Nf6 16. c4 Bd6 17. Bc2 Qc7 18. f5 Be7 19. fxe6 fxe6 20. Qxe6+ Kh8 21. Qh3+ Kg8 22. Bxg6 Qd7 23. Qe3 Bd6 24. Bf5 Qe7 25. Be6+ Kh8 26. Qh3+ Nh7 27. Bf5 Rf6 28. Qxh7# 1-0 | ||
| 131 | ``` | ||
| 132 | |||
| 133 | ## Resources | ||
| 134 | - [PGN Specification][pgn_specification]: PGN (Portable Game Notation) specification | ||
| 135 | - [PGN Specification Supplement](https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-spec-supplement.md): Addition for adding graphical elements, clock values, eval, ... | ||
| 136 | - [PGN Formal Syntax][pgn_formal_syntax] | ||
| 137 | - [PGN Seven Tag Roster][pgn_seven_tag_roster] | ||
| 138 | - [PGN Import Format][pgn_import_format] | ||
| 139 | - [PGN Export Format][pgn_export_format] | ||
| 140 | - [lichess / pgn-viewer (GitHub)](https://github.com/lichess-org/pgn-viewer): PGN viewer widget, designed to be embedded in content pages | ||
| 141 | |||
| 142 | [pgn_specification]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md | ||
| 143 | [pgn_formal_syntax]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#18-formal-syntax | ||
| 144 | [pgn_seven_tag_roster]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#811-seven-tag-roster | ||
| 145 | [pgn_import_format]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#31-import-format-allows-for-manually-prepared-data | ||
| 146 | [pgn_export_format]: https://github.com/mliebelt/pgn-spec-commented/blob/main/pgn-specification.md#32-export-format-used-for-program-generated-output | ||
| @@ -73,6 +73,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 73 | - [NIP-57: Lightning Zaps](57.md) | 73 | - [NIP-57: Lightning Zaps](57.md) |
| 74 | - [NIP-58: Badges](58.md) | 74 | - [NIP-58: Badges](58.md) |
| 75 | - [NIP-59: Gift Wrap](59.md) | 75 | - [NIP-59: Gift Wrap](59.md) |
| 76 | - [NIP-64: Chess (PGN)](64.md) | ||
| 76 | - [NIP-65: Relay List Metadata](65.md) | 77 | - [NIP-65: Relay List Metadata](65.md) |
| 77 | - [NIP-70: Protected Events](70.md) | 78 | - [NIP-70: Protected Events](70.md) |
| 78 | - [NIP-71: Video Events](71.md) | 79 | - [NIP-71: Video Events](71.md) |
| @@ -109,11 +110,13 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 109 | | `13` | Seal | [59](59.md) | | 110 | | `13` | Seal | [59](59.md) | |
| 110 | | `14` | Direct Message | [17](17.md) | | 111 | | `14` | Direct Message | [17](17.md) | |
| 111 | | `16` | Generic Repost | [18](18.md) | | 112 | | `16` | Generic Repost | [18](18.md) | |
| 113 | | `17` | Reaction to a website | [25](25.md) | | ||
| 112 | | `40` | Channel Creation | [28](28.md) | | 114 | | `40` | Channel Creation | [28](28.md) | |
| 113 | | `41` | Channel Metadata | [28](28.md) | | 115 | | `41` | Channel Metadata | [28](28.md) | |
| 114 | | `42` | Channel Message | [28](28.md) | | 116 | | `42` | Channel Message | [28](28.md) | |
| 115 | | `43` | Channel Hide Message | [28](28.md) | | 117 | | `43` | Channel Hide Message | [28](28.md) | |
| 116 | | `44` | Channel Mute User | [28](28.md) | | 118 | | `44` | Channel Mute User | [28](28.md) | |
| 119 | | `64` | Chess (PGN) | [64](64.md) | | ||
| 117 | | `818` | Merge Requests | [54](54.md) | | 120 | | `818` | Merge Requests | [54](54.md) | |
| 118 | | `1021` | Bid | [15](15.md) | | 121 | | `1021` | Bid | [15](15.md) | |
| 119 | | `1022` | Bid confirmation | [15](15.md) | | 122 | | `1022` | Bid confirmation | [15](15.md) | |
| @@ -245,7 +248,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | |||
| 245 | | `L` | label namespace | -- | [32](32.md) | | 248 | | `L` | label namespace | -- | [32](32.md) | |
| 246 | | `m` | MIME type | -- | [94](94.md) | | 249 | | `m` | MIME type | -- | [94](94.md) | |
| 247 | | `q` | event id (hex) | relay URL | [18](18.md) | | 250 | | `q` | event id (hex) | relay URL | [18](18.md) | |
| 248 | | `r` | a reference (URL, etc) | petname | [24](24.md) | | 251 | | `r` | a reference (URL, etc) | -- | [24](24.md), [25](25.md) | |
| 249 | | `r` | relay url | marker | [65](65.md) | | 252 | | `r` | relay url | marker | [65](65.md) | |
| 250 | | `t` | hashtag | -- | | | 253 | | `t` | hashtag | -- | | |
| 251 | | `alt` | summary | -- | [31](31.md) | | 254 | | `alt` | summary | -- | [31](31.md) | |