Skip to content

Instantly share code, notes, and snippets.

View kdenhartog's full-sized avatar

Kyle Den Hartog kdenhartog

View GitHub Profile

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:

@kdenhartog
kdenhartog / vc-context?hl=z3aq31uzgnZBuWNzUB
Created May 17, 2021 04:18
test vc context with hl query param
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
@kdenhartog
kdenhartog / gist:fa23c0da70933f5789b79cf916e4877b
Last active June 22, 2021 00:20
Common delegation patterns in VC ecosystem

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 / dj.ts
Created July 15, 2021 07:18
slower example
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 / playground.jsonld
Last active August 6, 2021 02:59
Modifed VC Context to support termsOfUse in VerifiablePresentation
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
{
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",
"type": "@type",
"VerifiableCredential": {
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
{
"@context": {
"@version": 1.1,
"@protected": true,
"termsOfUseVpExtension": {
"termsOfUse": {
"@id": "https://www.w3.org/2018/credentials#termsOfUse",
"@type": "@id"
}
}
{
"@context": {
"id": "@id",
"type": "@type",
"@protected": true,
"VerifiablePresentationWithToU": {
"@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
"@context": {
"@version": 1.1,
"@protected": true,
@kdenhartog
kdenhartog / playground.jsonld
Last active August 24, 2021 23:39
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",
@kdenhartog
kdenhartog / playground.jsonld
Created February 22, 2022 21:58
playground.jsonld
{
"@context": {
"@version": 1.1,
"@protected": true,
"Route": {
"@id": "http://127.0.0.1:4000/Credentials.jsonld#Route",
"@context": {
"@version": 1.1,
"@protected": true,
"id": "@id",