Run Redbelly Selective Disclosure Verifier Instance¶
To setup Verifier Selective Disclosure instance:
- Clone the
receptor-verifier
repository from Github which implements routes for Proof by Query and Selective Disclosure inverifier-backend
. - Pre-requisites/Assumptions:
- ts-node
Install Dependencies¶
Run Demo¶
Generate Credentials¶
- Run Issuer Instance; the following curl command to generate a Verifiable Credential.
- Fetch the VC from the response generated above and update VC issued by the issuer in
generateSelectiveDisclosureVC.ts
.
Sample Verifiable Credential
{
"id": "b321199a-081a-4fec-8969-44f2ce7f5a47",
"@context": [],
"type": [
"PassportCredential"
],
"credentialSubject": {
"id": "",
"name": "james testeleven",
"passportNumber": "E55173628",
"nationality": "AUS",
"birthDate": 19600101,
"customerReference": "2fcecbfc-a926-cf72-6182-4f475da27b28",
"expiryDate": 20250101,
"publicAddress": "0x9e125dB4B5Af7DBe334aA9653b2829b6F07e0391"
},
"issuer": "did:iden3:polygon:mumbai:x3LXBvzJR4vwV4kHvwSrkBP9PRNYpiLwwTisVEKrZ",
"issuanceDate": "2024-01-31T08:51:26.043Z",
"proof": {
"type": "BbsBlsSignature2020",
"created": "2024-01-31T08:51:26.043Z",
"verificationMethod": "isN5XEv3IZRq/jYMHMrhfM44VN2pvQQnmmrank/TUaPoOlz0YugEzS4EIgVWXJXrFnZJZVtOFPdSObztbIvJajnjcVI78XYCrmnaLSWYj/U0rZr7nbq/rzrt5T5DK8K6",
"proofPurpose": "assertionMethod",
"proofValue": "tKMqSQmcWmwYHQWalV6NorR5GPAfMunOe52BYJr72f4/nr7CcMoEB/REihMOgaZZFvlCUSbB2ucU0Zm5ze7lsToIxPDUvjlORv4P6Uf179BMiyEX41vje8u4jIAmCxJTJBKyZG23hZhfNlBiLaVshw=="
}
}
Generate Selective Disclosure VC¶
- Run Holder Instance; and run the following curl command.
curl --location --request POST 'http://localhost:5000/generate-selective-disclosure-vc' \
--header 'Content-Type: application/json' \
--data-raw '{
"credentialType": "PassportCredential",
"selectiveDisclosureKeys": [
"id",
"name",
"nationality"
]
}'
- Fetch the response with the updated VC, and append below to verify the proof.
Sample SD VC
{
"message": "proof successfully generated and submitted",
"vc": {
"id": "urn:ec809202-1ee4-4edb-9eee-5e12f81c39d9",
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://schema.iden3.io/core/jsonld/iden3proofs.jsonld",
"https://redbellynetwork.github.io/did-schema/passport/credential/v1.jsonld"
],
"type": [
"VerifiableCredential",
"PassportCredential"
],
"credentialSubject": {
"id": "did:iden3:polygon:mumbai:wxS9vNRUyMKgdTvynMr3GJWs2KXQcWdBXvgsrVVUF",
"name": "peter TESTTHIRTEEN",
"nationality": "AUS"
},
"issuer": "did:iden3:polygon:mumbai:wz4h41AB7SowtMhaPshMp6nmumcwrKSi7pAPc3xFf",
"issuanceDate": "2024-01-09T09:30:58.674Z",
"credentialSchema": {
"id": "https://redbellynetwork.github.io/did-schema/passport/credential/PassportCredential-v1.json",
"type": "JsonSchema2023"
},
"credentialStatus": {
"id": "https://rhs.staging.redbelly.network/node?state=3e315b47e6762ab74d29ac30eac833f7b28dbf464276b6f8565fe0a6a0402221",
"type": "Iden3ReverseSparseMerkleTreeProof",
"revocationNonce": 7664
},
"proof": {
"type": "BbsBlsSignature2020",
"created": "2020-04-26T04:21:07Z",
"verificationMethod": "isN5XEv3IZRq/jYMHMrhfM44VN2pvQQnmmrank/TUaPoOlz0YugEzS4EIgVWXJXrFnZJZVtOFPdSObztbIvJajnjcVI78XYCrmnaLSWYj/U0rZr7nbq/rzrt5T5DK8K6",
"proofPurpose": "assertionMethod",
"proofValue": "ABAAgf+qFcChINluV49se81Hj0yOWl+BvxDYNln+NNO2q5qwkgiKN3q5F8VYhaXH72EwU/S20t5uK4HNmgx6jGwCSh3cBLtZ/Hzs4FMWO1JY9xRJju+ofo3+hi5vKSxQMBMoY9uVb7vffytIgYvD34tX5X71KR4/4OcIdmDYKJkTvm/qcTMBaBySUxzXisgR2JHc6BYAAAB0t1q7HUSMwEYtr2WbpvUPRfX3ca0iodUCR37ccf5kQf26pUce9BC/+s79yeQAntLYAAAAAglfGcm1Qy0o1CnJWqQxkUso765dD1CVJXkX0zsdzJWzQQ3dMjKkvta0yYwqDMAd2l3fcKpvCFSX/L5IHcma5UiKokTqQL1XUR+SkxYL9Lu4UhGkDYLnTIfPE5JZCoNNG0qX+BmNdnk/fCFaCJ4z0jMAAAAIbKFrE29NmHdb2sNd9sihYTEjbGCvig4NOTDCiNfgPmRLWBvGc1iU6s7otcMtGX/H3Y+MgWoTOz3X0DZ7/yJwRWcF4cezyJD382Sux7oucgoYae+xeFHSR9c3/I2LzymKMrVfgEBvD3lytSfN6KIkodqZQ4IgjfFaNUePGC0WtWxu8bPAwy7ZVtZVUUnZDzDkyZDSTd9FbOJ7en3FRVYXNGdPU4ksHKhRPNtbDjMyKyB6OkQvCLLnXUtMcms8Q3zzZprO6R9nwcUTe3O19bexRN/2SoEwcSp5/30UDB+D8sMJPj9y9eCP/bXGM25A3xuQu+KrSGiId1U5IcUSrP6bQw==",
"nonce": "bm9uY2U="
}
}
}
Get VC from Holder¶
- Run the following curl command with the updated VC.
curl --location 'http://localhost:4000/verify-vc' \
--header 'Content-Type: application/json' \
--data-raw '{
"vc": holderVC
}'
- The response generated indicates if the proof is verified or not.
Sample Response
- The payload indicates that the user has been verified successfully.