parameter | value |
---|---|
id | “did:” method-name “:” namespace “:” method-specific-id |
method-name | “indy2”, “indy”, “sov”, “ethr” |
namespace | “testnet”/"mainnet" |
indy-id | <issuer_did>/anoncreds/v0/SCHEMA/<schema_name>/<schema_version> |
Example: did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0
- Schemas collection:
- Description: Mapping holding the list of Schema ID's to their data and metadata.
- Format:
mapping(string id => SchemaRecord schemaRecord); struct SchemaRecord { string data; SchemaMetadata metadata; } struct SchemaMetadata { uint256 created; }
- Example:
{ "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0": { schema: "{ "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", "name": "BasicIdentity", "version": "1.0.0", "attrNames": ["First Name", "Last Name"] }", metadata: { created: 1234 }, }, ... }
Schema must match to the specification.
created
- timestamp of schema creation.
Contract name: SchemaRegistry
- Method:
createSchema
- Description: Transaction to create a new AnonCreds Schema
- Parameters:
id
- Id of schema to be createdissuerId
- Id of schema issuerschema
- AnonCreds schema as JSON string
- Restrictions:
- Schema id must be unique.
- Corresponding issuer DID must exist, be active, and owned by sender.
- Format:
SchemaRegistry.createSchema( string calldata id, string calldata issuerId, string calldata schema )
- Example:
SchemaRegistry.createSchema( "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", "{ "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", "name": "BasicIdentity", "version": "1.0.0", "attrNames": ["First Name", "Last Name"] }" )
- Raised Event:
SchemaCreated(schemaId)
- Method:
resolveSchema
- Description: Transaction to resolve Schema for giving id
- Parameters:
id
- ID of the Schema to resolve
- Restrictions:
- Schema must exist.
- Format:
SchemaRegistry.resolveSchema( string id ) returns (SchemaRecord sschemaRecord)
- Example:
SchemaRegistry.resolveSchema( "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0" )
- Raised Event:
None
parameter | value |
---|---|
id | “did:” method-name “:” namespace “:” method-specific-id |
method-name | “indy2”, “indy”, “sov”, “ethr” |
namespace | “testnet”/"mainnet" |
indy-id | <issuer_did>/anoncreds/v0/CLAIM_DEF/<schema_id>/ |
Example: did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/mctc
- Credential Definitions collection:
- Description: Mapping holding the list of Credential Definition ID's to their data and metadata.
- Format:
mapping(string id => CredentialDefinitionRecord credentialDefinitionRecord); struct CredentialDefinitionRecord { string credDef; CredentialDefinitionMetadata metadata; } struct CredentialDefinitionMetadata { uint256 created; }
- Example:
{ "did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/mctc": { credDef: "{ "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", "schemaId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", "type": "CL", "tag": "BasicIdentity", "value": "{ ... }" }", metadata: { created: 1234 }, }, ... }
Schema must match to the specification.
created
- timestamp of credential definition creation.
Contract name: CredentialDefinitionRegistry
- Method:
createCredentialDefinition
- Description: Transaction to create a new AnonCreds Credential Definition
- Parameters:
id
- Id of credential definition to be createdissuerId
- Id of credential definition issuerschemaId
- Id of credential definition schemacredDef
- AnonCreds credential definition as JSON string
- Restrictions:
- Credential Definition must be unique.
- Corresponding issuer DID must exist, be active, and owned by sender.
- Corresponding schema must exist.
- Format:
CredentialDefinitionRegistry.createCredentialDefinition( string calldata id, string calldata issuerId, string calldata schemaId, string calldata credDef )
- Example:
CredentialDefinitionRegistry.createCredentialDefinition( "did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/BasicIdentity", "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", "{ "issuerId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu", "schemaId": "did:indy2:mainnet:Y6LRXGU3ZCpm7yzjVRSaGu/anoncreds/v0/SCHEMA/BasicIdentity/1.0.0", "type": "CL", "tag": "BasicIdentity", "value": "{.......}", }" )
- Raised Event:
CredentialDefinitionCreated(credentialDefinitionId)
- Method:
resolveCredentialDefinition
- Description: Transaction to resolve Credential Definition for giving id
- Parameters:
id
- Id of credential definition to be resolved
- Restrictions:
- Credential Definition must exist.
- Format:
CredentialDefinitionRegistry.resolveCredentialDefinition( string calldata id ) returns (CredentialDefinitionRecord credentialDefinitionRecord)
- Example:
CredentialDefinitionRegistry.resolveCredentialDefinition( "did:indy2:sovrin:Gs6cQcvrtWoZKsbBhD3dQJ/anoncreds/v0/CLAIM_DEF/56495/BasicIdentity" )
- Raised Event:
None