Skip to content

Commit 08db819

Browse files
committed
Align identity statement DID with preliminary implementation in concordium-base
1 parent 6caa897 commit 08db819

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

docs/pages/verifiable-presentations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ const contextValues: GivenContext[] = [{label: 'ResourceID', context: ...}];
243243
// The application holding the credentials selects the credentials to use and creates a DIDString from them.
244244
// This will be a combination of the below, i.e. probably not all at once
245245
const selectedCredentialIds: DIDString[] = [
246-
createIdentityDID(...),
246+
createIdentityStatementDID(...),
247247
createAccountDID(...),
248248
createWeb3IdDID(...),
249249
];

examples/nodejs/proofs/verifiable-presentation-id.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
VerifiablePresentationV1,
99
VerificationAuditRecordV1,
1010
createIdentityCommitmentInputWithHdWallet,
11-
createIdentityDID,
11+
createIdentityStatementDID,
1212
sha256,
1313
streamToList,
1414
} from '@concordium/web-sdk';
@@ -174,7 +174,7 @@ const requestParsed = VerifiablePresentationRequestV1.fromJSON(JSONBig.parse(req
174174
const credentialInput = createIdentityCommitmentInputWithHdWallet(idObject, idp, identityIndex, wallet);
175175

176176
// we select the identity to prove the statement for
177-
const selectedIdentity = createIdentityDID(network, identityProviderIndex, identityIndex); // we unwrap here, as we know the statement exists (we created it just above)
177+
const selectedIdentity = createIdentityStatementDID(network); // we unwrap here, as we know the statement exists (we created it just above)
178178
const idStatement = requestParsed.credentialStatements.find(
179179
(s) => s.type === 'identity'
180180
)! as VerifiablePresentationRequestV1.IdentityStatement; // we unwrap here, as we know the statement exists (we created it just above)

packages/sdk/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- types `IdentityCredentialQualifier`, `IdentityCommitmentInput`, and `CredentialsInputsIdentity` which have been added
1010
to the respective union types that reflect the possible variants.
1111
- helper functions `createIdentityCommitmentInput` and `createIdentityCommitmentInputWithHdWallet`
12-
- helper function `createIdentityDID`
12+
- helper function `createIdentityStatementDID`
1313

1414
- types `VerifiablePresentationV1` and `VerifiablePresentationRequestV1` to be used with the new zero-knowledge proof
1515
protocol

packages/sdk/src/web3-id/proofs.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,17 +564,15 @@ export function createAccountDID(network: Network, credId: string): DIDString {
564564
}
565565

566566
/**
567-
* Creates a DID string for an identity credential.
567+
* Creates a DID string for an identity credential statement.
568568
* Used to build a request for a verifiable credential based on an identity object.
569569
*
570570
* @param network - The Concordium network
571-
* @param identityProviderIndex - The index of the identity provider that issued the identity
572-
* @param identityIndex - The index of the identity
573-
* @returns DID string in format: did:ccd:{network}:id:{identityProviderIndex}:{identityIndex}
571+
* @returns DID string in format: did:ccd:{network}
574572
*/
575573
// TODO: figure out if this matches the identifier.
576-
export function createIdentityDID(network: Network, identityProviderIndex: number, identityIndex: number): DIDString {
577-
return 'did:ccd:' + network.toLowerCase() + ':id:' + identityProviderIndex + ':' + identityIndex;
574+
export function createIdentityStatementDID(network: Network): DIDString {
575+
return 'did:ccd:' + network.toLowerCase();
578576
}
579577

580578
/**

0 commit comments

Comments
 (0)