Closed simonas-notcat closed 2 years ago
Example situation:
Alice has asked a support question in one of the Discord channels. Bob quickly answered Alice's question. Alice wants to give kudos to Bob for quick response
Example slash-command:
/kudos to: @bob kudos: For quick support!
In this scenario we have:
Sender: Alice
Recipient: Bob
Discord channel: VeramoLabs / Support
Kudos: "For quick support!"
We want to create a Verifiable Credential that represents this interaction, so that it can be later used as part of portable and verifiable reputation for Bob and Alice.
Community bot checks if there is a managed DID associated with a discord userIds that are involved in this interaction, if not - creates custodial DIDs for them
const alice = await agent.didManagerGetOrCreate({
alias: 'community.veramo.io:discord:1234567890',
provider: 'did:web'
})
const bob = await agent.didManagerGetOrCreate({
alias: 'community.veramo.io:discord:45678901234',
provider: 'did:web'
})
Then issues credential on behalf of Alice:
const vc = await agent.createVerifiableCredential({
save: true,
proofFormat: 'jwt',
credential: {
id: interaction.id,
issuer: { id: alice.did },
credentialSubject: {
id: bob.did,
kudos: 'For quick support!'
channel: 'https://discord.com/channels/878293684620234752/890207307433136178'
},
issuanceDate: new Date().toISOString(),
type: ['VerifiableCredential', 'Kudos'],
'@context': ['https://www.w3.org/2018/credentials/v1'],
}
})
There is only one managed DID in the agent, which represents the bot it self.
const bot = await agent.didManagerGetOrCreate({
alias: 'community.veramo.io',
provider: 'did:web'
})
We use this DID to issue a VCred:
const vc = await agent.createVerifiableCredential({
save: true,
proofFormat: 'jwt',
credential: {
id: interaction.id,
issuer: { id: bot.did },
credentialSubject: {
id: 'https://discord.com/users/45678901234',
kudos: 'For quick support!'
author: 'https://discord.com/users/1234567890',
channel: 'https://discord.com/channels/878293684620234752/890207307433136178'
},
issuanceDate: new Date().toISOString(),
type: ['VerifiableCredential', 'Kudos'],
'@context': ['https://www.w3.org/2018/credentials/v1'],
}
})
In this scenario Alice and Bob should connect their wallets to the bot and register their self sovereign DID.
The code to issue VCred would look similar to the Option 1
, but would require additional steps when onboarding users.
Also every interaction would require users to sign VCreds in their wallets
Option 1 - custodial DIDs
Option 2 - community bot as a Witness
Option 3 - Self Sovereign Identity model
After some internal conversations we decided to go with the Option 2
.
Main reasons why:
Option 1
or Option 3
in the future without needing to reissue old VCreds
Create and publish
Kudos
credential schema at https://github.com/veramolabs/vc-json-schemasExample of current VCs: