Skip to content

Commit 2ba2f89

Browse files
authored
feat: accept credentials from SocialKYC on Spiritnet as well (#63)
## fixes KILTProtocol/ticket#3093 Modifies `listOfRequests.ts` in a way that makes the project compatible with the both blockchains, Spiritnet and Peregrine. Now it could be merged into `main` an have all deployments depending on the same branch.
1 parent d1ec728 commit 2ba2f89

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

backend/src/credentials/listOfRequests.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import * as Kilt from '@kiltprotocol/sdk-js'
22

33
// Establish which cTypes our dApp accepts and which attesters we trust:
44

5+
/**
6+
* Usually, attesters have different DIDs depending on the blockchain, i.e. production or testnet.
7+
*
8+
* On the other hand, a cType Hash is calculated from the cType structure.
9+
* If exactly the same structure is used on the test and production chain, the cType Hash will be the same.
10+
*/
11+
512
/**
613
* Email Credential Type attested from SocialKYC.io
714
*/
@@ -11,15 +18,23 @@ export const emailRequest: Kilt.IRequestCredentialContent = {
1118
cTypeHash:
1219
'0x3291bb126e33b4862d421bfaa1d2f272e6cdfc4f96658988fbcffea8914bd9ac',
1320
trustedAttesters: [
14-
'did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY'
21+
/** SocialKYC on the KILT Peregrine (Test) Blockchain: */
22+
'did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY',
23+
/** SocialKYC on the KILT Spiritnet (Production) Blockchain: */
24+
'did:kilt:4pnfkRn5UurBJTW92d9TaVLR2CqJdY4z5HPjrEbpGyBykare'
1525
],
1626
requiredProperties: ['Email']
1727
},
1828
{
29+
// On the future, SocialKYC will use this cType instead.
30+
// which includes "'additionalProperties': false,"
1931
cTypeHash:
2032
'0xae5bc64e500eb576b7b137288cec5d532094e103be46872f1ad54641e477d9fe',
2133
trustedAttesters: [
22-
'did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY'
34+
/** SocialKYC on the KILT Peregrine (Test) Blockchain: */
35+
'did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY',
36+
/** SocialKYC on the KILT Spiritnet (Production) Blockchain: */
37+
'did:kilt:4pnfkRn5UurBJTW92d9TaVLR2CqJdY4z5HPjrEbpGyBykare'
2338
],
2439
requiredProperties: ['Email']
2540
}

0 commit comments

Comments
 (0)