BC’s COVID-19 vaccine passport is being distributed primarily via QR code. I love QR codes and wanted to see what was encoded in there.

Regardless of the ethics of everything that is going on, from a technical point of view I was pleased to see that the data are narrowly scoped and that the whole system works without provided data back to a central authority.

BC COVID-19 Vaccine Passport Data Format

The QR code payload is encoded as a JSON web token following the SMART Health Card open spec. When you scan it you get a string starting with shc:/. (This is the same format used in Quebec.)

There is a handy JS project called obrassard/shc-extractor where you can decode that string and inspect it yourself. The code to decode the payload is pretty straightforward.

The payload is signed and can be decoded using the public keys provided by the passport issuer. In the case of BC it’s the Provincial Health Services Authority. You can get the keys from https://smarthealthcard.phsa.ca/v1/issuer/.well-known/jwks.json

The payload contains the person’s

  • first name
  • last name
  • birth date
  • date, location and type of COVID-19 vaccine

There isn’t any other data included in the payload.

Caching the public keys means you can verify vax passport QR codes entirely offline.

Vaccine codes

Each dose of administered vaccine has a specific code. You can inspect the http://snomed.info/sct coding key to see which type of vaccines were administered (source):

  • 28581000087106 – PFIZER-BIONTECH COVID-19 messenger ribonucleic acid 30 micrograms per 0.3 milliliter suspension for dilution for injection Pfizer Canada ULC-BioNTech Manufacturing GmbH (real clinical drug)
  • 28571000087109 – MODERNA COVID-19 messenger ribonucleic acid-1273 100 micrograms per 0.5 milliliter liquid for injection Moderna Therapeutics Inc. (real clinical drug)
  • 28531000087107 – Vaccine product against disease caused by Severe acute respiratory syndrome coronavirus 2 (medicinal product)
  • 1119349007 – Vaccine product containing only Severe acute respiratory syndrome coronavirus 2 messenger ribonucleic acid (medicinal product)

Sample BC Vaccine Passport Contents

{
    "header": {
        "alg": "ES256",
        "zip": "DEF",
        "kid": "XCqxdhhS7SWlPqihaUXovM_FjU65WeoBFGc_ppent0Q"
    },
    "payload": {
        "iss": "https://smarthealthcard.phsa.ca/v1/issuer",
        "nbf": 1630885634,
        "vc": {
            "type": [
                "https://smarthealth.cards#covid19",
                "https://smarthealth.cards#immunization",
                "https://smarthealth.cards#health-card"
            ],
            "credentialSubject": {
                "fhirVersion": "4.0.1",
                "fhirBundle": {
                    "resourceType": "Bundle",
                    "type": "collection",
                    "entry": [
                        {
                            "fullUrl": "resource:0",
                            "resource": {
                                "resourceType": "Patient",
                                "name": [
                                    {
                                        "family": "LASTNAME",
                                        "given": [
                                            "FIRSTNAME"
                                        ]
                                    }
                                ],
                                "birthDate": "1980-01-01"
                            }
                        },
                        {
                            "fullUrl": "resource:1",
                            "resource": {
                                "resourceType": "Immunization",
                                "status": "completed",
                                "vaccineCode": {
                                    "coding": [
                                        {
                                            "system": "http://hl7.org/fhir/sid/cvx",
                                            "code": "208"
                                        },
                                        {
                                            "system": "http://snomed.info/sct",
                                            "code": "28581000087106"
                                        }
                                    ]
                                },
                                "patient": {
                                    "reference": "resource:0"
                                },
                                "occurrenceDateTime": "2021-05-21",
                                "lotNumber": "EW0199",
                                "performer": [
                                    {
                                        "actor": {
                                            "display": "Drop-in Vaccine Clinic"
                                        }
                                    }
                                ]
                            }
                        },
                        {
                            "fullUrl": "resource:2",
                            "resource": {
                                "resourceType": "Immunization",
                                "status": "completed",
                                "vaccineCode": {
                                    "coding": [
                                        {
                                            "system": "http://hl7.org/fhir/sid/cvx",
                                            "code": "208"
                                        },
                                        {
                                            "system": "http://snomed.info/sct",
                                            "code": "28581000087106"
                                        }
                                    ]
                                },
                                "patient": {
                                    "reference": "resource:0"
                                },
                                "occurrenceDateTime": "2021-07-25",
                                "lotNumber": "FD7206",
                                "performer": [
                                    {
                                        "actor": {
                                            "display": "UBC Vax Van"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        }
    },
    "verifications": {
        "trustable": true,
        "verifiedBy": "XCqxdhhS7SWlPqihaUXovM_FjU65WeoBFGc_ppent0Q",
        "origin": "https://smarthealthcard.phsa.ca/v1/issuer"
    }
}

You can also download the sample vaccine passport via a gist.