Skip to content

Repository files navigation

DID + PHC

  • nodejs: +v20

node main.js

test API

  • Issue the credentials
curl -X POST http://localhost:3000/v1/issue \
 -H "Content-Type: application/json" \
  -H "X-Service-ID: hospital-A" \
  -d '{
    "subject": {
      "id": "did:phc:soubai",
      "biometricData": "some-secure-biometric-data"
    },
    "healthData": {
      "bloodType": "A+",
      "vaccinations": ["COVID-19", "Flu"],
      "weight" : 77
    }
  }'
  • verify
curl -X POST http://localhost:3000/v1/verify \
  -H "Content-Type: application/json" \
  -d '{
    "proof": {
      "value": "A+",
      "salt": "SALT_VALUE_FROM_ISSUANCE"
    },
    "publicCommitment": "PUBLIC_COMMITMENT_HASH"
  }'
  • generate a service specific pseudonym (hospital-A)
curl -X POST http://localhost:3000/v1/pseudonym \
  -H "Content-Type: application/json" \
 -d '{
    "masterSecret": "YOUR_MASTER_SECRET",
    "serviceId": "hospital-A"
  }'

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages