Skip to content

Kind 1018: Poll Response

Overview

Kind 1018 events represent responses to polls in the Nostr ecosystem. These events allow users to vote on polls created as Kind 1068 events. The poll response system supports both single-choice and multiple-choice polls, with configurable mechanisms to ensure vote integrity including time limits and one-vote-per-pubkey rules.

Specification

PropertyValue
Kind Number1018
Event RangeRegular
Defined inNIP-88

Content Format

The content field is typically empty in poll response events, as all meaningful information is contained in the tags.

Schema

json
"content": ""

Tags

Tag NameDescriptionFormatRequired
eReferenced poll event["e", "<poll-event-id>"]Yes
responseSelected option(s)["response", "<option-id>"]Yes

Client Behavior

Clients should:

  1. Validate that the event being responded to is a valid poll (Kind 1068)
  2. Check the poll's polltype to determine if multiple responses are allowed
  3. Only allow responses to polls that haven't expired (check endsAt in the poll)
  4. Publish responses to the relays specified in the poll event's relay tags
  5. When displaying poll results:
    • Count only one vote per public key
    • For multiple votes from the same pubkey, use the most recent one before the poll's end time
    • Display results in a user-friendly format, such as percentages or visualizations

Relay Behavior

Relays should:

  1. Accept and store poll response events
  2. Ideally, not honor deletion events (Kind 5) for poll responses to maintain poll integrity
  3. Avoid accepting backdated events for polls

Use Cases

  • Voting on community polls
  • Expressing preferences on survey questions
  • Participating in governance decisions
  • Gathering community feedback
  • Creating interactive content that engages users

Example

json
{
  "id": "60a005e32e9596c3f544a841a9bc4e46d3020ca3650d6a739c95c1568e33f6d8",
  "pubkey": "1bc70a0148b3f316da33fe7e89f23e3e71ac4ff998027ec712b905cd24f6a411",
  "created_at": 1720097117,
  "kind": 1018,
  "tags": [
    ["e", "9d1b6b9562e66f2ecf35eb0a3c2decc736c47fddb13d6fb8f87185a153ea3634"],
    ["response", "qj518h583"]
  ],
  "content": "",
  "sig": "30071a633c65db8f3a075c7a8de757fbd8ce65e3607f4ba287fe6d7fbf839a380f94ff4e826fbba593f6faaa13683b7ea9114ade140720ecf4927010ebf3e44f"
}

Example for multiple-choice poll:

json
{
  "id": "72a5f31d98ba1d0c3eaf0f4885017a6b3d7508de9919d1312dc7e1395dd0d739",
  "pubkey": "1bc70a0148b3f316da33fe7e89f23e3e71ac4ff998027ec712b905cd24f6a411",
  "created_at": 1720097300,
  "kind": 1018,
  "tags": [
    ["e", "5fc80cf813f1af33d5a435862b7ef7fb96b47e68a48f1abcadf8081f5a545550"],
    ["response", "gga6cdnqj"],
    ["response", "m3agjsdq1"]
  ],
  "content": "",
  "sig": "a671fb3c0075d4b6516f7db584de3c2f5eba4761b62fc8c55c2b68333c0c47a58d2c671fb2a6b84f6f3ce62e3c27b477e7d5e5dc087e23f1d70fd5b3051ba39d"
}

References

Notes

  • For singlechoice polls, only the first response tag should be considered as the actual vote, even if multiple are provided.
  • For multiplechoice polls, one response tag per option ID is counted, regardless of order.
  • Poll integrity is best maintained by using relays that enforce appropriate rules:
    • Relays that don't allow backdated events
    • Relays that don't honor event deletion requests for poll votes
  • Clients may implement additional curation mechanisms for poll results:
    • Filtering votes by a follow set
    • Implementing Proof of Work requirements
    • Using Web of Trust scores to filter vote validity