{"id":"4354bfc558979158830ec176732f611ec3d6c7b91ade1c644424b6bcaee7e5da","pubkey":"2b39b4ffe62933df970e19366c22c1e092f953f83fcfed754e0f04d5a3b459f9","created_at":1781353189,"kind":30817,"tags":[["d","nip-25"],["title","NIP-25: Reactions"],["summary","Kind 7, the reaction, whose content is a plus, a minus or an emoji, pointing at the event it answers."],["s","draft"],["t","nostr"],["t","nip"],["k","7","Reaction"],["k","17","Reaction to a website"],["alt","A specification: NIP-25: Reactions"],["client","openspecs-import"],["published_at","1659199826"],["proxy","https://github.com/nostr-protocol/nips/blob/656cecc7c0a815b6a2b218d3b5d6f078b3f4dbab/25.md","web"],["x","f20682fa3062fb48524104ab520dbefc3037cb35f1acfc63077f53a5b644183b"]],"content":"\nNIP-25\n======\n\nReactions\n---------\n\n`draft` `optional`\n\nA reaction is a `kind 7` event that is used to indicate user reactions to other events. A\nreaction's `content` field MUST include user-generated-content indicating the value of the\nreaction (conventionally `+`, `-`, or an emoji).\n\nA reaction with `content` set to `+` or an empty string MUST be interpreted as a \"like\" or \"upvote\".\nA reaction with `content` set to `-` MUST be interpreted as a \"dislike\" or \"downvote\".\n\nA reaction with `content` set to an emoji or [NIP-30](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95enqrvuej9) custom emoji SHOULD NOT be interpreted\nas a \"like\" or \"dislike\". Clients MAY instead display this emoji reaction on the post.\n\nTags\n----\n\nThere MUST be always an `e` tag set to the `id` of the event that is being reacted to. The `e` tag SHOULD include a relay hint pointing to a relay where the event being reacted to can be found. If a client decides to include other `e`, which not recommended, the target event `id` should be last of the `e` tags.\n\nThere SHOULD be a `p` tag set to the `pubkey` of the event being reacted to. If a client decides to include other `p` tags, which not recommended, the target event `pubkey` should be last the `p` tags.\n\nIf the event being reacted to is an addressable event, an `a` SHOULD be included together with the `e` tag, it must be set to the coordinates (`kind:pubkey:d-tag`) of the event being reacted to.\n\nThe `e` and `a` tags SHOULD include relay and pubkey hints. The `p` tags SHOULD include relay hints.\n\nThe reaction event MAY include a `k` tag with the stringified kind number of the reacted event as its value.\n\n**Example code**\n\n```swift\nfunc make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: String) -> NostrEvent {\n    var tags: [[String]] = []\n    tags.append([\"e\", liked.id, hint, liked.pubkey])\n    tags.append([\"p\", liked.pubkey, hint])\n    tags.append([\"k\", String(liked.kind)])\n    let ev = NostrEvent(content: \"+\", pubkey: pubkey, kind: 7, tags: tags)\n    ev.calculate_id()\n    ev.sign(privkey: privkey)\n    return ev\n}\n```\n\nExternal Content Reactions\n---------------------\n\nIf the target of a reaction is not a native nostr event, the reaction MUST be a `kind 17` event and MUST include [NIP-73](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95mnxm8dm4t) external content `k` + `i` tags to properly reference the content.\n\n_Reacting to a website:_\n```yaml\n{\n  \"kind\": 17,\n  \"content\": \"⭐\",\n  \"tags\": [\n    [\"k\", \"web\"],\n    [\"i\", \"https://example.com\"]\n  ],\n}\n```\n\n_Reacting to a podcast episode:_\n```yaml\n{\n  \"kind\": 17,\n  \"content\": \"+\",\n  \"tags\": [\n    [\"k\", \"podcast:guid\"],\n    [\"i\", \"podcast:guid:917393e3-1b1e-5cef-ace4-edaa54e1f810\", \"https://fountain.fm/show/QRT0l2EfrKXNGDlRrmjL\"],\n    [\"k\", \"podcast:item:guid\"],\n    [\"i\", \"podcast:item:guid:PC20-229\", \"https://fountain.fm/episode/DQqBg5sD3qFGMCZoSuLF\"]\n  ],\n}\n```\n\n\n\n\nCustom Emoji Reaction\n---------------------\n\nThe client may specify a custom emoji ([NIP-30](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95enqrvuej9)) `:shortcode:` in the\nreaction content. The client should refer to the emoji tag and render the\ncontent as an emoji if shortcode is specified.\n\n```yaml\n{\n  \"kind\": 7,\n  \"content\": \":soapbox:\",\n  \"tags\": [\n    [\"emoji\", \"soapbox\", \"https://gleasonator.com/emoji/Gleasonator/soapbox.png\"]\n  ],\n  // other fields...\n}\n```\n\nThe content can be set only one `:shortcode:`. And emoji tag should be one.\n","sig":"45d96768bbcf9a93ee76e1f21af0ae06cbd2dedc410c408345106514181fa6c6a815aa52492985e2b8e1c8591ae8b04081c75bde8dc8253d32cc30d1d6c494ad"}