Angie Jones PRO
Developer Advocate. International Keynote Speaker. Master Inventor.
Angie Jones
Head of Developer Relations
@techgirl1908
Have you ever ordered alcohol
from a delivery app?
@techgirl1908
Physical Transaction
Online Transaction
=
=
+
>
>
>
@techgirl1908
Online Transaction Unfulfilled
=
+
>
>
>
>
@techgirl1908
Mobile Drivers License
@techgirl1908
Physical Transaction
Online Transaction
=
>
=
>
+
@techgirl1908
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
{
"alg": "HS256",
"typ": "JWT"
}
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
}
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
your-256-bit-secret
) secret base64 encoded
HEADER
PAYLOAD
SIGNATURE
@techgirl1908
{
"alg": "HS256",
"typ": "JWT"
}
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
}
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
your-256-bit-secret
) secret base64 encoded
HEADER
PAYLOAD
SIGNATURE
{
"alg": "EdDSA",
"typ": "JWT",
"kid": "did:dht:4mcuhc5merqam9hqq33cmk4k5kzajeq9shxkjydue61nc4em6i4o#0"
}
{
"vc": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiableCredential",
"AgeOver21Credential"
],
"id": "urn:uuid:0938d48d-ff0c-42b9-a9c4-6355b481095b",
"issuer": "did:dht:4mcuhc5merqam9hqq33cmk4k5kzajeq9shxkjydue61nc4em6i4o",
"issuanceDate": "2024-02-23T05:35:23Z",
"credentialSubject": {
"id": "did:dht:urtux8mi7nhtrgiyry5qbwb39ey4mpqidgnq3czkmp4zaoxcm5ty",
"over21": true
}
},
"iss": "did:dht:4mcuhc5merqam9hqq33cmk4k5kzajeq9shxkjydue61nc4em6i4o",
"sub": "did:dht:urtux8mi7nhtrgiyry5qbwb39ey4mpqidgnq3czkmp4zaoxcm5ty"
}
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
your-256-bit-secret
) secret base64 encoded
HEADER
PAYLOAD
SIGNATURE
@techgirl1908
{
"vc": {
"@context": [
"https://www.w3.org/2018/credentials/v1"
],
"type": [
"VerifiableCredential",
"AgeOver21Credential"
],
"id": "urn:uuid:0938d48d-ff0c-42b9-a9c4-6355b481095b",
"issuer": "did:dht:4mcuhc5merqam9hqq33cmk4k5kzajeq9shxkjydue61nc4em6i4o",
"issuanceDate": "2024-02-23T05:35:23Z",
"credentialSubject": {
"id": "did:dht:urtux8mi7nhtrgiyry5qbwb39ey4mpqidgnq3czkmp4zaoxcm5ty",
"over21": "true"
}
},
"iss": "did:dht:4mcuhc5merqam9hqq33cmk4k5kzajeq9shxkjydue61nc4em6i4o",
"sub": "did:dht:urtux8mi7nhtrgiyry5qbwb39ey4mpqidgnq3czkmp4zaoxcm5ty"
}
Issuer
Holder
Verifier
issues credentials
acquires, stores, and presents
requests, verifies
@techgirl1908
Issuer
Holder
Verifier
issues credentials
acquires, stores, and presents
requests, verifies
Which actor does the Customer play?
HOLDER
@techgirl1908
Issuer
Holder
Verifier
issues credentials
acquires, stores, and presents
requests, verifies
Which does the Delivery App play?
VERIFIER
@techgirl1908
Issuer
Holder
Verifier
issues credentials
acquires, stores, and presents
requests, verifies
Which does the License App play?
ISSUER
@techgirl1908
Issuer
Holder
Verifier
issues credentials
acquires, stores, and presents
requests, verifies
Which does the Vendor play?
VERIFIER
@techgirl1908
const vc = await VerifiableCredential.create({
type: 'AgeOver21Credential',
issuer: issuerDid.uri,
subject: holderDid.uri,
data: {
'over21': 'true'
}
});
const vc_jwt = await vc.sign({ did: issuerDid });
@techgirl1908
const pd = {
"id": "PD-ALCOHOL-AGE-VERIFICATION",
"name": "Alcohol Age Verification",
"purpose": "Verification of legal age to purchase alcohol",
"input_descriptors": [{
"id": "AGE-OVER-21",
"constraints": {
"fields": [{
"path": ["$.credentialSubject.over21"],
"filter": {
"type": "string",
"const": "true"
}
}]
}
}]
};
// Selects matching credentials
const selectedCredentials =
PresentationExchange.selectCredentials({
vcJwts: credentials,
presentationDefinition: pd
});
// Presents selected credentials
const presentationResult =
PresentationExchange.createPresentationFromCredentials({
vcJwts: selectedCredentials,
presentationDefinition: pd
});
@techgirl1908
try{
await VerifiableCredential.verify({ vcJwt: vc });
PresentationExchange.satisfiesPresentationDefinition({
vcJwts: selectedCredentials,
presentationDefinition: presentationDefinition
});
}catch(e){
console.error(e);
}
@techgirl1908
photo credit: verifiablecredentials.dev
@techgirl1908
photo credit: verifiablecredentials.dev
@techgirl1908
💼 proof of employment history
🎓 degree in a field related to Engineering, Computer Science, or Security
OR
🥷🏼 Certified Ethical Hacker certification issued by a specific trusted organization
Employment Application
@techgirl1908
@techgirl1908
photo credit: verifiablecredentials.dev
@techgirl1908
How do I keep my credentials safe?
@techgirl1908
What is the biggest challenge you see with adoption?
@techgirl1908
@techgirl1908
developer.tbd.website
@techgirl1908
By Angie Jones
A practical demonstration of creating and sharing verifiable credentials in the form of JWTs. Learn how these credentials not only enhance efficiency but also uphold privacy in online transactions.
Developer Advocate. International Keynote Speaker. Master Inventor.