|
| 1 | +## Fully-Qualified identifiers |
| 2 | + |
| 3 | +General format of fully-qualified identifier is `<prefix>:<method>:<value>`. |
| 4 | +* Prefix: specifies entity type: |
| 5 | + * `did` - DID |
| 6 | + * `schema` - Schema Id |
| 7 | + * `creddef` - Credential Definition Id |
| 8 | + * `revreg` - Revocation registry Id |
| 9 | +* Method: specifies the network this entity belongs to. |
| 10 | +* Value: the main part of identifier. |
| 11 | + |
| 12 | +### Libindy |
| 13 | + |
| 14 | +##### Creation |
| 15 | + |
| 16 | +* use `indy_create_and_store_my_did` function with specifying of `method_name` field inside `did_info` parameter to create fully qualified DID. |
| 17 | + ``` |
| 18 | + (did, verkey) = indy_create_and_store_my_did(..., '{"method_name": "indy"}') |
| 19 | + ``` |
| 20 | +
|
| 21 | +* use `indy_qualify_did` function to update DID stored in the wallet to make it fully qualified, or to do other DID maintenance. |
| 22 | +This functions also updates all DID related entities stored in the wallet to point on new identifier. |
| 23 | + ``` |
| 24 | + fully_qualified_did = indy_qualify_did(did) |
| 25 | + ``` |
| 26 | +
|
| 27 | +Every time you use fully-qualified DID to create a dependent entity like `Schema`, `Credential Definition` or `Revocation Registry Definition` they will have fully qualified form also. |
| 28 | +
|
| 29 | +#### Anoncreds workflow |
| 30 | +
|
| 31 | +As we have released Fully-Qualified identifiers, we can work with both identifier formats in a compatible way. |
| 32 | +There are some cases when Fully-Qualified entity must be converted to Unqualified form. |
| 33 | +You can use `indy_to_unqualified` function for these cases. |
| 34 | +
|
| 35 | +This function can accept the following entities: |
| 36 | +* DID |
| 37 | +* SchemaId |
| 38 | +* CredentialDefinitionId |
| 39 | +* RevocationRegistryId |
| 40 | +* Schema |
| 41 | +* CredentialDefinition |
| 42 | +* RevocationRegistryDefinition |
| 43 | +* CredentialOffer |
| 44 | +* CredentialRequest |
| 45 | +* ProofRequest |
| 46 | +
|
| 47 | +Examples: |
| 48 | +* DID: |
| 49 | + ``` |
| 50 | + indy_to_unqualified("did:sov:NcYxiDXkpYi6ov5FcYDi1e") == "NcYxiDXkpYi6ov5FcYDi1e" |
| 51 | + ``` |
| 52 | +* SchemaId: |
| 53 | + ``` |
| 54 | + indy |
| 55 | + ``` |
| 56 | +* CredentialDefinitionId: |
| 57 | + ``` |
| 58 | + indy_to_unqualified("creddef:sov:did:sov:NcYxiDXkpYi6ov5FcYDi1e:3:CL:schema:sov:did:sov:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag") == "NcYxiDXkpYi6ov5FcYDi1e:3:CL:NcYxiDXkpYi6ov5FcYDi1e:2:gvt:1.0:tag" |
| 59 | + ``` |
| 60 | +
|
| 61 | +
|
| 62 | +Let's consider Credential Issuance and Proof Presentation for different cases. |
| 63 | +
|
| 64 | +* FQ - fully-qualified |
| 65 | +* U - unqualified |
| 66 | +
|
| 67 | +##### Credential Issuance |
| 68 | +
|
| 69 | +* Issuer (FQ) - Holder (U) |
| 70 | + * Issuer creates DID in the fully qualified way. |
| 71 | + Schema and CredentialDefinition created based on this DID will be fully-qualified also. |
| 72 | + There are two cases here: |
| 73 | + * Issuer use Ledger to publish related transactions - these entities will be unqualified automatically. So, Prover and Verifier will get unqualified form from the Ledger. |
| 74 | + * Issuer don't use Ledger - he must call `indy_to_unqualified` with `cred_offer_json` to get unqualified form. |
| 75 | + |
| 76 | + * Issuer creates Credential Offer for Holder using fully-qualified Credential Definition Id. |
| 77 | + The next step Issuer must call `indy_to_unqualified` with `cred_offer_json` to get unqualified form of Credential Offer. |
| 78 | + Issuer must send this unqualified form to Holder and must use it later on credential creation. |
| 79 | + |
| 80 | + * The next steps from Issuer and Holder do as usual. |
| 81 | + Credential will contain unqualified identifiers. |
| 82 | + Holder can make unqualified Proofs. |
| 83 | + |
| 84 | +* Issuer (FQ) - Holder (FQ) |
| 85 | + * All steps Issuer and Holder do as usual. |
| 86 | + All identifiers will be in fully-qualified form. |
| 87 | + Credential will contain fully-qualified identifiers. |
| 88 | + Holder can make as unqualified as fully-qualified Proofs depend on Proof Request. |
| 89 | + |
| 90 | +* Issuer (U) - Holder (U) |
| 91 | + * All steps Issuer and Holder do as usual. |
| 92 | + All identifiers will be in unqualified form. |
| 93 | + Credential will contain unqualified identifiers. |
| 94 | + Holder can make unqualified Proofs. |
| 95 | + |
| 96 | +* Issuer (U) - Holder (FQ) |
| 97 | + * All steps Issuer and Holder do as usual. |
| 98 | + Holder can handle unqualified identifiers as well. |
| 99 | + All identifiers will be in unqualified form. |
| 100 | + Credential will contain unqualified identifiers. |
| 101 | + Holder can make unqualified Proofs. |
| 102 | +
|
| 103 | +##### Proof Presentation |
| 104 | +
|
| 105 | +Proof Requests supports versioning (`ver` field). |
| 106 | +This field specifies whether proof must be full qualified or not. |
| 107 | +This also specifies whether proof request restrictions are full qualified or not: |
| 108 | +- omit or set "1.0" to use unqualified identifiers. |
| 109 | +- set "2.0" to use fully qualified identifiers. |
| 110 | +
|
| 111 | + * All steps Issuer and Holder do as usual. |
| 112 | +
|
| 113 | +
|
| 114 | +
|
| 115 | +* Verifier (FQ) - Prover (U) |
| 116 | + * Verifier should set `ver` field as '1.0' or omit it on Proof Request. |
| 117 | + * if restrictions are fully-qualified Verifier must call `indy_to_unqualified` function with `proof_request_json` to get unqualified form. |
| 118 | + * if there are no restrictions or they are in unqualified form -- no additional steps are needed. |
| 119 | + |
| 120 | + * There are no changes from Prover side on Proof preparation. |
| 121 | + |
| 122 | + * Verifier -- proof verification -- must use *_id's (`schema_id`, `cred_def_id`, `rev_reg_id`) listed in `proof[identifiers]` as the keys for corresponding `schemas_json`, `credential_defs_json`, `rev_reg_defs_json`, `rev_regs_json` objects. |
| 123 | +
|
| 124 | +* Verifier (FQ) - Prover (FQ) |
| 125 | + * Verifier can use as fully-qualified as unqualified format on ProofRequest preparation (set corresponded `ver`). |
| 126 | + - omit or set "1.0" to get unqualified Proof |
| 127 | + - "2.0" to get fully-qualified Proof |
| 128 | + |
| 129 | + * There are no changes from Prover side on Proof preparation. |
| 130 | +
|
| 131 | + * Verifier -- proof verification -- must use *_id's (`schema_id`, `cred_def_id`, `rev_reg_id`) listed in `proof[identifiers]` as the keys for corresponding `schemas_json`, `credential_defs_json`, `rev_reg_defs_json`, `rev_regs_json` objects. |
| 132 | +
|
| 133 | +* Verifier (U) - Prover (FQ) |
| 134 | + * Verifier should set `ver` field as '1.0' or omit it on Proof Request preparation. |
| 135 | + |
| 136 | + * There are no changes from Prover side on Proof preparation. Generated Proof will be in unqualified form. |
| 137 | + |
| 138 | + * All steps Verifier and Prover do as usual. |
| 139 | +
|
| 140 | +* Verifier (U) - Prover (U) |
| 141 | + * All steps Verifier and Prover do as usual. |
| 142 | + All identifiers will be if unqualified form. |
| 143 | +
|
| 144 | +##### Ledger API limitations |
| 145 | +* You can create ledger requests with passing both Fully-Qualified and Unqualified entities. Out requests will be in unqualified form. |
| 146 | +* All Ledger API parsers return entities in unqualified form. |
| 147 | +* Cashing API return result in the same form as used ID. |
| 148 | +
|
| 149 | +
|
| 150 | +### Indy-CLI |
| 151 | +
|
| 152 | +##### Creation |
| 153 | +Use `did new` command with passing `method` parameter to create fully-qualified DID. |
| 154 | +
|
| 155 | +Example: `did new method=indy` |
| 156 | +
|
| 157 | +### Libvcx |
| 158 | +
|
| 159 | +##### Agent provisioning |
| 160 | +1. Prepare provisioning config json. Append `did_method` field to this config. |
| 161 | +2. Call `vcx_provision_agent` function with this config json. As result all generated DIDs will be in fully-qualified form. |
| 162 | +3. Credential Issuance and Proof Presentation related entities will be generated automatically based on the type of remote DID. |
0 commit comments