NIP58 - Badge Event "Request" and "Denial"#2204
Open
DoktorShift wants to merge 3 commits intonostr-protocol:masterfrom
Open
NIP58 - Badge Event "Request" and "Denial"#2204DoktorShift wants to merge 3 commits intonostr-protocol:masterfrom
DoktorShift wants to merge 3 commits intonostr-protocol:masterfrom
Conversation
Collaborator
|
Why don't we use non-replaceable for the new kinds? You wouldn't need to publish withdrawals, just delete the event with a kind 5 |
Author
|
Good point, thanks for the feedback! @vitorpamplona |
Feedback updates. Removed new introduced status tag. Use NIP-9 kind 5 instead
Author
|
Hey @vitorpamplona , any concerns or open requests pending? I already implemented the approach iinto an Webapplication called BadgeBox. Its working great :) |
Collaborator
|
Looks good to me. We just need more implementers before merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NIP-58 Extended - Badge Requests
draftoptionalThis aim for discussion to extend NIP-58 with badge requests and denials.
Motivation
NIP-58 defines badge creation and awarding but provides no mechanism for users to request badges. This extending would add:
Event Kinds
Badge Request (kind 30058)
An addressable event where a user requests a badge from an issuer.
{ "kind": 30058, "content": "<message to issuer>", "tags": [ ["d", "30009:<issuer-pubkey>:<badge-d-tag>"], ["a", "30009:<issuer-pubkey>:<badge-d-tag>", "<relay-url>"], ["p", "<issuer-pubkey>"] ] }dtag MUST be the badge'satag identifierProof Tag
Requesters MAY include evidence to support their request:
Multiple
prooftags are allowed. Verification method is left to the issuer.Withdrawal
To withdraw a request, publish with
statustag:{ "kind": 30058, "content": "", "tags": [ ["d", "30009:<issuer-pubkey>:<badge-d-tag>"], ["a", "30009:<issuer-pubkey>:<badge-d-tag>"], ["p", "<issuer-pubkey>"], ["status", "withdrawn"] ] }Clients MUST ignore or CAN honor requests with
["status", "withdrawn"].Badge Denial (kind 30059)
An addressable event where an issuer formally denies a badge request.
{ "kind": 30059, "content": "<reason for denial>", "tags": [ ["d", "<request-event-id>"], ["a", "30009:<issuer-pubkey>:<badge-d-tag>", "<relay-url>"], ["e", "<request-event-id>", "<relay-url>"], ["p", "<requester-pubkey>"] ] }dtag MUST be the request event idSoft Denial
Denials are soft by design. A denied user CAN submit a new request for the same badge (e.g., with better proof). The new request generates a new event id, making the old denial obsolete.
Revocation
To revoke a denial, publish with
statustag:{ "kind": 30059, "content": "", "tags": [ ["d", "<request-event-id>"], ["a", "30009:<issuer-pubkey>:<badge-d-tag>"], ["e", "<request-event-id>"], ["p", "<requester-pubkey>"], ["status", "revoked"] ] }Clients MUST ignore denials with
["status", "revoked"].Request States
A request can be in one of four states:
["status", "withdrawn"]State Resolution
Edge Cases
Querying
Issuer finds incoming requests:
{"kinds": [30058], "#p": ["<issuer-pubkey>"]}User finds own outgoing requests:
{"kinds": [30058], "authors": ["<user-pubkey>"]}User finds denials:
{"kinds": [30059], "#p": ["<user-pubkey>"]}Protocol Flow
Examples
Request with Proof
{ "kind": 30058, "pubkey": "a1b2c3...", "created_at": 1704067200, "content": "I contributed the auth module!", "tags": [ ["d", "30009:x1y2z3:contributor"], ["a", "30009:x1y2z3:contributor", "wss://relay.damus.io"], ["p", "x1y2z3..."], ["proof", "https://github.com/project/repo/pull/42"] ] }Denial with Reason
{ "kind": 30059, "pubkey": "x1y2z3...", "created_at": 1704153600, "content": "Please provide ticket confirmation.", "tags": [ ["d", "req123..."], ["a", "30009:x1y2z3:attendee"], ["e", "req123...", "wss://relay.damus.io"], ["p", "a1b2c3..."] ] }Backward Compatibility
Fully backward compatible with NIP-58:
Security Considerations