-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIP-41: Poll & Vote Event #148
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
NIP-41 | ||
====== | ||
|
||
### Poll & Vote Event | ||
----------------------------------- | ||
|
||
`draft` `optional` `author:0xtlt` | ||
|
||
An event with kind `1` that wants to contain a poll can do so by adding poll tags and its content as follows: | ||
|
||
```json | ||
{ | ||
... | ||
"kind": 1, | ||
"tags": [ | ||
... | ||
["poll", "Choice 1"], | ||
["poll", "Choice 2"], | ||
["poll", "Choice 3"] | ||
... | ||
], | ||
} | ||
``` | ||
|
||
Then the client should display voting options if more than **1 choice** is present in the poll. | ||
|
||
The client can then submit the vote by sending an event with kind `8` and its content which will be the index (start at `0`) of the chosen choice. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not re-use/extend/abuse the NIP-25 reactions (type Then the poll options instead would be: {
"tags": [
["poll", "Choice 1"],
["poll", "Choice 2"],
["poll", "Choice 3"],
]
} and reaction/response event type {
"id": "<ID>",
"sig": "<signature>",
"kind": 7,
"tags": [
["e", "<event ID of the note with the poll>"],
["p", "<pubkey of the note with the poll>"]
],
"pubkey": "<pubkey of the responder>",
"content": "Choice 1",
"created_at": 1234567891
} Where the For better interoperability( /not breaking the current type poll {
"tags": [
["poll", "1️⃣ Choice 1 text"],
["poll", "2️⃣ Choice 2 text"],
["poll", "3️⃣ Choice 3 text"],
]
} reaction {
...,
"content": "1️⃣",
} Any reaction that doesn't match any of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did see on your Damus PR though that @jb55 wasn't sure about re-using/overloading the reaction type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem with using reactions is that the reaction is not necessarily used to respond to a poll but is intended for "reaction" use only. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Polls are an event, reactions to an event that is a poll is indeed an answer, seems perfect simple to me. YAGNI! Also I disagree with reactions is not to respond a poll because reactions is also a flexible answer(upvote, donwvote, emoji), why not the answer of a poll, it is perfect. |
||
|
||
It should also contain an `e` tag with the id of the poll event only. | ||
|
||
```json | ||
{ | ||
... | ||
"kind": 8, | ||
"tags": [ | ||
... | ||
["e", "<event-id>"] | ||
... | ||
], | ||
"content": "1" | ||
} | ||
``` | ||
|
||
#### Warning | ||
|
||
Keep in mind that all votes are public and accessible to everyone. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clients should make explicit that votes are public. Warning the implementer is not necessarily reaching the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one
"poll"
may seem pointless, but perhaps it'd be useful for an "Agree", "No", "Sign Up", "ACK" or whatever where ignoring it is an implicit no? Given that the responses are all going to be public events, so you could DM everyone if it was for a 'signup' mechanism or whatever.So, I think it'd make sense to still show it if only one choice is present, even if that seems odd/niche
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Poll and sign up for something are two differents things, And we need an explicite usage of the poll, then if only one poll is defined, we can't decide for the user if he wanted to have "agree", "no" or sign up"