Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Den Hartog kdenhartog

View GitHub Profile
@kdenhartog
kdenhartog / playground.jsonld
Last active Aug 24, 2021
playground.jsonld
View playground.jsonld
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"Person": "http://xmlns.com/foaf/0.1/Person",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"name": "http://xmlns.com/foaf/0.1/name",
"nickname": "http://xmlns.com/foaf/0.1/nick",
View playground.jsonld
{
"@context": {
"id": "@id",
"type": "@type",
"@protected": true,
"VerifiablePresentationWithToU": {
"@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
"@context": {
"@version": 1.1,
"@protected": true,
View playground.jsonld
{
"@context": {
"@version": 1.1,
"@protected": true,
"termsOfUseVpExtension": {
"termsOfUse": {
"@id": "https://www.w3.org/2018/credentials#termsOfUse",
"@type": "@id"
}
}
View playground.jsonld
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
@kdenhartog
kdenhartog / playground.jsonld
Last active Aug 6, 2021
Modifed VC Context to support termsOfUse in VerifiablePresentation
View playground.jsonld
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
@kdenhartog
kdenhartog / dj.ts
Created Jul 15, 2021
slower example
View dj.ts
const didJWT = require('did-jwt')
const jws = "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDprZXk6ejZNa3RDRlJjd0xSRlFBOVdiZURSTTdXN2tiQmRaVEhRMnhuUGd5eFpMcTFnQ3BLI3o2TWt0Q0ZSY3dMUkZRQTlXYmVEUk03VzdrYkJkWlRIUTJ4blBneXhaTHExZ0NwSyJ9.AXESIMO-4ZU-naWjzDcxVw3nO_cV8FdAtUg5KCzWM8ygw_gn.tD8L8HUeKr1VaWaHhzp5s5vR6Qv979YVsi05sgZ12YzbI9k2ZXXG80vSErJA4_M-COg7UjEEYxfR4SoTCwRlBw"
const pubKeys = [
{
id: 'did:key:z6MktCFRcwLRFQA9WbeDRM7W7kbBdZTHQ2xnPgyxZLq1gCpK#z6MktCFRcwLRFQA9WbeDRM7W7kbBdZTHQ2xnPgyxZLq1gCpK',
type: 'Ed25519VerificationKey2018',
controller: 'did:key:z6MktCFRcwLRFQA9WbeDRM7W7kbBdZTHQ2xnPgyxZLq1gCpK',
publicKeyBase58: 'EjzP2h5yurfgQ6oWjn9fGf3BozBRz9iRhg52j4rzkz2x'
},
@kdenhartog
kdenhartog / gist:fa23c0da70933f5789b79cf916e4877b
Last active Jun 22, 2021
Common delegation patterns in VC ecosystem
View gist:fa23c0da70933f5789b79cf916e4877b

Delegation without attenuation by using DID Documents

As an example, let's say we have the two following DID Documents:

Alice's DID Document:

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    "https://w3id.org/security/suites/ed25519-2020/v1"
@kdenhartog
kdenhartog / vc-context?hl=z3aq31uzgnZBuWNzUB
Created May 17, 2021
test vc context with hl query param
View vc-context?hl=z3aq31uzgnZBuWNzUB
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
View keybase.md

Keybase proof

I hereby claim:

  • I am kdenhartog on github.
  • I am kdenhartog (https://keybase.io/kdenhartog) on keybase.
  • I have a public key ASAVx5jvITEbqzyfZt8wQFWwU01-GJuUzPZXAny7xHheTQo

To claim this, I am signing this object: