§ Verifiable Public Registry v4 Specification
Latest draft: spec v4-draft11
Latest stable: spec v3
- Editors:
- Contributors:
- Participate:
§ Abstract
Decentralized trust ecosystems need shared infrastructure to answer a fundamental question: who is authorized to issue, verify, or govern credentials in a given context? Without a common registry layer, each ecosystem operates in isolation, trust decisions depend on ad hoc configurations, and there is no interoperable way for Verifiable Services and Verifiable User Agents to resolve the legitimacy of a credential or its issuer.
The Verifiable Public Registry (VPR) is a decentralized “registry of registries” that provides this foundational infrastructure. It allows ecosystems to create and manage their own trust registries, define credential schemas with fine-grained permission policies, and assign roles — issuers, verifiers, grantors — through a transparent, on-chain governance model.
The VPR exposes a standardized query API that Verifiable Services and Verifiable User Agents use during trust resolution to confirm, in real time, whether a given participant is authorized to perform a specific action under a specific credential schema. This is what makes the trust in Verifiable Trust actually verifiable.
The VPR is DID-method-agnostic — it stores registrations, not validations — leaving trust decisions and cryptographic verification where they belong: with the relying parties. It supports flexible permission management modes (open, ecosystem-controlled, or grantor-delegated), enabling ecosystems to tailor governance to their specific requirements.
This specification defines the data model, API, and normative requirements for implementing and interacting with a Verifiable Public Registry.
§ About this Document
In order to fully understand the concepts developed in this document, you should have some basic knowledge of DID, DIDComm, VS, trust registry, ledger-based applications, and more generally, all terms present in the Terminology section.
Before exploring this spec, it is highly recommended to first read the Verifiable Trust Spec.
§ Introduction
§ What is a Trust Registry?
This section is non-normative.
A trust registry is an approved list of recognized ecosystem participants, such as trust registry operators, credential issuers and verifiers that are authorized to onboard ecosystem participants, and or issue/verify certain credentials in an ecosystem.
A trust registry typically expose APIs that are consumed by services that would like to query its database, and take decisions based on the returned result:
- can participant #1 issue credential for
schemaABC ofecosystemE1? - can participant #2 request credential presentation of credential issued by
issuerDEF fromschemaGHI ofecosystemE2, forjurisdictionFrance incontextCONTEXT?
§ What is a Verifiable Public Registry?
This section is non-normative.
A Verifiable Public Registry (VPR) is a “registry of registries”, a public service that provides foundational infrastructure for decentralized trust ecosystems. It offers:
-
trust registry management:
ecosystems can create and manage their own trust registries, each with:- defined credential schemas
- assigned roles for issuers, verifiers, and grantors (trust registry operators)
- custom business models and permission policies
-
query API for trust resolution:
A standardized API used by verifiable services (VSs) and verifiable user agents (VUAs) to perform trust resolution, enabling them to query registry data and validate roles and permissions in real time.
Permission directory is intended to be crawled by indexers, which resolve the listed DIDs, identify associated verifiable services, and index them.
Indexers may expose this data through APIs for querying the indexed services or use it to build a search engine for querying the database of indexed verifiable services.
§ Conformance
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative. The key words MAY, MUST, MUST NOT, OPTIONAL, RECOMMENDED, REQUIRED, SHOULD, and SHOULD NOT in this document are to be interpreted as described in BCP 14 RFC2119 RFC8174 when, and only when, they appear in all capitals, as shown here.
§ Terminology
- account:
- A verifiable public registry account.
- applicant:
- A account that starts a validation process.
- :
- An group which is the owner of a specific resource in an VPR.
- credential schema:
- An VPR resource which represents a verifiable credential definition and the associated permissions and business rules for issuing, verifying or holding a credential linked to this credential schema.
- credential schema permission:
- A permission, linked to a credential schema, that represent, in a given ecosystem, a grant for being issuer, verifier, issuer grantor, or verifier grantor of a credential schema.
- decentralized identifier:
- A decentralized identifier, as specified in [DID-CORE].
- decentralized identifier communication:
- DIDComm uses DIDs to establish confidential, ongoing connections.
- denom:
- Token that has been configured and is recognized in a VPR, example: uvna, USDC.
- native denom:
- Native token of a VPR, example: uvna.
ecosystem: a network of interacting entities, both technical and human, that work together to establish and maintain digital trust. It encompasses applications, credentials, governance frameworks, and the underlying technical infrastructure, all designed to facilitate trustworthy interactions.
- ecosystem governance framework:
- The governance framework (GF) of an ecosystem].
- :
- The governance authority (GA) of an ecosystem.
- entity:
- An account controller.
- estimated transaction fees:
- Estimated fees required, in denom, that is passed when execute a transaction in an VPR. Usually, a estimated transaction fees are always slightly greater than transaction fees, to make sure the execution of the transaction will not be aborted for an out-of-gas situation. Unused gas is refunded to account.
- governance framework:
- The governance framework (GF) of a VPR.
- :
- The governance authority (GA) of a VPR.
- grantor:
- A role an entity is granted by an ecosystem for operating its trust registry.
- group:
- A verifiable public registry group.
- holder:
- A role an entity might perform by possessing one or more verifiable credentials and generating verifiable presentations from them. A holder is often, but not always, a subject of the verifiable credentials they are holding. Holders store their credentials in credential repositories. Example holders include organizations, persons, things.
- issuer:
- A role an entity is granted by an ecosystem or an issuer grantor for issuing credentials of a given credential schema to holders.
- issuer grantor:
- A trust registry operator role an entity is granted by an ecosystem for a given credential schema for adding or revoking issuers.
- json schema
- a Json Schema, as specified in https://json-schema.org/specification.
- keeper:
- A storage map(key, value) in the ledger of an VPR.
- linked-vp:
- A presentation of a verifiable credential as specified in LINKED-VP.
- participant:
- An entity that is recognized by one or several ecosystem(s) in a VPR.
- query:
- A read-only action that perform some reading in an VPR and returns value.
- subject:
- A thing about which claims are made. Example subjects include human beings, animals, things, and organization, a DID…
- transaction:
- An action that modifies the ledger of an VPR and which execution requires transaction fees.
- transaction fees:
- Fees required, in denom, to execute a transaction in an VPR.
- trust deposit:
- A financial deposit that is used as a trust guarantee. For a given authority, its trust deposit is increased when running validation process (either as an applicant or as a validator).
- trust fee:
- Fees paid by a participant that are distributed to other participants.
- network fee:
- Fees paid by a participant that are distributed to network validators and trust deposit holders.
- trust unit:
- A fake denom that is not usable as a token (cannot be transferred, or used for paying in transactions). Trust unit is used to define fees in Permissions. Fees defined in trust units are automatically converted to native denom when a transaction is executed, using an exchange rate
TU/[[ref: native denom]]. Trust unit is used to compensate native denom fluctuation. - trust registry
- An approved list of issuers and verifiers that are authorized to issue/verify certain credentials in an ecosystem.
- URI
- An Universal Resource Identifier, as specified in rfc3986.
- active permission:
- A credential schema permission of a given type, which effective_from timestamp is lower than current timestamp, and (effective_until timestamp is null or greater than current timestamp), and revoked is null and slashed is null.
- future permission:
- A credential schema permission of a given type, which effective_from timestamp is higher than current timestamp, and (effective_until timestamp is null or greater than effective_from timestamp), and revoked is null and slashed is null.
- validation process:
- A process run by applicants that want to, for a specific credential schema, be a issuer, be a verifier, or simply hold a verifiable credential linked to the credential schema.
- validator:
- A role an entity performs by participating in validation processes with applicants in order to register them as issuer, or verifier of a credential schema, or to deliver a verifiable credential to them.
- verifiable public registry:
- a public, normally decentralized, ledger-based network, which provides: trust registry features, that can be used by all its participants: create trust registries, for each trust registry, define its credential schemas, who can issue, verify credential of a specific credential schema,… and a tokenized business model for charging/rewarding participants.
- verifiable service:
- A service, identified by a resolvable DID that can be deployed anywhere by its owner, and that is conforming to this spec and has a resolvable Proof-of-Trust. See VT Spec.
- verifiable user agent:
- A user agent for accessing and using VSs. To be considered a VUA, a user agent must conform and enforce this spec, such as presenting a proof of trust to end user before accepting connecting to VS compliant services, and refuse connecting to not compliant services. See VT Spec.
- Verifiable Trust Specification:
- see VT Spec.
- verifier:
- A role an entity is granted by an ecosystem or a verifier grantor for verifying credentials of a given credential schema.
- verifier grantor:
- A trust registry operator role an entity is granted by an ecosystem for a given credential schema for adding or revoking verifiers.
- verifiable credential:
- A verifiable credential as defined in [VC-DATA-MODEL].
§ Naming Conventions
§ In this spec
- For clarity, Camel Case is used for naming Modules, Entities, Objects, etc.
§ In Implementations
- All APIs MUST return valid JSON.
- All JSON content MUST use Snake Case for object, attribute… names.
- Object attributes and Json Content in general can be returned in any order.
§ Features of a Verifiable Public Registry (VPR)
§ Trust Registry Management
This section is non-normative.
In an VPR, any authority can create a TrustRegistry entry that represents a trust registry of an ecosystem. Each TrustRegistry entry must provide, at a minimum:
- an ecosystem controlled resolvable DID;
- one or more ecosystem governance framework document(s);
- zero or more credential schemas.
The Verifiable Public Registry (VPR) is agnostic to the specific DID methods used. Trust resolution is performed externally, outside the VPR, allowing flexibility and interoperability across ecosystems.
§ Credential Schemas and Permissions
This section is non-normative.
Credential schemas are created and managed by trust registry authority (ecosystems). Each Credential schema includes, at a minimum:
- A Json Schema that defines the structure of the corresponding verifiable credential
- A PermissionManagementMode for issuance policy, which determines how
ISSUERpermissions are granted. Modes include:OPEN:ISSUERpermissions can be created by anyone.ECOSYSTEM:ISSUERpermissions are granted directly by the ecosystem, the trust registry authorityGRANTOR_VALIDATION:ISSUERpermissions are granted by one or several issuer grantor(s) (trust registry operator(s) responsible for selecting issuers for the credential schema of this ecosystem), selected by the ecosystem.
- A PermissionManagementMode for verification policy, which determines how
VERIFIERpermissions are granted. Modes include:OPEN:VERIFIERpermissions can be created by anyone.ECOSYSTEM:VERIFIERpermissions are granted directly by the ecosystem, the Trust Registry authorityGRANTOR_VALIDATION:VERIFIERpermissions are granted by one or several verifier grantor(s) (trust registry operator(s) responsible for selecting verifiers for the credential schema of this ecosystem), selected by the ecosystem.
- A Permission tree that defines the roles and relationships involved in managing the schema’s lifecycle. Each created permission in the tree can define business rules, see below Business Models.
Participant roles are defined in the table below:
| Participant Role | Description |
|---|---|
| Ecosystem | Create and control trust registries and credential Schemas. Recognize other participants by granting permission(s) to them. |
| Issuer Grantor | Trust Registry operator that grants Issuer permissions to candidate issuers. |
| Verifier Grantor | Trust Registry operator that grants Verifier permissions to candidate verifiers. |
| Issuer | Can issue credentials of this schema. |
| Verifier | Can request presentation of credentials of this schema. |
| Holder | Holds a credential. |
Example of a Json Schema credential schema:
{
"$id": "vpr:verana:mainnet/cs/v1/js/VPR_CREDENTIAL_SCHEMA_ID", // ignored, will be generated
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ExampleCredential",
"description": "ExampleCredential using JsonSchema",
"type": "object",
"properties": {
"credentialSubject": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"firstName": {
"type": "string",
"minLength": 0,
"maxLength": 256
},
"lastName": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"expirationDate": {
"type": "string",
"format": "date"
},
"countryOfResidence": {
"type": "string",
"minLength": 2,
"maxLength": 2
}
},
"required": [
"id",
"lastName",
"birthDate",
"expirationDate",
"countryOfResidence"
]
}
}
}
To participate in an ecosystem and assume a role associated with a specific credential schema:
-
if schema is
OPENfor issuance and/or verification: an entity must have an account in the VPR and self-create its permission. -
if schema is not
OPENfor issuance and/or verification: an entity must have an account in the VPR and complete a validation process to obtain the required permission.
The validation process involves two parties:
- The applicant — the entity requesting permission for a credential schema within the ecosystem.
- The validator — an entity that already holds permission for the same credential schema and has been delegated authority to validate applicants and issue permissions.
Running a validation process typically involves the payment of trust fees. Trust fee amount to be paid by the applicant is defined in the permission of the validator involved in the validation process:
§ DID Indexing
This section is non-normative.
The Permission registry is a can be used by crawlers to index the metadata associated with verifiable services.
Search engines can iterate over the permissions, and index VSs by resolving the service identifier (at the moment a DID, that could be extended in the future), verify if service is a verifiable service, and in such a case extracting their verifiable metadata, such as linked-vp presented credentials.
The index is particularly important for verifiable user agents, such as social browsers, CDN enabled browsers… However, it can also be leveraged by traditional, form-based search engines, which may return simple links for accessing VSs.
§ Business models
§ Trust Deposit
This section is non-normative.
In a VPR, each account is associated with a trust deposit.
This trust deposit is automatically funded through transactions involving trust operations, such as:
- Paying trust fees between participants when enforcing ecosystem governance rules for services, credential issuance, or presentation…
The trust deposit is fundamental to the “Proof-of-Trust” (PoT) mechanism of the Verifiable Trust Specification, and it operates as follows:
- The more you use the VPR, the more your trust deposit grows.
- Trust deposits generate yield: block execution fees are distributed not only to network validators, but also to trust deposit holders.
- network-level penalties: If a participant violates the governance framework of the VPR or engages in fraudulent activity, their trust deposit may be partially or fully slashed by the VPR's governance authority.
- ecosystem-level penalties: If a participant operates within an ecosystem (e.g., as a grantor, issuer, verifier, or holder,…) and fails to comply with that ecosystem’s governance framework (EGF), their ecosystem-specific trust deposit can be slashed by the corresponding ecosystem governance authority.
- A slashed deposit must be refilled to continue using the services that triggered the penalty.
- When a participant withdraws from an ecosystem, the associated accumulated trust deposit may be released.
- Released deposits can be reused in other services or withdrawn, however, withdrawals incur penalties, and a portion of the withdrawn amount is burned.
- Holding a large trust deposit does not grant governance rights in the VPR: participants who generate high transaction volume cannot gain control over the governance of the VPR solely through usage or deposit size.
This system ensures that participation in the trust ecosystem is backed by economic accountability, reinforcing the integrity, governability and verifiability of the VPR.
§ Object creation
This section is non-normative.
The following operations only require payment of network fees (no trust deposit is involved):
-
Trust Registries: requires paying only network fees
-
Credential Schemas: requires paying only network fees
-
Updating the governance framework documents of an ecosystem trust registry
-
Updating a Credential Schema
-
Updating a Trust Registry
-
…
§ Validation process trust fees
This section is non-normative.
We’ve explained in the Credential Schemas and Permissions section above what is a validation process.
The table below summarizes the possible combinations of applicants and validators:
| Payee → Payer ↓ | Ecosystem | Issuer Grantor | Verifier Grantor | Issuer | Verifier | Holder |
|---|---|---|---|---|---|---|
| Issuer Grantor | renewable subscription (1) | |||||
| Verifier Grantor | renewable subscription (2) | |||||
| Issuer | renewable subscription (3) | renewable subscription (1) | ||||
| Verifier | renewable subscription (4) | renewable subscription (2) | ||||
| Holder | renewable subscription |
- (1): if issuer mode is set to GRANTOR_VALIDATION.
- (2): if verifier mode is set to GRANTOR_VALIDATION.
- (3): if issuer mode is set to ECOSYSTEM.
- (4): if verifier mode is set to ECOSYSTEM.
Validation process is started by the applicant.
Example of a candidate issuer (applicant) that would like to be granted an ISSUER permission for a credential schema of an ecosystem, by a validator that has a ISSUER_GRANTOR permission:
The total fees paid by the applicant consists of:
- The validation trust fees defined in the permission of the validator participating in the validation process, plus
- An additional amount equal to the
trust_deposit_rateof that validation trust fees, which is allocated to the applicant’s trust deposit when the validation process begins. - network fees (not part of the escrowed amount).
Example, using 20% for trust_deposit_rate:
Upon completion of the validation process, escrowed trust fees are distributed to the validator as follows:
- A portion defined by
trust_deposit_rateis allocated to the validator’s trust deposit. - The remaining amount is transferred directly to the validator’s wallet.
§ “Pay-Per” trust fees
This section is non-normative.
Pay-per-issuance and pay-per-verification trust fees are defined at the permission level for each role within the ecosystem.
Entities acting as issuers or verifiers for a given credential schema may be required to pay trust fees based on the schema’s configuration and permission tree.
If trust fee payment is required, the entity must execute a transaction in the VPR to pay the appropriate trust fees before issuing or verifying a credential.
Key Points for “Pay-Per” Business Models
-
For a given credential schema, ecosystem and their participants may define pay-per-issuance (or pay-per-verification) trust fees in their respective permissions.
-
In such cases, a participant ISSUER (or VERIFIER) must pay:
- The corresponding issuance (or verification) trust fees for each involved permission;
- An additional amount equal to the
trust_deposit_rateof the calculated trust fees, allocated to the applicant’s trust deposit; - An amount equal to
wallet_user_agent_reward_rateof the calculated trust fees, used to reward the Wallet User Agent; - An amount equal to
user_agent_reward_rateof the calculated trust fees, used to reward the User Agent.
Fee Distribution Model
Trust fees are consistently distributed across participants:
- A portion defined by
trust_deposit_rateis allocated to the participant’s trust deposit. - The remaining portion is transferred directly to the participant’s wallet.
Wallet User Agents and User Agents that implement the VT spec must verify that the ISSUER or VERIFIER has fulfilled the required trust fee payment.
If not, they must reject the issuance or verification request.
Note: The User Agent and Wallet User Agent may refer to the same implementation.
Distribution example for the issuance by ISSUER #C of a credential, using the permission tree above, 20% for trust_deposit_rate, 10% for wallet_user_agent_reward_rate and user_agent_reward_rate.
Distribution example for the verification by VERIFIER #E of a credential issued by ISSUER #C, using the permission tree above, 20% for trust_deposit_rate, 10% for wallet_user_agent_reward_rate and user_agent_reward_rate.
§ Governance of a VPR
This section is non-normative.
A governance framework must define the governance rules that apply to a VPR.
A designated governance authority is responsible for enforcing these rules and, when necessary, applying financial sanctions to participants who violate the rules.
Ecosystem Governance Frameworks (EGFs) operate independently from the VPR governance framework.
While the VPR governance framework defines the global rules for operating the Verifiable Public Registry (e.g., trust deposits, fee distribution, slashing conditions), each ecosystem must define its own EGF to govern roles, permissions, credential policies, and compliance within its specific domain.
This separation ensures that ecosystems remain autonomous and can tailor governance to their unique needs, without being constrained by the global rules of the VPR.
§ Data model
For simplicity, the data model is presented using an object-relational structure. However, this representation may not be optimal for all implementation scenarios.
Implementors are responsible for adapting the data model to suit their chosen architecture.
For example, a key-value store may be more appropriate for a ledger-based implementation than a relational model.
§ TrustRegistry
TrustRegistry:
id(uint64) (mandatory): the id of the trust registry.did(string) (mandatory): the did of the ecosystem.authority(group) (mandatory): group that controls this entry.created(timestamp) (mandatory): timestamp this TrustRegistry has been created.modified(timestamp) (mandatory): timestamp this TrustRegistry has been modified.archived(timestamp) (mandatory): timestamp this TrustRegistry has been archived.aka(string) (optional): optional additional URI of this trust registry.language(string) (mandatory): primary language tag (BCP 47) of this trust registry.active_version(int): (mandatory) active governance framework version.
§ GovernanceFrameworkVersion
GovernanceFrameworkVersion:
id(uint64) (mandatory): the id of the schema.tr_id(uint64) (mandatory): the id of the trust registry that controls thisGovernanceFrameworkVersionentry.created(timestamp) (mandatory): timestamp this GovernanceFrameworkVersion has been created.version(int) (mandatory): version of this GF. MUST Starts with 1.
§ GovernanceFrameworkDocument
GovernanceFrameworkDocument
id(uint64) (mandatory): the id of the schema.gfv_id(uint64) (mandatory): the id of theGovernanceFrameworkVersionentry.created(timestamp) (mandatory): timestamp this GovernanceFrameworkDocument has been created.language(string) (mandatory): primary language tag (BCP 47) of this trust registry.url(string) (mandatory): URL where the document is published.digest_sri(string) (mandatory): digest_sri of the document.
§ CredentialSchema
CredentialSchema:
General Info:
id(uint64) (mandatory): the id of the schema.tr_id(uint64) (mandatory): the id of the trust registry that controls thisCredentialSchemaentry.created(timestamp) (mandatory): timestamp this CredentialSchema has been created.modified(timestamp) (mandatory): timestamp this CredentialSchema has been modified.archived(timestamp) (mandatory): timestamp this CredentialSchema has been archived.json_schema(string) (mandatory): Json Schema used for issuing credentials based on this schema.issuer_grantor_validation_validity_period(number) (mandatory): number of days after which an issuer grantor validation process expires and must be renewed.verifier_grantor_validation_validity_period(number) (mandatory): number of days after which a verifier grantor validation process expires and must be renewed.issuer_validation_validity_period(number) (mandatory): number of days after which an issuer validation process expires and must be renewed.verifier_validation_validity_period(number) (mandatory): number of days after which a verifier validation process expires and must be renewed.holder_validation_validity_period(number) (mandatory): number of days after which an holder validation process expires and must be renewed.issuer_perm_management_mode(PermissionManagementMode) (mandatory): defines how permissions are managed for issuers of thisCredentialSchema. OPEN means anyone can issue credential of this schema; GRANTOR_VALIDATION means a validation process MUST be run between a candidate ISSUER and an ISSUER_GRANTOR in order to create an ISSUER permission; ECOSYSTEM means a validation process MUST be run between a candidate ISSUER and the trust registry owner (ecosystem) of theCredentialSchemaentry in order to create an ISSUER permission;verifier_perm_management_mode(PermissionManagementMode) (mandatory): defines how permissions are managed for verifiers of thisCredentialSchema. OPEN means anyone can verify credentials of this schema (does not implies that a payment is not necessary); GRANTOR_VALIDATION means a validation process MUST be run between a candidate VERIFIER and a VERIFIER_GRANTOR in order to create a VERIFIER permission; ECOSYSTEM means a validation process MUST be run between a candidate VERIFIER and the trust registry owner (ecosystem) of theCredentialSchemaentry in order to create a VERIFIER permission;pricing_asset_type(PricingAssetType) (mandatory): used asset for paying business fees. Can be TU (trust unit), COIN (a token available on the VPR chain), FIAT (means chain is used for settlement only and payment is done off-chain). Not that in all cases, trust deposits are always handled indenom.pricing_asset(string) (mandatory):"tu"ifpricing_asset_typeis set to TU, else examples: COIN:denom"uvna","ufoo","ibc/3A0F9C2E4E2A9B7D6F...","factory/verana1.../ueurv", FIAT:"USD","GBP",…digest_algorithm(string) (mandatory): algorithm used to compute thedigestSRIfor credentials issued under this schema. Valid values are defined in the Verifiable Trust spec.
§ SchemaAuthorizationPolicy
SchemaAuthorizationPolicy:
id(uint64) (mandatory): unique identifier of this authorization policy.schema_id(uint64) (mandatory): id of theCredentialSchemathis policy applies to.created(timestamp) (mandatory): timestamp when this policy entry was created.version(integer) (mandatory): version number of this policy for the given(schema_id, role).role(SchemaAuthorizationPolicyRole) (mandatory): role this policy applies to (ISSUERorVERIFIER).url(string) (mandatory): URL where the policy document is published.digest_sri(string) (mandatory): SRI hash of the policy document, used to guarantee integrity and immutability.effective_from(timestamp) (mandatory): timestamp from which this policy version is in force.effective_until(timestamp) (optional): timestamp until which this policy version is in force, if time-limited.revoked(boolean) (mandatory): indicates whether this policy version has been revoked and must no longer be used.
§ Permission
Permission:
id(uint64) (mandatory): the id of the perm.schema_id(uint64) (mandatory): the id of the relatedCredentialSchemaentry.type(PermissionType): ISSUER, VERIFIER, ISSUER_GRANTOR, VERIFIER_GRANTOR, ECOSYSTEM, HOLDERdid(string) (optional): DID this permission refers to. MUST conform to [RFC3986].authority(group) (mandatory): group that owns this permission.vs_operator(account) (mandatory): verifiable service agent account. This is the account that will have the right to create or update permission sessions.created(timestamp) (mandatory): timestamp thisPermissionhas been created.adjusted(timestamp) (mandatory): timestamp thisPermissionhas been adjusted.slashed(timestamp) (mandatory): timestamp thisPermissionhas been slashed.repaid(timestamp) (mandatory): timestamp thisPermissionhas been repaid.effective_from(timestamp) (optional): timestamp from which (inclusive) thisPermissionis effective.effective_until(timestamp) (optional): timestamp until when (exclusive) thisPermissionis effective, null if no time limit has been set for this permission.modified(timestamp) (mandatory): timestamp this Permission has been modified.validation_fees(number) (mandatory): price to pay by an applicant to a validator (authoritygrantee of this perm) for running a validation process for a given validation period. Must be an integer. Default to 0. Considered unit depends onpricing_asset_typeandpricing_assetconfiguration of related schema.issuance_fees(number) (mandatory): fees requested by granteeauthorityof this perm when a credential is issued. Must be an integer. Default to 0. Considered unit depends onpricing_asset_typeandpricing_assetconfiguration of related schema.verification_fees(number) (mandatory): fees requested by granteeauthorityof this perm when a credential is verified. Must be an integer. Default to 0. Considered unit depends onpricing_asset_typeandpricing_assetconfiguration of related schema.deposit(number) (mandatory): accumulated grantee deposit in the context of the use of this permission (including the validation process), in native denom. Usually, it is incremented when for example, for a ISSUER typePermissionperm, issuer issues credentials that require paying issuance fees: an additional % of the fees is charged to issuer and sent to its deposit, corresponding deposit amount increases thisperm.depositvalue as well. Ifpermis, let’s say revoked, then correspondingperm.depositvalue is freed fromperm.granteeTrust Deposit.slashed_deposit(number) (mandatory): part of the deposit in native denom that has been slashed.repaid_deposit(number) (mandatory): part of the slashed deposit in native denom that has been repaid.revoked(timestamp) (optional): manual revocation timestamp of this Perm.validator_perm_id(uint64) (optional): permission of the validator assigned to the validation process of this permission, ie parent node in thePermissiontree.vp_state(enum) (mandatory): one of PENDING, VALIDATED, TERMINATED.vp_exp(timestamp) (optional): validation expiration timestamp. This expiration timestamp is for the validation process itself, not for the issued credential orPermissionexpiration timestamp.vp_last_state_change(timestamp) (mandatory)vp_validator_deposit: number (optional): accumulated validator trust deposit, in denom.vp_current_fees(number) (mandatory): current action escrowed fees that will be paid to validator upon validation process completion, in denom.vp_current_deposit(number) (mandatory): current action trust deposit, in denom.vp_summary_digest(string) (optional): an optional digest SRI, set by validator, of a summary of the information, proofs… provided by the applicant.issuance_fee_discount: (number) (mandatory): default to 0 (no discount). Maximum 1 (100% discount). Can be set to an ISSUER_GRANTOR, ISSUER permission (if GRANTOR_VALIDATION mode) or an ISSUER permission (ECOSYSTEM mode) to reduce (or void) calculated issuance fees for subtree of permissions. Note: this should generally not be used because it reduces or void commission of all related ecosystem participants.verification_fee_discount: (number) (mandatory): default to 0 (no discount). Maximum 1 (100% discount). Can be set to a VERIFIER_GRANTOR, VERIFIER permission (if GRANTOR_VALIDATION mode) and/or a VERIFIER permission (ECOSYSTEM mode) to reduce (or void) calculated fees for subtree of permissions. Note: this should generally not be used because it reduces or void commission of all related ecosystem participants.vs_operator_authz_enabled: boolean (mandatory): if set to true, authorize this vs_operator to execute CreateOrUpdatePermissionSession on behalf ofauthorityaccount (trust fees will be paid by authority account)vs_operator_authz_spend_limit(DenomAmount[]) (optional): maximum amount of funds that the vs_operator is allowed to spend in the context of this permission as a direct consequence of executing authorized messages.vs_operator_authz_with_feegrant: boolean (mandatory): if set to true, enable feegrant for this permission so vs_operator can pay the fees for CreateOrUpdatePermissionSession withauthorityaccount.vs_operator_authz_fee_spend_limit(DenomAmount[]) (optional): maximum total amount of fees that can be spent by vs_operator in the context of this permission.vs_operator_authz_spend_period: (period) (optional): reset period for vs_operator_authz_spend_limit and vs_operator_authz_fee_spend_limit in the context of this permission.
§ PermissionSession
PermissionSession:
id(uuid) (mandatory): session uuid.authority(group) (mandatory): authority that controls the entry.vs_operator(account) (mandatory): verifiable service agent account that controls the entry (agent crypto account).agent_perm_id(uint64) (mandatory): permission id of the agent.created(timestamp) (mandatory): timestamp this PermissionSession has been created.modified(timestamp) (mandatory): timestamp this PermissionSession has been modified.session_records(PermissionSessionRecord[]) (mandatory): session records, for this session.
§ PermissionSessionRecord
PermissionSessionRecord:
created(timestamp) (mandatory): timestamp this record has been created.issuer_perm_id(uint64) (optional): related issuerPermissionid (if applicable).verifier_perm_id(uint64) (optional): related verifierPermissionid (if applicable).wallet_agent_perm_id(uint64) (optional): related wallet agentPermissionid (if applicable).
§ TrustDeposit
TrustDeposit:
share(number) (mandatory): share of the module total deposit.authority(group) (mandatory) (key): the groupdeposit(number) (mandatory): amount of deposit indenom.claimable(number) (mandatory): amount of claimable deposit indenom.slashed_deposit(number) (optional): amount of slashed deposit indenom.repaid_deposit(number) (optional): amount of slashed deposit indenom.last_slashed(timestamp) (optional): last time this trust deposit has been slashed.last_repaid(timestamp) (optional): last time this trust deposit has been slashed.slash_count(number) (optional): number of times this account has been slashed.
§ DenomAmount
denom(string) (mandatory): token denomination, as explain in denom.amount(number) (mandatory): amount expressed in the given denomination.
§ Digest
digest(string) (mandatory): digest to store.created(timestamp) (mandatory): block execution date of when it was persisted.
§ OperatorAuthorization
authority(group) (mandatory): the authority group granting the authorization.operator(account) (mandatory): the operator account receiving the authorization.msg_types(msg_type[]) (mandatory): list of module message types this authorization applies to.spend_limit(DenomAmount[]) (optional): maximum amount of funds that the grantee is allowed to spend as a direct consequence of executing authorized messages.fee_spend_limit(DenomAmount[]) (optional): maximum total amount of fees that can be paid using this authorization.expiration(timestamp) (optional): timestamp after which the authorization is no longer valid.period(duration) (optional): reset period for spend_limit and fee_spend_limit.
§ FeeGrant
FeeGrant:
grantor(group) (mandatory): the authority group granting the fee allowance.grantee(account) (mandatory): the account that receives the fee grant fromgrantor.msg_types(msg_type[]) (mandatory): list of VPR delegable message types for which the fee allowance applies.spend_limit(DenomAmount[]) (optional): maximum amount of fees that can be spent using this grant.expiration(timestamp) (optional): timestamp after which the fee grant is no longer valid.period(duration) (optional): reset period for spend_limit.
§ VSOperatorAuthorization
authority(group) (mandatory): the authority group granting the authorization.vs_operator(account) (mandatory): the operator account receiving the authorization.permissions[](uint64[]) (mandatory): permission ids for which we grant this authorization.
§ ExchangeRate
Represents an on-chain exchange rate between two assets.
ExchangeRate:
base_asset_type(PricingAssetType, mandatory): Type of the base asset.base_asset(string, mandatory ifbase_asset_typeis COIN or FIAT, null ifbase_asset_typeis TU): Identifier of the base asset.quote_asset_type(PricingAssetType, mandatory): Type of the quote asset.quote_asset(string, mandatory): Identifier of the quote asset.rate(string, mandatory): Fixed-point integer representing the exchange rate from base asset to quote asset.rate_scale(uint32, mandatory): Number of decimal digits used to scale rate.validity_duration(duration, mandatory): when updated, setexpiresto block time plusvalidity_duration.updated(timestamp, mandatory): Timestamp of the last exchange rate update.expires(timestamp, mandatory): Timestamp after which the exchange rate is considered invalid.state(boolean, mandatory): true means enabled, false means disabled.
§ GlobalVariables
GlobalVariables:
Credential Schema:
credential_schema_schema_max_size(number) (mandatory): maximum size of theschemastring attribute for aCredentialSchema.credential_schema_issuer_grantor_validation_validity_period_max_days(number) (mandatory): maximum number of days an issuer grantor validation can be valid for.credential_schema_verifier_grantor_validation_validity_period_max_days(number) (mandatory): maximum number of days an verifier grantor validation can be valid for.credential_schema_issuer_validation_validity_period_max_days(number) (mandatory): maximum number of days an issuer validation can be valid for.credential_schema_verifier_validation_validity_period_max_days(number) (mandatory): maximum number of days an verifier validation can be valid for.credential_schema_holder_validation_validity_period_max_days(number) (mandatory): maximum number of days an holder validation can be valid for.
Trust Deposit:
trust_deposit_share_value(number) (mandatory): Value of one share of trust deposit, in native denom. Default an initial value: 1. Increase over time, when yield is produced.trust_deposit_rate(number) (mandatory): Rate used for dynamically calculating trust deposits from trust fees. Default value: 20% (0.20)trust_deposit_max_yield_rate(number) (mandatory): Maximum yearly yield, in percent, that a trust deposit holder can obtain by receiving block rewards.trust_deposit_block_reward_share(number) (mandatory): Percentage of block reward that must be distributed to trust deposit holders. Default value: 20% (0.20)wallet_user_agent_reward_rate(number) (mandatory): Rate used for dynamically calculating wallet user agent rewards from trust fees. Default value: 20% (0.20)user_agent_reward_rate(number) (mandatory): Rate used for dynamically calculating user agent rewards from trust fees. Default value: 20% (0.20)
§ Module Requirements
All VPR modules MUST, at least, provide:
- A keeper(s), used to access the module’s store(s) and update the state.
- A Msg service, used to process messages when they are routed to the module by BaseApp and trigger state-transitions.
- A query service, used to process user queries.
- Interfaces, for end users to query the subset of the state defined by the module and create messages of the custom types defined in the module.
Note about Query REST API:
- all query methods MUST return valid JSON.
- objects MUST be nested when needed, such as when returning a trust registry.
- JSON formatting MUST obey to data model regarding attribute names. A method that returns a
TrustRegistryentry MUST return an entry called “trust_registry”. A method that returns a list of Trust Registries MUST return an entry called “trustRegistries” that contain a list ofTrustRegistryentries.
Examples:
Get a TrustRegistry
"trust_registry": {
{
"active_version": 0,
"aka": "string",
"authority": "string",
"created": "2025-01-14T19:40:37.967Z",
"deposit": "string",
"did": "string",
"id": "string",
"language": "string",
"modified": "2025-01-14T19:40:37.967Z",
"versions": [
{
"active_since": "2025-01-14T19:40:37.967Z",
"created": "2025-01-14T19:40:37.967Z",
"id": "string",
"tr_id": "string",
"version": 0,
"documents": [
{
"created": "2025-01-14T19:40:37.967Z",
"gfv_id": "string",
"digest_sri": "string",
"id": "string",
"language": "string",
"url": "string"
}
]
}
]
}
"trustRegistries": [ {
{
"active_version": 0,
"aka": "string",
"authority": "string",
"created": "2025-01-14T19:40:37.967Z",
"deposit": "string",
"did": "string",
"id": "string",
"language": "string",
"modified": "2025-01-14T19:40:37.967Z",
"versions": [
{
"active_since": "2025-01-14T19:40:37.967Z",
"created": "2025-01-14T19:40:37.967Z",
"id": "string",
"tr_id": "string",
"version": 0,
"documents": [
{
"created": "2025-01-14T19:40:37.967Z",
"gfv_id": "string",
"digest_sri": "string",
"id": "string",
"language": "string",
"url": "string"
}
]
}
]
}, {
"active_version": 0,
"aka": "string",
"authority": "string",
"created": "2025-01-14T19:40:37.967Z",
"deposit": "string",
"did": "string",
"id": "string",
"language": "string",
"modified": "2025-01-14T19:40:37.967Z",
"versions": [
{
"active_since": "2025-01-14T19:40:37.967Z",
"created": "2025-01-14T19:40:37.967Z",
"id": "string",
"tr_id": "string",
"version": 0,
"documents": [
{
"created": "2025-01-14T19:40:37.967Z",
"gfv_id": "string",
"digest_sri": "string",
"id": "string",
"language": "string",
"url": "string"
}
],
}
]
}
]
For Msg methods, all precondition checks MUST be verified first for accepting the Msg, and MUST be verified again upon method execution
A VPR implementation MUST implement all the following requirements.
The relative REST path is the path suffix. Implementer can set any prefix, like https://example/verana/tr/v1/get.
§ Authorization and Fee Grants
§ Delegable Module Messages
Most VPR module messages (Msg) support delegation and follow the pattern described below.
Delegable messages are defined as messages that can be executed by an operator account on behalf of an authority group, provided that the appropriate authorization has been granted.
Such messages conceptually involve two roles:
-
authority(group):
Thegroupthat owns the created or manipulated resource.
The authority is represented in the Msg through an authorization granted to anoperatoraccount. -
operator(account):
Theaccountthat executes the Msg on behalf of theauthority.
The operator MUST be explicitly authorized for the given message type.
When a delegable message is executed directly by an operator account, both roles are authenticated and enforced by the authorization system.
Using this model makes it possible to:
- identify, within the Msg, both the authenticated
authorityand the executingoperator, - allow network fees to be paid either by the
operatoraccount or by theauthorityaccount via a fee grant.
For the execution of delegable messages:
- the
operatoraccount MUST have a valid authorization from theauthoritygroup for the specific message type being executed.
An authority group is not required to delegate all message types to the same operator.
It is entirely up to the authority group to decide which accounts may execute which messages.
- Authorizations MUST be granted to individual
accounts through group proposals. - Authorizations MAY include an optional
spend_limitand an optionalexpirationdate.
§ Not Delegable Module Messages
Some module messages specify only an authority:
authority(group):
Thegroupthat owns the manipulated resource.
Such messages cannot be delegated and MUST be executed exclusively through a group proposal.
§ Governance-Signed Module Messages
Some module messages can be executed only through a governance proposal.
These messages do not support delegation and are not executable by accounts, whether directly or via group authorization.
§ Fee Grants
An authority group MAY allow its operators to pay network transaction fees using the authority’s funds.
Fee grants are not created directly.
They are created, updated, and revoked exclusively by Authorization module messages.
When an authorization is created or updated, it MAY optionally include an associated fee grant.
§ [AUTHZ-CHECK] Common Authorization and Fee Grant Precondition Checks
For any delegable message executed by an operator on behalf of an authority, the following precondition checks MUST be performed before any method-specific checks. If any check fails, the transaction MUST abort.
§ [AUTHZ-CHECK-1] Operator Authorization checks
- An
OperatorAuthorizationoauthzMUST exist whereoauthz.authority=authority,oauthz.operator=operator, andoauthz.msg_typesincludes the current message type. - If
oauthz.expirationis set, it MUST be in the future. - If
oauthz.spend_limitis set, the remaining balance MUST be sufficient for the operation. After successful execution, the consumed amount MUST be deducted from the remaining balance. - If
oauthz.periodis set and the current period has elapsed since the last reset, the remaining balance MUST be reset tooauthz.spend_limitbefore evaluating the check above.
§ [AUTHZ-CHECK-2] Fee Grant checks
If the transaction fees are paid by the authority account (via fee grant) instead of the operator account:
- A
FeeGrantfgMUST exist wherefg.grantor=authority,fg.grantee=operator, andfg.msg_typesincludes the current message type. - If
fg.expirationis set, it MUST be in the future. - If
fg.spend_limitis set, the remaining balance MUST be sufficient for the estimated transaction fees. After successful execution, the consumed fee amount MUST be deducted from the remaining balance. - If
fg.periodis set and the current period has elapsed since the last reset, the remaining balance MUST be reset tofg.spend_limitbefore evaluating the check above.
§ [AUTHZ-CHECK-3] VS Operator Authorization checks
For CreateOrUpdatePermissionSession, the authorization model differs from other delegable messages: it relies on VSOperatorAuthorization and per-permission settings instead of OperatorAuthorization.
Given an authority, an operator (the vs_operator), and a primary permission perm (determined by the calling method):
- A
VSOperatorAuthorizationvsoMUST exist wherevso.authority=authorityandvso.vs_operator=operator. vso.permissionsMUST includeperm.id.perm.vs_operator_authz_enabledMUST be true.- If
perm.vs_operator_authz_spend_periodis set and the current period has elapsed since the last reset, the remaining balances forperm.vs_operator_authz_spend_limitandperm.vs_operator_authz_fee_spend_limitMUST be reset to their original values before evaluating the checks below. - If
perm.vs_operator_authz_spend_limitis set, the remaining balance MUST be sufficient for the operation. After successful execution, the consumed amount MUST be deducted from the remaining balance.
§ [AUTHZ-CHECK-4] VS Operator Fee Grant checks
If the transaction fees are paid by the authority account (via fee grant) instead of the operator account, using the same primary permission perm:
perm.vs_operator_authz_with_feegrantMUST be true, else abort.- If
perm.vs_operator_authz_spend_periodis set and the current period has elapsed since the last reset, the remaining balance forperm.vs_operator_authz_fee_spend_limitMUST be reset to its original value before evaluating the check below. - If
perm.vs_operator_authz_fee_spend_limitis set, the remaining balance MUST be sufficient for the estimated transaction fees. After successful execution, the consumed fee amount MUST be deducted from the remaining balance.
§ Example
An authority group authorityABC wants to authorize an operator account accountABC to execute the
mod-perm-msg-10-create-or-update-permission-session message.
Additionally, the authority wants accountABC to pay the transaction fees for this message using the authority’s funds.
To achieve this, authorityABC MUST:
- create an authorization from
authorityABCtoaccountABCfor the
mod-perm-msg-10-create-or-update-permission-sessionmessage type,
optionally enabling an associated fee grant.
As a result, accountABC is authorized to:
- execute the specified message type on behalf of
authorityABC, including any state changes and fund movements that are a direct consequence of that message, and - pay the network transaction fees for that message using the funds of
authorityABC, via the associated fee grant.
§ Method List
| Module | Method Name | Relative REST API path | Type | Requirements | Signers |
|---|---|---|---|---|---|
| Trust Registry | Create a Trust Registry | N/A (Tx) | Msg | [MOD-TR-MSG-1] | authority + operator |
| Add Governance Framework Document | N/A (Tx) | Msg | [MOD-TR-MSG-2] | authority + operator | |
| Increase Active Governance Framework Version | N/A (Tx) | Msg | [MOD-TR-MSG-3] | authority + operator | |
| Update Trust Registry | N/A (Tx) | Msg | [MOD-TR-MSG-4] | authority + operator | |
| Archive Trust Registry | N/A (Tx) | Msg | [MOD-TR-MSG-5] | authority + operator | |
| Update TR Module Parameters | N/A (Tx) | Msg | [MOD-TR-MSG-6] | governance proposal | |
| Get Trust Registry | /tr/v1/get | Query | [MOD-TR-QRY-1] | N/A | |
| List Trust Registries | /tr/v1/list | Query | [MOD-TR-QRY-2] | N/A | |
| List TR Module Parameters | /tr/v1/params | Query | [MOD-TR-QRY-3] | N/A | |
| Credential Schema | Create a Credential Schema | N/A (Tx) | Msg | [MOD-CS-MSG-1] | authority + operator |
| Update a Credential Schema | N/A (Tx) | Msg | [MOD-CS-MSG-2] | authority + operator | |
| Archive Credential Schema | N/A (Tx) | Msg | [MOD-CS-MSG-3] | authority + operator | |
| Update CS Module Parameters | N/A (Tx) | Msg | [MOD-CS-MSG-4] | governance proposal | |
| Create Schema Authorization Policy | N/A (Tx) | Msg | [MOD-CS-MSG-5] | authority + operator | |
| Increase Active Schema Authorization Policy Version | N/A (Tx) | Msg | [MOD-CS-MSG-6] | authority + operator | |
| Revoke Schema Authorization Policy | N/A (Tx) | Msg | [MOD-CS-MSG-7] | authority + operator | |
| List Credential Schemas | /cs/v1/list | Query | [MOD-CS-QRY-1] | N/A | |
| Get a Credential Schema | /cs/v1/get | Query | [MOD-CS-QRY-2] | N/A | |
| Render Json Schema | /cs/v1/js/ | Query | [MOD-CS-QRY-3] | N/A | |
| List CS Module Parameters | /cs/v1/params | Query | [MOD-CS-QRY-4] | N/A | |
| Get Schema Authorization Policy | /cs/v1/sap/get | Query | [MOD-CS-QRY-5] | N/A | |
| List Schema Authorization Policies | /cs/v1/sap/list | Query | [MOD-CS-QRY-6] | N/A | |
| Permission | Start Permission VP | N/A (Tx) | Msg | [MOD-PERM-MSG-1] | authority + operator |
| Renew a Permission VP | N/A (Tx) | Msg | [MOD-PERM-MSG-2] | authority + operator | |
| Set Permission VP to Validated | N/A (Tx) | Msg | [MOD-PERM-MSG-3] | authority + operator | |
| Cancel Permission VP Last Request | N/A (Tx) | Msg | [MOD-PERM-MSG-6] | authority + operator | |
| Create Root Permission | N/A (Tx) | Msg | [MOD-PERM-MSG-7] | authority + operator | |
| Adjust Permission | N/A (Tx) | Msg | [MOD-PERM-MSG-8] | authority + operator | |
| Revoke Permission | N/A (Tx) | Msg | [MOD-PERM-MSG-9] | authority + operator | |
| Create or update Permission Session | N/A (Tx) | Msg | [MOD-PERM-MSG-10] | authority + operator | |
| Update Permission Module Parameters | N/A (Tx) | Msg | [MOD-PERM-MSG-11] | governance proposal | |
| Slash Permission Trust Deposit | N/A (Tx) | Msg | [MOD-PERM-MSG-12] | authority + operator | |
| Repay Permission Slashed Trust Deposit | N/A (Tx) | Msg | [MOD-PERM-MSG-13] | authority + operator | |
| Self Create Permission (OPEN mode) | N/A (Tx) | Msg | [MOD-PERM-MSG-14] | authority + operator | |
| List Permissions | /perm/v1/list | Query | [MOD-PERM-QRY-1] | N/A | |
| Get a Permission | /perm/v1/get | Query | [MOD-PERM-QRY-2] | N/A | |
| Find Beneficiaries | /perm/v1/beneficiaries | Query | [MOD-PERM-QRY-4] | N/A | |
| Get Permission Session | /perm/v1/session/get | Query | [MOD-PERM-QRY-5] | N/A | |
| List Permission Module Parameters | /perm/v1/params | Query | [MOD-PERM-QRY-6] | N/A | |
| Trust Deposit | Adjust Trust Deposit | N/A (Tx) | Msg | [MOD-TD-MSG-1] | module call |
| Reclaim Trust Deposit Yield | N/A (Tx) | Msg | [MOD-TD-MSG-2] | authority + operator | |
| Update TD Module Parameters | N/A (Tx) | Msg | [MOD-TD-MSG-4] | governance proposal | |
| Slash Trust Deposit | N/A (Tx) | Msg | [MOD-TD-MSG-5] | governance proposal | |
| Repay Slashed Trust Deposit | N/A (Tx) | Msg | [MOD-TD-MSG-6] | authority + operator | |
| Burn Ecosystem Slashed Trust Deposit | N/A (Tx) | Msg | [MOD-TD-MSG-7] | module call | |
| Get Trust Deposit | /td/v1/get | Query | [MOD-TD-QRY-1] | N/A | |
| List TD Module Parameters | /td/v1/params | Query | [MOD-TD-QRY-2] | N/A | |
| Delegation | Grant Fee Allowance | N/A (Tx) | Msg | [MOD-DE-MSG-1] | module call |
| Revoke Fee Allowance | N/A (Tx) | Msg | [MOD-DE-MSG-2] | module call | |
| Grant Operator Authorization | N/A (Tx) | Msg | [MOD-DE-MSG-3] | authority (group proposal) OR authority + operator OR module call | |
| Revoke Operator Authorization | N/A (Tx) | Msg | [MOD-DE-MSG-4] | authority (group proposal) OR authority + operator OR module call | |
| Grant VS Operator Authorization | N/A (Tx) | Msg | [MOD-DE-MSG-5] | module call | |
| Revoke VS Operator Authorization | N/A (Tx) | Msg | [MOD-DE-MSG-6] | module call | |
| Grant Exchange Rate Authorization | N/A (Tx) | Msg | [MOD-DE-MSG-7] | governance proposal | |
| Revoke Exchange Rate Authorization | N/A (Tx) | Msg | [MOD-DE-MSG-8] | governance proposal | |
| List Operator Authorizations | /de/v1/authz/list | Query | [MOD-DE-QRY-1] | N/A | |
| List VS Operator Authorizations | /de/v1/vs-authz/list | Query | [MOD-DE-QRY-2] | N/A | |
| Digests | Store Digest | N/A (Tx) | Msg | [MOD-DI-MSG-1] | authority + operator OR module call |
| Get Digest | /di/v1/get | Query | [MOD-DI-QRY-1] | N/A | |
| Exchange Rate | Create Exchange Rate | Msg | [MOD-XR-MSG-1] | governance proposal | |
| Update Exchange Rate | Msg | [MOD-XR-MSG-2] | operator | ||
| Toggle Exchange Rate State | Msg | [MOD-XR-MSG-3] | governance proposal | ||
| Get Exchange Rate | /xr/v1/get | Query | [MOD-XR-QRY-1] | N/A | |
| List Exchange Rates | /xr/v1/list | Query | [MOD-XR-QRY-2] | N/A | |
| Get Price | /xr/v1/price | Query | [MOD-XR-QRY-3] | N/A |
Any method failure in the precondition/basic checks SHOULD lead to a CLI ERROR / HTTP BAD REQUEST error with a human readable message giving a clue of the reason why method failed.
§ Trust Registry Module
§ [MOD-TR-MSG-1] Create New Trust Registry
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-TR-MSG-1-1] Create New Trust Registry parameters
An authorized operator that would like to create a trust registry MUST call this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.did(string) (mandatory): the did of the ecosystem that is creating the trust registry.aka(string) (optional): optional additional URI of this trust registry.language(string) (mandatory): primary language tag (BCP 47) of this trust registry.doc_url(string) (mandatory): URL where the document is published.doc_digest_sri(string) (mandatory): digest_sri of the document.
Provided document must be of the same language that the primary language of the trust registry.
§ [MOD-TR-MSG-1-2] Create New Trust Registry precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-TR-MSG-1-2-1] Create New Trust Registry basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
did(string) (mandatory): MUST conform to the DID Syntax, as specified [DID-CORE]. -
aka(string) (optional): optional additional URI of this trust registry. MUST be an URI. -
language(string(17)) (mandatory): MUST be a language tag (BCP 47). -
doc_url(string) (mandatory): MUST be a valid URL . -
doc_digest_sri(string) (mandatory): MUST be a valid digest_sri as specified in integrity of related resources spec. Example:sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26.
It is not a problem if several trust registries are created with the same ecosystem DID. Identifier of a TrustRegistry is its id, and the Verifiable Trust Spec includes the id of the TrustRegistry in the DID Document. DID unique constraint is then not needed: proof of control of the DID is verified by resolving the DID outside of the context of the VPR.
§ [MOD-TR-MSG-1-2-2] Create New Trust Registry fee checks
Fee payer MUST have an available balance to cover the estimated transaction fees.
§ [MOD-TR-MSG-1-3] Create New Trust Registry execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
create and persist a new
TrustRegistryentrytr: -
tr.id: auto-incremented uint64 -
tr.did:did -
tr.authority:authority -
tr.created: current timestamp -
tr.modified:tr.created -
tr.aka:aka -
tr.language:language -
tr.active_version: 1 -
create and persist a new
GovernanceFrameworkVersionentrygfv: -
gfv.id: auto-incremented uint64 -
gfv.tr_id:tr.id -
gfv.created: current timestamp -
gfv.version: 1 -
gfv.active_since: current timestamp -
create and persist a new
GovernanceFrameworkDocumententrygfd: -
gfd.id: auto-incremented uint64 -
gfd.gfv_id:gfv.id -
gfd.created: current timestamp -
gfd.language:language -
gfd.url:doc_url -
gfd.digest_sri:doc_digest_sri
§ [MOD-TR-MSG-2] Add Governance Framework Document
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-TR-MSG-2-1] Add Governance Framework Document parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): the id of the trust registry.doc_language(string) (mandatory): language tag (BCP 47) of the EGF document, provided by the EGA.doc_url(string) (mandatory): URL where the document is published.doc_digest_sri(string) (mandatory): digest_sri of the document.version(int) (mandatory): targeted version.
If for a given language, a document already exists, the execution of this transaction will replace the corresponding entry. Else, a new entry is created. It is only possible to edit future versions. Active version cannot be modified.
§ [MOD-TR-MSG-2-2] Add Governance Framework Document precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-TR-MSG-2-2-1] Add Governance Framework Document basic checks
if a mandatory parameter is not present, method MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. id(uint64) (mandatory): aTrustRegistryentry with this id MUST exist andauthorityexecuting the method MUST be theauthorityof theTrustRegistryentry.version: there MUST exist aGovernanceFrameworkVersionentrygfvwheregfv.tr_idis equal toidandgfv.version=version, orversionMUST be exactly equal to the biggest foundgfv.version+ 1 of allGovernanceFrameworkVersionentries found for thisgfv.tr_idequal toid.versionMUST be greater than thetr.active_version.doc_language(string) (mandatory): MUST be a language tag (BCP 47).doc_url(string) (mandatory): MUST be a valid URL.doc_digest_sri(string) (mandatory): MUST be a valid digest_sri as specified in integrity of related resources spec. Example:sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26.
§ [MOD-TR-MSG-2-2-2] Add Governance Framework Document fee checks
Fee payer MUST have the required estimated transaction fees in its account.
§ [MOD-TR-MSG-2-3] Add Governance Framework Document execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
load GovernanceFrameworkVersion entry gfv for the requested version, or create a new GovernanceFrameworkVersion gfv if required:
-
gfv.id: auto-incremented uint64 -
gfv.tr_id:id -
gfv.created: current timestamp -
gfv.version:version -
gfv.active_since: null -
create and persist or (replace if already exist) a
GovernanceFrameworkDocumententrygfd: -
gfd.id: auto-incremented uint64 -
gfd.gfv_id:gfv.id -
gfd.created: current timestamp -
gfd.language:doc_language -
gfd.url:doc_url -
gfd.digest_sri:doc_digest_sri
§ [MOD-TR-MSG-3] Increase Active Governance Framework Version
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-TR-MSG-3-1] Increase Active Governance Framework Version parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): the id of the trust registry.
§ [MOD-TR-MSG-3-2] Increase Active Governance Framework Version precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-TR-MSG-3-2-1] Increase Active Governance Framework Version basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
id(uint64) (mandatory): aTrustRegistryentry with this id MUST exist andauthorityexecuting the method MUST be theauthorityof theTrustRegistryentry. -
load
TrustRegistryentrytrfrom itsid. Find aGovernanceFrameworkVersionentrygfvwhere version is equal totr.active_version+ 1. If none is found, transaction MUST abort. -
find
GovernanceFrameworkDocumentgfdforgfd.gfv_id=gfv.idandgfd.language=tr.language. If no document is found (and thus no document exist for the default language of this version for this trust registry), transaction MUST abort.
§ [MOD-TR-MSG-3-2-2] Increase Active Governance Framework Version fee checks
Fee payer MUST have the required estimated transaction fees in its account.
§ [MOD-TR-MSG-3-3] Increase Active Governance Framework Version execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- load
TrustRegistryentrytrfrom itsid. Find aGovernanceFrameworkVersionentrygfvwhere version is equal totr.active_version+ 1. If none is found, transaction MUST abort. Else, updatetr.active_versiontotr.active_version+ 1. Settr.modifiedto current timestamp, and setgfv.active_sinceto current timestamp and persist changes.
§ [MOD-TR-MSG-4] Update Trust Registry
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-TR-MSG-4-1] Update Trust Registry parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): the id of the trust registry.did(string) (mandatory): the did of the trust registry.aka(string) (optional): optional additional URI of this trust registry. If null, it means replace existing value with null.
§ [MOD-TR-MSG-4-2] Update Trust Registry precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-TR-MSG-4-2-1] Update Trust Registry basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
id(uint64) (mandatory): aTrustRegistryentrytrwith ididMUST exist andauthorityexecuting the method MUST be theauthorityof theTrustRegistryentrytr. -
did(string) (mandatory): MUST conform to the DID Syntax, as specified [DID-CORE]. -
aka(string) (optional): optional additional URI of this trust registry. MUST be an URI or null.
§ [MOD-TR-MSG-4-2-2] Update Trust Registry fee checks
Fee payer must have available balance in its account to cover the required transaction fees.
§ [MOD-TR-MSG-4-3] Update Trust Registry execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
load
TrustRegistryentrytrfromidand set: -
tr.did:did -
tr.aka:aka -
tr.modified: current timestamp
§ [MOD-TR-MSG-5] Archive Trust Registry
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-TR-MSG-5-1] Archive Trust Registry parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory) id of the trust registry (mandatory);archive(boolean) (mandatory), true means archive, false means unarchive.
§ [MOD-TR-MSG-5-2] Archive Trust Registry precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-TR-MSG-5-2-1] Archive Trust Registry basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
load
TrustRegistrytrfromid.tr.authorityMUST be the authority executing the method, else MUST abort. -
archive(boolean) (mandatory) MUST be a boolean.- If
archiveis true andtr.archivedis not null, MUST abort asTrustRegistryis already archived. - If
archiveis false andtr.archivedis null, MUST abort asTrustRegistryis already not archived.
- If
§ [MOD-TR-MSG-5-2-2] Archive Trust Registry fee checks
Fee payer MUST have an available balance in its account to cover the required transaction fees.
§ [MOD-TR-MSG-5-3] Archive Trust Registry execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- update
TrustRegistryentrytrwithtr.idequal toid: - if
archivedis true: settr.archivedto current timestamp. - if
archivedis false: settr.archivedto null. tr.modified: current timestamp
§ [MOD-TR-MSG-6] Update Module Parameters
Update Module Parameters.
Can only be executed through a governance proposal.
§ [MOD-TR-MSG-6-1] Update Module Parameters parameters
params(KeySet<String, String>): the parameters to update and their values.
§ [MOD-TR-MSG-6-2] Update Module Parameters precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-TR-MSG-6-2-1] Update Module Parameters basic checks
params: size ofparamsMUST be greater than 0. For eachparam<key,value>keyMUST exist, else abort.
§ [MOD-TR-MSG-6-2-2] Update Module Parameters fee checks
provided transaction fees MUST be sufficient for execution
§ [MOD-TR-MSG-6-3] Update Module Parameters execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
for each parameter param <key, value> in parameters:
- update parameter set value =
valuewhere key =key.
§ [MOD-TR-QRY-1] Get Trust Registry
Anyone CAN execute this method.
§ [MOD-TR-QRY-1-1] Get Trust Registry parameters
id(uint64) (mandatory): id of the trust registry.active_gf_only(boolean) (optional): if true, include only current governance framework data. If false or null, returns everything.preferred_language(string) (optional): if set, return only one document per version, with language=preferred_languagewhen possible, else if no document exist with this language, return language. If not set, return all documents of all languages.
§ [MOD-TR-QRY-1-2] Get Trust Registry checks
§ [MOD-TR-QRY-1-3] Get Trust Registry execution
return found TrustRegistry entry (if any), as well as all its nested GovernanceFrameworkVersion and GovernanceFrameworkDocument entries. If active_gf_only is true, return only nested GovernanceFrameworkVersion and GovernanceFrameworkDocument entries for the active version.
§ [MOD-TR-QRY-2] List Trust Registries
§ [MOD-TR-QRY-2-1] List Trust Registries query parameters
The following parameters are optional:
authority(group) (optional): if specified, filter by authority.modified_after(timestamp) (optional): if specified, returns onlyTrustRegistryentries withTrustRegistry.modifiedgreater thanmodified.active_gf_only(boolean) (optional): if true, include only current governance framework data. If false or null, returns everything.preferred_language(string) (optional): if set, return only one document per version, with language=preferred_languagewhen possible, else if no document exist with this language, return language. If not set, return all documents of all languages.response_max_size(small number) (optional): default to 64. Max 1,024.
§ [MOD-TR-QRY-2-2] List Trust Registries query checks
If any of these checks fail, query MUST fail.
response_max_sizemust be between 1 and 1,024. Default to 64 if unspecified.
§ [MOD-TR-QRY-2-3] List Trust Registries execution of the query
If all precondition checks passed, query is executed and result (may be empty) returned. If modified_after is specified, order by modified desc.
§ [MOD-TR-QRY-3] List Module Parameters
Anyone CAN run this query.
§ [MOD-TR-QRY-3-2] List Module Parameters parameters
§ [MOD-TR-QRY-3-2] List Module Parameters query checks
§ [MOD-TR-QRY-3-3] List Module Parameters execution of the query
Return the list of the existing parameters and their values.
§ [MOD-TR-QRY-3-4] List Module Parameters API result example
{
"params": {
"key1": "value1",
"key2": "value2",
...
...
}
}
§ Credential Schema Module
§ [MOD-CS-MSG-1] Create New Credential Schema
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-CS-MSG-1-1] Create New Credential Schema parameters
An account that would like to create a credential schema MUST call this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.tr_idid of the trust registry (mandatory);json_schemathe Json Schema of the credential (mandatory).issuer_grantor_validation_validity_period(mandatory), default to 0 (days).verifier_grantor_validation_validity_period(mandatory), default to 0 (days).issuer_validation_validity_period(mandatory), default to 0 (days).verifier_validation_validity_period(mandatory), default to 0 (days).holder_validation_validity_period(mandatory), default to 0 (days).issuer_perm_management_mode(PermissionManagementMode) (mandatory).verifier_perm_management_mode(PermissionManagementMode) (mandatory).pricing_asset_type(PricingAssetType) (mandatory).pricing_asset(string) (mandatory).digest_algorithm(string) (mandatory): valid values are defined in the Verifiable Trust spec.
§ [MOD-CS-MSG-1-2] Create New Credential Schema precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-CS-MSG-1-2-1] Create New Credential Schema basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
tr_idMUST represent an existingTrustRegistryentrytrandtr.authorityMUST be theauthorityexecuting the method. -
json_schemaMUST be a valid Json Schema, and size must not be greater thanGlobalVariables.credential_schema_schema_max_size.$idof the Json Schema is ignored and will be replaced during execution by the auto-generated id of thisCredentialSchema. -
issuer_grantor_validation_validity_periodmust be between 0 (never expire) andGlobalVariables.credential_schema_issuer_grantor_validation_validity_period_max_daysdays. -
verifier_grantor_validation_validity_periodmust be between 0 (never expire) andGlobalVariables.credential_schema_verifier_grantor_validation_validity_period_max_daysdays. -
issuer_validation_validity_periodmust be between 0 (never expire) andGlobalVariables.credential_schema_issuer_validation_validity_period_max_daysdays. -
verifier_validation_validity_periodmust be between 0 (never expire) andGlobalVariables.credential_schema_verifier_validation_validity_period_max_daysdays. -
holder_validation_validity_periodmust be between 0 (never expire) andGlobalVariables.credential_schema_holder_validation_validity_period_max_daysdays. -
issuer_perm_management_mode(PermissionManagementMode) (mandatory) MUST be a valid PermissionManagementMode. -
verifier_perm_management_mode(PermissionManagementMode) (mandatory) MUST be a valid PermissionManagementMode. -
digest_algorithm(string) (mandatory) MUST be a valid digest algorithm as defined in the Verifiable Trust spec. -
pricing_asset_type(PricingAssetType) (mandatory): used asset for paying business fees. Can be TU (Trust Unit), COIN (a token available on the VPR chain), FIAT (means chain is used for settlement only and payment is done off-chain). Not that in all cases, trust deposits are always handled indenom. -
pricing_asset(string) (mandatory):"tu"ifpricing_asset_typeis set to TU, else examples: COIN:denom"uvna","ufoo","ibc/3A0F9C2E4E2A9B7D6F...","factory/verana1.../ueurv", FIAT:"EUR","GBP",…
When pricing_currency is set to FIAT, pricing_asset MUST be an ISO-4217 currency code. The number of decimals and minor unit semantics MUST follow the ISO-4217 standard for that currency. FIAT amounts MUST be expressed in minor units and MUST NOT be represented as on-chain coins. FIAT metadata SHOULD be pulled from a standard library. It MUST NOT be stored on chain.
§ [MOD-CS-MSG-1-2-2] Create New Credential Schema fee checks
Fee payer MUST have an available balance in its account, to cover the required estimated transaction fees.
§ [MOD-CS-MSG-1-3] Create New Credential Schema execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
create and persist a new
CredentialSchemaentrycs:cs.id: auto-incremented uint64.cs.tr_id: id of theTrustRegistryentry that will be the owner ofcs.cs.json_schema:json_schema, with VPR_CREDENTIAL_SCHEMA_ID string replaced by generatedcs.id, and then canonicalize it using the JSON Canonicalization Scheme (JCS) as defined in RFC 8785. Schema MUST be saved canonized.cs.issuer_grantor_validation_validity_period:issuer_grantor_validation_validity_periodcs.verifier_grantor_validation_validity_period:verifier_grantor_validation_validity_periodcs.issuer_validation_validity_period:issuer_validation_validity_periodcs.verifier_validation_validity_period:verifier_validation_validity_periodcs.holder_validation_validity_period:holder_validation_validity_periodcs.issuer_perm_management_mode:issuer_perm_management_modecs.verifier_perm_management_mode:verifier_perm_management_modecs.created: current timestampcs.modified:cs.created.cs.pricing_asset_type:pricing_asset_typecs.pricing_asset:pricing_assetcs.digest_algorithm:digest_algorithm
If needed, depending on configuration mode, Trust Registry controller MAY need to create a ECOSYSTEM Permission so that validation processes can be run.
§ [MOD-CS-MSG-2] Update Credential Schema
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-CS-MSG-2-1] Update Credential Schema parameters
An account that would like to update a credential schema MUST call this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.idid of the credential schema (mandatory);issuer_grantor_validation_validity_period(mandatory), default to 0 (days).verifier_grantor_validation_validity_period(mandatory), default to 0 (days).issuer_validation_validity_period(mandatory), default to 0 (days).verifier_validation_validity_period(mandatory), default to 0 (days).holder_validation_validity_period(mandatory), default to 0 (days).
other attributes are immutables and cannot be updated.
§ [MOD-CS-MSG-2-2] Update Credential Schema precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-CS-MSG-2-2-1] Update Credential Schema basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
idMUST represent an existingCredentialSchemaentrycs. -
load
TrustRegistrytrfromcs.tr_id.tr.authorityMUST be theauthorityexecuting the method, else MUST abort. -
issuer_grantor_validation_validity_periodMUST be between 0 (never expire) andGlobalVariables.credential_schema_issuer_grantor_validation_validity_period_max_daysdays. -
verifier_grantor_validation_validity_periodMUST be between 0 (never expire) andGlobalVariables.credential_schema_verifier_grantor_validation_validity_period_max_daysdays. -
issuer_validation_validity_periodMUST be between 0 (never expire) andGlobalVariables.credential_schema_issuer_validation_validity_period_max_daysdays. -
verifier_validation_validity_periodMUST be between 0 (never expire) andGlobalVariables.credential_schema_verifier_validation_validity_period_max_daysdays. -
holder_validation_validity_periodMUST be between 0 (never expire) andGlobalVariables.credential_schema_holder_validation_validity_period_max_daysdays.
§ [MOD-CS-MSG-2-2-2] Update Credential Schema fee checks
Fee payer MUST have an available balance in its account to cover the required transaction fees.
§ [MOD-CS-MSG-2-3] Update Credential Schema execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
update
CredentialSchemaentrycswithcs.idequal toid:cs.issuer_grantor_validation_validity_period:issuer_grantor_validation_validity_periodcs.verifier_grantor_validation_validity_period:verifier_grantor_validation_validity_periodcs.issuer_validation_validity_period:issuer_validation_validity_periodcs.verifier_validation_validity_period:verifier_validation_validity_periodcs.holder_validation_validity_period:holder_validation_validity_periodcs.modified: current timestamp.
§ [MOD-CS-MSG-3] Archive Credential Schema
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-CS-MSG-3-1] Archive Credential Schema parameters
An account that would like to archive or unarchive a credential schema MUST call this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory) id of the credential schema (mandatory);archive(boolean) (mandatory), true means archive, false means unarchive.
§ [MOD-CS-MSG-3-2] Archive Credential Schema precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-CS-MSG-3-2-1] Archive Credential Schema basic checks
-
if a mandatory parameter is not present, method MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
idMUST represent an existingCredentialSchemaentrycs. -
load
TrustRegistrytrfromcs.tr_id.tr.authorityMUST be theauthorityexecuting the method, else MUST abort. -
archive(boolean) (mandatory) MUST be a boolean.- If
archiveis true andcs.archivedis not null, MUST abort as Credential Schema is already archived. - If
archiveis false andcs.archivedis null, MUST abort as Credential Schema is already not archived.
- If
§ [MOD-CS-MSG-3-2-2] Archive Credential Schema fee checks
Fee payer MUST have an available balance in its account to cover the required transaction fees.
§ [MOD-CS-MSG-3-3] Archive Credential Schema execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
update
CredentialSchemaentrycswithcs.idequal toid: -
if
archivedis true: setcs.archivedto current timestamp. -
if
archivedis false: setcs.archivedto null. -
set
cs.modifiedto current timestamp.
§ [MOD-CS-MSG-4] Update Module Parameters
Update Module Parameters.
Can only be executed through a governance proposal.
§ [MOD-CS-MSG-4-1] Update Module Parameters parameters
params(KeySet<String, String>): the parameters to update and their values.
§ [MOD-CS-MSG-4-2] Update Module Parameters precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-CS-MSG-4-2-1] Update Module Parameters basic checks
params: size ofparamsMUST be greater than 0. For eachparam<key,value>keyMUST exist, else abort.
§ [MOD-CS-MSG-4-2-2] Update Module Parameters fee checks
provided transaction fees MUST be sufficient for execution
§ [MOD-CS-MSG-4-3] Update Module Parameters execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
for each parameter param <key, value> in parameters:
- update parameter set value =
valuewhere key =key.
§ [MOD-CS-MSG-5] Create Schema Authorization Policy
Any authorized operator CAN execute this method on behalf of an authority.
This message creates a draft SchemaAuthorizationPolicy for a given (schema_id, role), or overwrites the existing draft policy if one already exists.
A draft policy is defined as a policy with effective_from == null and MUST NOT be revoked.
Accordingly, if a credential schema defines one or more active policies for the ISSUER or VERIFIER role, the corresponding authority that grants the ISSUER or VERIFIER role for this schema (ISSUER_GRANTOR, VERIFIER_GRANTOR, or ECOSYSTEM, depending on how schema issuer and verifier modes have been configured) MUST issue an IAC or VAC credential to the candidate upon successful completion of the validation process. Refer to the Verifiable Trust spec for more information.
§ [MOD-CS-MSG-5-1] Create Schema Authorization Policy parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.schema_id(uint64): id of the relatedCredentialSchema(mandatory).role(SchemaAuthorizationPolicyRole):ISSUERorVERIFIER(mandatory).url(string): URL where the policy document is published (mandatory).digest_sri(string): SRI digest of the policy document (mandatory).
§ [MOD-CS-MSG-5-2] Create Schema Authorization Policy precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-CS-MSG-5-2-1] Create Schema Authorization Policy basic checks
- if a mandatory parameter is not present, method MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. schema_idMUST reference an existingCredentialSchemaentry controlled byauthority.roleMUST be a validSchemaAuthorizationPolicyRole.urlMUST be a non-empty valid URI.digest_sriMUST be non-empty.- there MUST NOT exist more than one policy for
(schema_id, role)witheffective_from == nullandrevoked == false.
§ [MOD-CS-MSG-5-2-2] Create Schema Authorization Policy fee checks
Fee payer MUST have an available balance in its account to cover the required estimated transaction fees.
§ [MOD-CS-MSG-5-3] Create Schema Authorization Policy execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs:
- if a draft policy exists for
(schema_id, role):- update the existing policy by setting:
url = urldigest_sri = digest_sri
- update the existing policy by setting:
- otherwise, create and persist a new
SchemaAuthorizationPolicyentrysap:sap.id: auto-incremented uint64sap.schema_id:schema_idsap.role:rolesap.version: max existing version for(schema_id, role)+ 1, or1if none existsap.url:urlsap.digest_sri:digest_srisap.created: current timestampsap.effective_from:nullsap.effective_until:nullsap.revoked:false
§ [MOD-CS-MSG-6] Increase Active Schema Authorization Policy Version
Any authorized operator CAN execute this method on behalf of an authority.
This message activates the current draft SchemaAuthorizationPolicy for the given (schema_id, role) and deactivates any previously active version. Deactivation does not constitute revocation; credentials issued under earlier policies MAY continue to be considered valid.
§ [MOD-CS-MSG-6-1] Increase Active Schema Authorization Policy Version parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.schema_id(uint64): id of the relatedCredentialSchema(mandatory).role(SchemaAuthorizationPolicyRole):ISSUERorVERIFIER(mandatory).
§ [MOD-CS-MSG-6-2] Increase Active Schema Authorization Policy Version precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-CS-MSG-6-2-1] Basic checks
- if a mandatory parameter is not present, method MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. schema_idMUST reference an existingCredentialSchemaentry controlled byauthority.- exactly one draft policy MUST exist for
(schema_id, role)witheffective_from == nullandrevoked == false. - the draft policy MUST have non-empty
urlanddigest_sri.
§ [MOD-CS-MSG-6-2-2] Fee checks
Fee payer MUST have an available balance in its account to cover the required estimated transaction fees.
§ [MOD-CS-MSG-6-3] Increase Active Schema Authorization Policy Version execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks atomically in a transaction:
- let
draftbe the unique policy witheffective_from == nullandrevoked == false. - let
prev_activebe the active policy for(schema_id, role), if any. - set
draft.effective_from = now. - if
prev_activeexists:- set
prev_active.effective_until = now.
- set
§ [MOD-CS-MSG-7] Revoke Schema Authorization Policy
Any authorized operator CAN execute this method on behalf of an authority.
This message revokes a previously enabled SchemaAuthorizationPolicy version. Revoked means previously issued credential that refer to this policy are automatically considered revoked.
§ [MOD-CS-MSG-7-1] Revoke Schema Authorization Policy parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.schema_id(uint64): id of the relatedCredentialSchema(mandatory).role(SchemaAuthorizationPolicyRole):ISSUERorVERIFIER(mandatory).version(integer): policy version to revoke (mandatory).
§ [MOD-CS-MSG-7-2] Revoke Schema Authorization Policy precondition checks
If any of these precondition checks fail, method MUST abort.
§ [MOD-CS-MSG-7-2-1] Basic checks
- if a mandatory parameter is not present, method MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. - a policy MUST exist for
(schema_id, role, version). - the targeted policy MUST have
effective_from != null(a policy that has never been enabled MUST NOT be revoked). - the targeted policy MUST NOT already be revoked.
§ [MOD-CS-MSG-7-2-2] Fee checks
Fee payer MUST have an available balance in its account to cover the required estimated transaction fees.
§ [MOD-CS-MSG-7-3] Revoke Schema Authorization Policy execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following task in a transaction:
- set
revoked = trueon the targetedSchemaAuthorizationPolicyentry.
§ [MOD-CS-QRY-1] List Credential Schemas
§ [MOD-CS-QRY-1-1] List Credential Schemas parameters
tr_id(uint64) (optional): to filter by trust registry id.modified_after(timestamp) (optional): show schemas modified after this timestamp.response_max_size(small number) (optional): default to 64. Max 1,024.only_active(boolean): if set to true, returns only not archived entries.issuer_perm_management_mode(PermissionManagementMode): if set, filter byissuer_perm_management_mode.verifier_perm_management_mode(PermissionManagementMode): if set, filter byverifier_perm_management_mode.
§ [MOD-CS-QRY-1-2] List Credential Schemas checks
modified_aftermust be a timestamp.response_max_sizemust be between 1 and 1,024.
§ [MOD-CS-QRY-1-3] List Credential Schemas execution
return a list of found entry, or an empty list if nothing found. Results MUST be ordered by modified DESC.
§ [MOD-CS-QRY-2] Get Credential Schema
Anyone CAN execute this method.
§ [MOD-CS-QRY-2-1] Get Credential Schema parameters
idof the credential schema (mandatory);
§ [MOD-CS-QRY-2-2] Get Credential Schema checks
idmust be a uint64.
§ [MOD-CS-QRY-2-3] Get Credential Schema execution
return found entry (if any).
§ [MOD-CS-QRY-3] Render Json Schema
Anyone CAN execute this method.
§ [MOD-CS-QRY-3-1] Render Json Schema parameters
idof the credential schema (mandatory);
§ [MOD-CS-QRY-3-2] Render Json Schema checks
idmust be a uint64.
§ [MOD-CS-QRY-3-3] Render Json Schema execution
Render found entry (if any). In case value is returned by a REST API, content type MUST be set to “application/schema+json”.
Schema MUST be rendered cononized, even if it was not created canonized using the JSON Canonicalization Scheme (JCS) as defined in RFC 8785.
§ [MOD-CS-QRY-4] List Module Parameters
Anyone CAN run this query.
§ [MOD-CS-QRY-4-2] List Module Parameters parameters
§ [MOD-CS-QRY-4-2] List Module Parameters query checks
§ [MOD-CS-QRY-4-3] List Module Parameters execution of the query
Return the list of the existing parameters and their values.
§ [MOD-CS-QRY-4-4] List Module Parameters API result example
{
"params": {
"key1": "value1",
"key2": "value2",
...
...
}
}
§ [MOD-CS-QRY-5] Get Schema Authorization Policy
This query returns a single SchemaAuthorizationPolicy identified by its unique id.
§ [MOD-CS-QRY-5-1] Get Schema Authorization Policy parameters
id(uint64): unique identifier of theSchemaAuthorizationPolicy(mandatory).
§ [MOD-CS-QRY-5-2] Get Schema Authorization Policy precondition checks
If any of these precondition checks fail, query MUST abort.
idMUST be provided.- a
SchemaAuthorizationPolicyentry with the givenidMUST exist.
§ [MOD-CS-QRY-5-3] Get Schema Authorization Policy execution
If all precondition checks pass, the query MUST return the corresponding
SchemaAuthorizationPolicy entry:
idschema_idroleversionurldigest_sricreatedeffective_fromeffective_untilrevoked
§ [MOD-CS-QRY-6] List Schema Authorization Policies
This query returns the list of SchemaAuthorizationPolicy entries associated
with a given (schema_id, role) pair.
§ [MOD-CS-QRY-6-1] List Schema Authorization Policies parameters
schema_id(uint64): id of the relatedCredentialSchema(mandatory).role(SchemaAuthorizationPolicyRole):ISSUERorVERIFIER(mandatory).
§ [MOD-CS-QRY-6-2] List Schema Authorization Policies precondition checks
If any of these precondition checks fail, query MUST abort.
schema_idMUST be provided.roleMUST be a validSchemaAuthorizationPolicyRole.schema_idMUST reference an existingCredentialSchemaentry.
§ [MOD-CS-QRY-6-3] List Schema Authorization Policies execution
If all precondition checks pass, the query MUST return the list of
SchemaAuthorizationPolicy entries matching (schema_id, role).
Returned entries MUST include at least the following fields:
idschema_idroleversionurldigest_sricreatedeffective_fromeffective_untilrevoked
Entries MUST be ordered by ascending version.
§ Permission Module
§ Permission Module Overview
This section is non-normative.
Permission are linked to a Credential Schema and representable as a tree.
The ECOSYSTEM type permissions are created by the Credential Schema owner. All other permissions are created by running a Validation Process (or by any account: - for ISSUER permissions if issuer_perm_management_mode is equal to OPEN, - for VERIFIER permissions if verifier_perm_management_mode is equal to OPEN).
A Validation Process (VP) is a process which involves an applicant (which is the authority of validation entry stored in a validation keeper), a validator permission, and optional validation fees plus transaction fees.
Validation is used by applicants that want to:
- be an issuer of a specific credential schema;
- be a verifier of a specific credential schema;
- be an issuer grantor of a specific credential schema;
- be a verifier grantor of a specific credential schema;
- get issued a credential of a specific credential schema;
- optionally get created a HOLDER permission (HOLDER permission may be used in combination with credentials, example for User Agent credentials).
In all cases, the process is very similar. Example execution of a validation process:
- Applicant starts a validation process by running the [start new validation] transaction. Validation process may be subject to paying validation fees, as defined by validator.
- Validation process usually requires that applicant connects to a validation VS identified by its DID, and execute a some validation steps, required for the validation process to conclude.
- If applicant qualifies, validator updates the validation entry by running the [set to validated] transaction, and applicant is granted new permissions, and/or gets issued a credential.
Validation is valid for a specific period, for example 365 days, as configured in the credential schema for credential schema related validations, or set by trust registry for user-agent validation.
In some cases, even if the validation is valid for a period of time, the resulting created permission or issued credential might have a shorter expiration timestamp because the validated attribute(s) might expire before validation expiration: in this case, the applicant must provide updated information to the validator before attribute expiration, in order to get issued an updated new permission and/or an updated credential.
If validation is set to expire, applicant that wishes to extend the expiration timestamp must renew its validation.
At any time, applicant can cancel the validation process.
Some special unexpected situation may arise and must be mitigated. Examples:
- if selected validator permission is revoked while applicant’s validation is in PENDING state: Applicant CAN cancel the validation process [MOD-PERM-MSG-6].
- if selected validator permission is revoked while applicant is in VALIDATED state: Applicant CAN renew the validation process by choosing a new validator [MOD-PERM-MSG-2].
§ [MOD-PERM-MSG-1] Start Permission VP
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-PERM-MSG-1-1] Start Permission VP parameters
An Applicant that would like to start a permission validation process MUST execute this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.vs_operator(account) (optional): the account of the Veriable Service we want to authorize to create permission sessions linked to this permission. If not specified, Verifiable Service will not be able to use the payment delegation feature. Required to use the payment delegation feature.type(PermissionType) (mandatory): (ISSUER_GRANTOR, VERIFIER_GRANTOR, ISSUER, VERIFIER, HOLDER): the permission that the applicant would like to get;validator_perm_id(uint64) (mandatory): the validator permission (parent permission in the tree), chosen by the applicant.validation_fees(number) (optional): Requested validation_fees for this permission (can be modified by validator).issuance_fees(number) (optional): Requested issuance_fees for this permission (can be modified by validator).verification_fees(number) (optional): Requested verification_fees for this permission (can be modified by validator).did(string) (required): MUST conform to the DID Syntax, as specified [DID-CORE].vs_operator_authz_enabled: boolean (mandatory): if set to true authorize this vs_operator to execute CreateOrUpdatePermissionSession on behalf ofauthorityaccount (trust fees will be paid by authority account)vs_operator_authz_spend_limit(DenomAmount[]) (optional): maximum amount of funds that the vs_operator is allowed to spend in the context of this permission. as a direct consequence of executing authorized messages.vs_operator_authz_with_feegrant: boolean (mandatory): if set to true, enable feegrant for this permission so vs_operator can pay the fees for CreateOrUpdatePermissionSession withauthorityaccount.vs_operator_authz_fee_spend_limit(DenomAmount[]) (optional): maximum total amount of fees that can be spent by vs_operator in the context of this permission.vs_operator_authz_spend_period: (period) (optional): reset period for vs_operator_authz_spend_limit and vs_operator_authz_fee_spend_limit in the context of this permission.
Available compatible perms can be found by using an indexer and presented in a front-end so applicant can choose its validator.
§ [MOD-PERM-MSG-1-2] Start Permission VP precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-1-2-1] Start Permission VP basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. type(PermissionType) (mandatory) MUST be a valid PermissionType: ISSUER_GRANTOR, VERIFIER_GRANTOR, ISSUER, VERIFIER, HOLDER.validator_perm_id(uint64) (mandatory): see MOD-PERM-MSG-1-2-2.validation_fees(number) (optional): Requested validation_fees for this permission (can be modified by validator).issuance_fees(number) (optional): Requested issuance_fees for this permission (can be modified by validator).verification_fees(number) (optional): Requested verification_fees for this permission (can be modified by validator).did, if specified, MUST conform to the DID Syntax, as specified [DID-CORE].vs_operator_authz_enabled: boolean (mandatory): if set to true,vs_operatorMUST NOT be null, else abort.vs_operator_authz_spend_limit(DenomAmount[]) (optional): maximum amount of funds that the vs_operator is allowed to spend in the context of this permission. as a direct consequence of executing authorized messages.vs_operator_authz_with_feegrant: boolean (mandatory): if set to true,vs_operatorMUST NOT be null, else abort.vs_operator_authz_fee_spend_limit(DenomAmount[]) (optional): maximum total amount of fees that can be spent by vs_operator in the context of this permission.vs_operator_authz_spend_period: (period) (optional): if not null,vs_operatorMUST NOT be null, else abort. Reset period for vs_operator_authz_spend_limit and vs_operator_authz_fee_spend_limit in the context of this permission.
A holder MAY directly connect to the DID VS of an issuer in order to get issued a credential. It’s up to the issuer to decide if running the validation process is REQUIRED or not.
§ [MOD-PERM-MSG-1-2-2] Start Permission VP permission checks
-
Load
Permissionentryvalidator_permfromvalidator_perm_id. It MUST be a active permission else transaction MUST abort. -
Load
CredentialSchemaentrycsfromvalidator_perm.schema_id. It MUST exist. -
if
type(PermissionType) is equal to ISSUER:-
if
cs.issuer_perm_management_modeis equal to GRANTOR:validator_perm.typeMUST be ISSUER_GRANTOR, else MUST abort. -
else if
cs.issuer_perm_management_modeis equal to ECOSYSTEM:validator_perm.typeMUST be ECOSYSTEM, else MUST abort. -
else MUST abort.
-
-
else if
type(PermissionType) is equal to ISSUER_GRANTOR:-
if
cs.issuer_perm_management_modeis equal to GRANTOR:validator_perm.typeMUST be ECOSYSTEM, else MUST abort. -
else abort.
-
-
else if
type(PermissionType) is equal to VERIFIER:-
if
cs.verifier_perm_management_modeis equal to GRANTOR:validator_perm.typeMUST be VERIFIER_GRANTOR, else MUST abort. -
else if
cs.verifier_perm_management_modeis equal to ECOSYSTEM:validator_perm.typeMUST be ECOSYSTEM, else MUST abort. -
else abort.
-
-
else if
type(PermissionType) is equal to VERIFIER_GRANTOR:-
if
cs.verifier_perm_management_modeis equal to GRANTOR:validator_perm.typeMUST be ECOSYSTEM, else MUST abort. -
else abort.
-
-
else if
type(PermissionType) is equal to HOLDER:-
if
cs.verifier_perm_management_modeis equal to GRANTOR or ECOSYSTEM:validator_perm.typeMUST be ISSUER, else MUST abort. -
else abort.
-
At the end, if a active permission validator_perm is not found, transaction MUST abort.
§ [MOD-PERM-MSG-1-2-3] Start Permission VP fee checks
-
Load
Permissionentryvalidator_permfromvalidator_perm_id. -
Load
CredentialSchemaentrycsfromvalidator_perm.schema_id. -
Fee payer MUST have an available balance in its account, to cover the estimated transaction fees;
If a conversion is needed below, use Get Price to convert amounts to native denom:
- For trust fees:
if (cs.pricing_asset_type, cs.pricing_asset) is set to (COIN, [[ref: native denom]]):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom=validator_perm.validation_feesin native denom. - the required
validation_trust_deposit_in_native_denom:validation_fees_in_denom*GlobalVariables.trust_deposit_ratein native denom.
- the required
else if (cs.pricing_asset_type, cs.pricing_asset) is set to (TU, "tu"):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom= getPrice(cs.pricing_asset_type,cs.pricing_asset,COIN,[[ref: native denom]],validator_perm.validation_fees) in native denom; - the required
validation_trust_deposit_in_native_denom:validation_fees_in_denom*GlobalVariables.trust_deposit_ratein native denom.
- the required
else if (cs.pricing_asset_type, cs.pricing_asset) is set to an arbitrary coin (COIN, [[ref: denom]]):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom=validator_perm.validation_feesin specified (cs.pricing_asset_type, cs.pricing_asset) - the required
validation_trust_deposit_in_native_denom: getPrice(cs.pricing_asset_type,cs.pricing_asset,COIN,[[ref: native denom]],validation_fees_in_denom) *GlobalVariables.trust_deposit_ratein native denom.
- the required
else if (cs.pricing_asset_type, cs.pricing_asset) is set to an arbitrary coin (FIAT, [[ref: denom]]):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom= 0 in native denom. - the required
validation_trust_deposit_in_native_denom: getPrice(cs.pricing_asset_type,cs.pricing_asset,COIN,[[ref: native denom]],validator_perm.validation_fees) *GlobalVariables.trust_deposit_ratein native denom.
- the required
Trust deposit MUST always be paid in native denom
§ [MOD-PERM-MSG-1-2-4] Start Permission VP overlap checks
We want to make sure that 2 validation processes cannot be active at the same time in the same context. This does not prevent an authority from running different VP with differents validators for the same schema_id, type.
Find all permission perms[] for schema_id, type, validator_perm_id, authority with vp_state = VALIDATED or PENDING.
if size of perms[] > 0, it means there is already an existing validation process in this context, so MUST abort.
note: this check was not present in v3.
§ [MOD-PERM-MSG-1-3] Start Permission VP execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
Load
Permissionentryvalidator_permof the selected validator. -
calculate
validation_fees_in_denomandvalidation_trust_deposit_in_native_denomas explained above in fee checks. -
use [MOD-TD-MSG-1] to increase by
validation_trust_deposit_in_native_denomthe trust deposit ofauthorityrunning the method and transfer the corresponding amount toTrustDepositmodule. -
send
validation_fees_in_denomto validation escrow account, if greater than 0. -
define
now: current timestamp. -
create an persist a new permission entry
applicant_perm:applicant_perm.id: auto-incremented uint64.applicant_perm.schema_id=validator_perm.schema_idapplicant_perm.authority:authority.applicant_perm.vs_operator:vs_operator.applicant_perm.type:type.applicant_perm.created:nowapplicant_perm.modified:nowapplicant_perm.deposit:validation_trust_deposit_in_native_denom.applicant_perm.validation_fees:validation_fees.applicant_perm.issuance_fees:issuance_fees.applicant_perm.verification_fees:verification_fees.applicant_perm.validator_perm_id:validator_perm_id.applicant_perm.vp_last_state_change:nowapplicant_perm.vp_state: PENDING.applicant_perm.vp_current_fees(number):validation_fees_in_denom.applicant_perm.vp_current_deposit(number):validation_trust_deposit_in_native_denom.applicant_perm.vp_summary_digest: null.applicant_perm.vp_validator_deposit: 0.applicant_perm.vs_operator_authz_enabled:vs_operator_authz_enabledapplicant_perm.vs_operator_authz_spend_limit:vs_operator_authz_spend_limitapplicant_perm.vs_operator_authz_with_feegrant:vs_operator_authz_with_feegrantapplicant_perm.vs_operator_authz_fee_spend_limit:vs_operator_authz_fee_spend_limitapplicant_perm.vs_operator_authz_spend_period:vs_operator_authz_spend_period
§ Connecting to the VS of the Validator
This section is non-normative, and provided for understanding only.
This action must be initiated by the applicant.
During a validation process, if the associated validator_perm includes a specific did, the applicant should establish a secure connection with the validator’s VS (Verifiable Service) using a secure communication protocol such as DIDComm.
Upon connecting to the VS, the applicant should be required by the validator to complete one or more of the following tasks:
- Prove control over the
vs_operatoraccount specifid in the permission (e.g., via blind signature or cryptographic challenge). - Provide requested information, such as filling out forms, submitting documents, or other forms of disclosure as required by the validation VS.
- If the requested permission includes a VS DID, the applicant should prove control over the corresponding DID to the validator’s VS.
Once the validator determines that the process is complete, they may terminate the validation process and create the permission accordingly. This permission configuration usually include:
validation_feesissuance_feesverification_feespermission expiration
The validator may compile a summary file of the validation process, documenting exchanged data, proofs, and decisions, and share it with the applicant via the VS connection or another secure channel.
For audit or governance purposes, the validator should register a digest (e.g., hash or SRI) of this summary in applicant_perm.vp_summary_digest.
§ [MOD-PERM-MSG-2] Renew Permission VP
Any authorized operator CAN execute this method on behalf of an authority.
This section is non-normative.
- Requesting a renewal has no effect on permission expiration or issued credentials.
- Renewal is only possible with the same validator.
- If validator permission is not valid anymore, applicant MUST perform a new validation process with another validator.
- Renewal does not allow changing the
perm.validation_fees,perm.issuance_fees,perm.verification_fees. To change these values, applicant MUST start a new validation process.
§ [MOD-PERM-MSG-2-1] Renew Permission VP parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of the permission for which applicant would like to renew the validation process;
§ [MOD-PERM-MSG-2-2] Renew Permission VP precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-2-2-1] Renew Permission VP basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. idMUST be a valid uint64 and a permission entry with the same id MUST exist.
§ [MOD-PERM-MSG-2-2-2] Renew Permission VP permission checks
- Load
Permissionentryapplicant_perm.authorityrunning the operation MUST beapplicant_perm.authority, else MUST abort.applicant_permMUST be a active permission. - Load
Permissionentryvalidator_permfromapplicant_perm.validator_perm_id. It MUST exist, and be a active permission, else MUST abort.
§ [MOD-PERM-MSG-2-2-3] Renew Permission VP fee checks
-
Load
Permissionentryvalidator_permfromapplicant_perm.validator_perm_id. -
Load
CredentialSchemaentrycsfromvalidator_perm.schema_id. -
Fee payer MUST have an available balance in its account, to cover the estimated transaction fees;
If a conversion is needed below, use Get Price to convert amounts to native denom:
- For trust fees:
if (cs.pricing_asset_type, cs.pricing_asset) is set to (COIN, [[ref: native denom]]):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom=validator_perm.validation_feesin native denom. - the required
validation_trust_deposit_in_native_denom:validation_fees_in_denom*GlobalVariables.trust_deposit_ratein native denom.
- the required
else if (cs.pricing_asset_type, cs.pricing_asset) is set to (TU, "tu"):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom= getPrice(cs.pricing_asset_type,cs.pricing_asset,COIN,[[ref: native denom]],validator_perm.validation_fees) in native denom; - the required
validation_trust_deposit_in_native_denom:validation_fees_in_denom*GlobalVariables.trust_deposit_ratein native denom.
- the required
else if (cs.pricing_asset_type, cs.pricing_asset) is set to an arbitrary coin (COIN, [[ref: denom]]):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom=validator_perm.validation_feesin specified (cs.pricing_asset_type, cs.pricing_asset) - the required
validation_trust_deposit_in_native_denom: getPrice(cs.pricing_asset_type,cs.pricing_asset,COIN,[[ref: native denom]],validation_fees_in_denom) *GlobalVariables.trust_deposit_ratein native denom.
- the required
else if (cs.pricing_asset_type, cs.pricing_asset) is set to an arbitrary coin (FIAT, [[ref: denom]]):
authorityMUST have an available balance in its account, to cover the following trust fees.- the required
validation_fees_in_denom= 0 in native denom. - the required
validation_trust_deposit_in_native_denom: getPrice(cs.pricing_asset_type,cs.pricing_asset,COIN,[[ref: native denom]],validator_perm.validation_fees) *GlobalVariables.trust_deposit_ratein native denom.
- the required
Trust deposit MUST always be paid in native denom
§ [MOD-PERM-MSG-2-3] Renew Permission VP execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
Load
Permissionentryapplicant_perm. -
Load
Permissionentryvalidator_permfromapplicant_perm.validator_perm_id. -
calculate
validation_fees_in_denomandvalidation_trust_deposit_in_native_denomas explained above in fee checks. -
use [MOD-TD-MSG-1] to increase by
validation_trust_deposit_in_native_denomthe trust deposit ofauthorityrunning the method and transfer the corresponding amount toTrustDepositmodule. -
send
validation_fees_in_denomto validation escrow account, if greater than 0. -
define
now: current timestamp. -
update permission entry:
applicant_perm.vp_state: PENDING.applicant_perm.vp_last_state_change: current timestamp.applicant_perm.deposit:applicant_perm.deposit+validation_trust_deposit_in_native_denom.applicant_perm.vp_current_fees(number):validation_fees_in_denom.applicant_perm.vp_current_deposit(number):validation_trust_deposit_in_native_denom.applicant_perm.modified:now
§ [MOD-PERM-MSG-3] Set Permission VP to Validated
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-PERM-MSG-3-1] Set Permission VP to Validated parameters
An account that would like to set a validation entry to VALIDATED MUST execute this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of the validation process;effective_until(timestamp) (optional): timestamp until when (exclusive) thisPermissionis effective, null if no time limit should been set for this permission or if we want it to be aligned with the validation process expiration timestamp calculated by this method.validation_fees(number) (mandatory): Agreed validation_fees for this permission. Can be set only the first time this method is called (cannot be set for renewals). Use 0 for no fees.issuance_fees(number) (mandatory): Agreed issuance_fees for this permission. Can be set only the first time this method is called (cannot be set for renewals). Use 0 for no fees.verification_fees(number) (mandatory): Agreed verification_fees for this permission. Can be set only the first time this method is called (cannot be set for renewals). Use 0 for no fees.vp_summary_digest(string) (optional): an optional digest, set by validator, of a summary of the information, proofs… provided by the applicant.issuance_fee_discount: (number) (mandatory): use 0 for no discount. Maximum 1 (100% discount). Can be set to an ISSUER_GRANTOR, ISSUER permission (if GRANTOR_VALIDATION mode) or an ISSUER permission (ECOSYSTEM mode) to reduce (or void) calculated issuance fees for subtree of permissions. Note: this should generally not be used because it reduces or void commission of all related ecosystem participants.verification_fee_discount: (number) (mandatory): use 0 for no discount. Maximum 1 (100% discount). Can be set to a VERIFIER_GRANTOR, VERIFIER permission (if GRANTOR_VALIDATION mode) and/or a VERIFIER permission (ECOSYSTEM mode) to reduce (or void) calculated fees for subtree of permissions. Note: this should generally not be used because it reduces or void commission of all related ecosystem participants.
§ [MOD-PERM-MSG-3-2] Set Permission VP to Validated precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-3-2-1] Set Permission VP to Validated basic checks
if a mandatory parameter is not present, transaction MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
idMUST be a valid uint64. -
Load
Permissionentryapplicant_permfromid. If no entry found, abort. -
applicant_perm.vp_stateMUST be equal to PENDING, else abort. -
validation_fees(number) (mandatory): MUST be zero or a positive integer. Ifapplicant_perm.effective_fromis not null (we are in renewal)validation_feesMUST be equal toapplicant_perm.validation_fees, else abort. -
issuance_fees(number) (mandatory): MUST be zero or a positive integer. Ifapplicant_perm.effective_fromis not null (we are in renewal)issuance_feesMUST be equal toapplicant_perm.issuance_feesor, else abort. -
verification_fees(number) (mandatory): MUST be zero or a positive integer. Ifapplicant_perm.effective_fromis not null (we are in renewal)verification_feesMUST be equal toapplicant_perm.verification_fees, else abort. -
vp_summary_digest(string) (optional): MUST be null ifvalidation.typeis set to HOLDER (for HOLDER, proofs can be stored in credentials). Else, MUST be a valid digest. Example:sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26. -
Load
CredentialSchemacsfromapplicant_perm.schema_id. -
Load
Permissionvalidator_permfromapplicant_perm.validator_perm_id. -
issuance_fee_discount: (number) (mandatory):- if
applicant_perm.effective_fromis not null (renewal), thenissuance_fee_discountmust be equal toapplicant_perm.issuance_fee_discountelse MUST abort. - if
cs.issuer_perm_management_modeis set to GRANTOR_VALIDATION:- if
applicant_perm.type== ISSUER_GRANTOR:issuance_fee_discountcan be set between 0 (no discount) and 1 (100% discount) inclusive. - if
applicant_perm.type== ISSUER: ifvalidator_perm.issuance_fee_discountis defined,issuance_fee_discountcan be set between 0 (no discount) andvalidator_perm.issuance_fee_discount(100% discount) inclusive.
- if
- if
cs.issuer_perm_management_modeis set to ECOSYSTEM:- if
applicant_perm.type== ISSUER:issuance_fee_discountcan be set between 0 (no discount) and 1 (100% discount) inclusive.
- if
- else MUST abort.
- if
-
verification_fee_discount: (number) (mandatory):- if
applicant_perm.effective_fromis not null (renewal), thenverification_fee_discountmust be equal toapplicant_perm.verification_fee_discountelse MUST abort. - if
cs.verifier_perm_management_modeis set to GRANTOR_VALIDATION:- if
applicant_perm.type== VERIFIER_GRANTOR:verification_fee_discountcan be set between 0 (no discount) and 1 (100% discount) inclusive. - if
applicant_perm.type== VERIFIER: ifvalidator_perm.verification_fee_discountis defined,verification_fee_discountcan be set between 0 (no discount) andvalidator_perm.verification_fee_discount(100% discount) inclusive.
- if
- if
cs.verifier_perm_management_modeis set to ECOSYSTEM:- if
applicant_perm.type== VERIFIER:verification_fee_discountcan be set between 0 (no discount) and 1 (100% discount) inclusive.
- if
- else MUST abort.
- if
Calculation of vp_exp, the validation process expiration timestamp, required to verify provided effective_until:
-
let’s define
validity_period=cs.issuer_grantor_validation_validity_period(ifapplicant_perm.typeis ISSUER_GRANTOR),cs.verifier_grantor_validation_validity_period(ifapplicant_perm.typeis VERIFIER_GRANTOR),cs.issuer_validation_validity_period(ifapplicant_perm.typeis ISSUER),cs.verifier_validation_validity_period(ifapplicant_perm.typeis VERIFIER), orcs.holder_validation_validity_period(ifapplicant_perm.typeis HOLDER). -
if
validity_periodis NULL:vp_exp= NULL. -
else if
applicant_perm.vp_expis null,vp_exp= timestamp of now() plusvalidity_period. -
else
vp_exp=applicant_perm.vp_expplusvalidity_period
Now, let’s verify effective_until:
- if
effective_untilis NULL, no issue. - else if
applicant_perm.effective_untilis NULL,effective_untilMUST be greater than current current timestamp AND, ifvp_expis not null, lower or equal tovp_exp. - else
effective_untilMUST be greater thanapplicant_perm.effective_untilAND, ifvp_expis not null, lower or equal tovp_exp.
§ [MOD-PERM-MSG-3-2-2] Set Permission VP to Validated validator perms
- load
validator_permfromapplicant_perm.validator_perm_id.validator_permMUST be a active permission. authorityrunning the method MUST bevalidator_perm.authority.
If validator_perm is not a active permission (expired, revoked, slashed…) then applicant MUST start a new validation process.
§ [MOD-PERM-MSG-3-2-3] Set Permission VP to Validated fee checks
- Fee payer MUST have the required estimated transaction fees in its account, else transaction MUST abort.
- if
applicant_perm.vp_current_feesis not in native denom,authorityaccount MUST haveapplicant_perm.vp_current_depositavailable in native denom on its account for paying the trust deposit.
§ [MOD-PERM-MSG-3-2-4] Set Permission VP to Validated overlap checks
We want to make sure that 2 permissions cannot be active at the same time for the same validator_perm_id. That should not occur in this method, but better do the check anyway.
Find all active permissions perms[] (not revoked, not slashed, not repaid) for schema_id, type, validator_perm_id, authority.
for each Permission entry p from perms[]:
- if
p.effective_untilis greater thaneffective_from, method execution MUST abort. - if
p.effective_fromis lower thaneffective_until, method execution MUST abort. - if
p.effective_untilis NULL (never expire), creation of a new permission doesn’t make any sense and method execution MUST abort.
note: this check was not present in v3.
§ [MOD-PERM-MSG-3-3] Set Permission VP to Validated execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- Load
Permissionentryapplicant_permfromid. - Load
Permissionentryvalidator_permfromapplicant_perm.validator_perm_id. - define
nowtimestamp of now().
Calculate vp_exp:
-
Load
CredentialSchemacsfromapplicant_perm.schema_id. -
let’s define
validity_period=cs.issuer_grantor_validation_validity_period(ifapplicant_perm.typeis ISSUER_GRANTOR),cs.verifier_grantor_validation_validity_period(ifapplicant_perm.typeis VERIFIER_GRANTOR),cs.issuer_validation_validity_period(ifapplicant_perm.typeis ISSUER),cs.verifier_validation_validity_period(ifapplicant_perm.typeis VERIFIER), orcs.holder_validation_validity_period(ifapplicant_perm.typeis HOLDER). -
if
validity_periodis NULL:vp_exp= NULL. -
else if
applicant_perm.vp_expis null,vp_exp= timestamp of now() plusvalidity_period. -
else
vp_exp=applicant_perm.vp_expplusvalidity_period.
Change value of provided effective_until if needed, and abort if needed:
-
if provided
effective_untilis NULL:- change value of provided
effective_untiltovp_exp.
- change value of provided
-
else if
applicant_perm.effective_untilis NULL:- verify that provided
effective_untilis greater thannowelse MUST abort - if
vp_expis not null, verify that providedeffective_untilis lower or equal tovp_expelse MUST abort
- verify that provided
-
else:
effective_untilMUST be greater thanapplicant_perm.effective_untilelse MUST abort- if
vp_expis not null, verify that providedeffective_untilis lower or equal tovp_expelse MUST abort.
Fees and Trust Deposits:
- transfer the full amount
applicant_perm.vp_current_feesin the proper denom from escrow account to validatorauthorityaccountvalidator_perm.authority; - Increase validator perm trust deposit: use [MOD-TD-MSG-1] to increase by
applicant_perm.vp_current_depositthe trust deposit ofauthorityrunning the method and transfer the corresponding amount toTrustDepositmodule. Setapplicant_perm.vp_validator_deposittoapplicant_perm.vp_validator_deposit+applicant_perm.vp_current_deposit.
Important: if
applicant_perm.vp_current_feesis not in native denom,authorityaccount MUST haveapplicant_perm.vp_current_depositavailable for paying the trust deposit.
Update Permission applicant_perm:
- set
applicant_perm.modifiedtonow. - set
applicant_perm.vp_stateto VALIDATED. - set
applicant_perm.vp_last_state_changetonow. - set
applicant_perm.vp_current_feesto 0; - set
applicant_perm.vp_current_depositto 0; - set
applicant_perm.vp_summary_digesttovp_summary_digest. - set
applicant_perm.vp_exptovp_exp. - set
applicant_perm.effective_untiltoeffective_until. - if
applicant_perm.effective_fromIS NULL (first time method is called for this perm, and thus we are not in a renewal):- set
applicant_perm.validation_feestovalidation_fees; - set
applicant_perm.issuance_feestoissuance_fees; - set
applicant_perm.verification_feestoverification_fees; - set
applicant_perm.effective_fromtonow. - set
applicant_perm.issuance_fee_discounttoissuance_fee_discount. - set
applicant_perm.verification_fee_discounttoverification_fee_discount.
- set
If applicant_perm.type is ISSUER or VERIFIER: Create authorization for applicant_perm.vs_operator so that the Verifiable Service will be able to call CreateOrUpdatePermissionSession when issuing or verifying credentials:
- if
applicant_perm.vs_operator_authz_enabled== true: call Grant VS Operator Authorization(applicant_perm.id).
§ [MOD-PERM-MSG-4] Void
§ [MOD-PERM-MSG-5] Void
§ [MOD-PERM-MSG-6] Cancel Permission VP Last Request
Any authorized operator CAN execute this method on behalf of an authority.
At any time, applicant of a permission validation process may request cancellation of the process, provided state is PENDING. Upon method execution, the pending validation is cancelled and escrewed trust fees are refunded. If vp_exp is not null, vp_state is set back to VALIDATED, else vp_state is set to TERMINATED.
§ [MOD-PERM-MSG-6-1] Cancel Permission VP Last Request parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of thePermissionentry;
§ [MOD-PERM-MSG-6-2] Cancel Permission VP Last Request precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-6-2-1] Cancel Permission VP Last Request basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. idMUST be a valid uint64.- Load
Permissionentryapplicant_permwith this id. It MUST exist. authorityrunning the transaction MUST beapplicant_perm.authority.applicant_perm.vp_stateMUST be PENDING.- if
applicant_perm.deposithas been slashed and not repaid, MUST abort
§ [MOD-PERM-MSG-6-2-2] Cancel Permission VP Last Request fee checks
Fee payer MUST have the required estimated transaction fees in its account, else transaction MUST abort.
§ [MOD-PERM-MSG-6-3] Cancel Permission VP Last Request execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
Load
Permissionentryapplicant_permwithid. It MUST exist. -
define
now: current timestamp. -
set
applicant_perm.modifiedtonow. -
if
applicant_perm.vp_expis null (validation never completed), setapplicant_perm.vp_stateto TERMINATED, else setapplicant_perm.vp_stateto VALIDATED. -
set
applicant_perm.vp_last_state_changetonow. -
if
applicant_perm.vp_current_fees> 0: -
if
applicant_perm.vp_current_deposit> 0:- call [MOD-TD-MSG-1] to reduce trust deposit of
applicant_perm.authoritybyapplicant_perm.vp_current_deposit - set
applicant_perm.vp_current_depositto 0.
- call [MOD-TD-MSG-1] to reduce trust deposit of
§ [MOD-PERM-MSG-7] Create Root Permission
Any authorized operator CAN execute this method on behalf of an authority.
This method is used by controller authorities of Trust Registries. When they create a Credential Schema, they need to create (a) permission(s) of type ECOSYSTEM so that other participants can run validation processes (if schema mode is ECOSYSTEM) or self create their permissions (schema mode set to OPEN).
§ [MOD-PERM-MSG-7-1] Create Root Permission parameters
An account that would like to create a Permission entry MUST call this method by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.schema_id(uint64) (mandatory)did(string) (mandatory): DID of the VS.effective_from(timestamp) (mandatory): timestamp from when (exclusive) this Perm is effective. MUST be in the future.effective_until(timestamp) (optional): timestamp until when (exclusive) this Perm is effective, null if it doesn’t expire. If not null, MUST be greater thaneffective_from.validation_fees(number) (mandatory): price to pay by applicant to validator for running a validation process that uses this perm as validator, for a given validation period, in the denom specified in the credential schema. Default to 0. Note that setting validation fees for OPEN schemas has no effect and does not mean a validation process must take place. For enabling validation processes, at least one of the two issuer, verifier mode must be different than OPEN.issuance_fees(number) (mandatory): price to pay by the issuer of a credential of this schema to the grantee of this perm when a credential is issued, in the denom specified in the credential schema. Default to 0.verification_fees(number) (mandatory): price to pay by the verifier of a credential of this schema to the grantee of this perm when a credential is verified, in the denom specified in the credential schema. Default to 0.
§ [MOD-PERM-MSG-7-2] Create Root Permission precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-7-2-1] Create Root Permission basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. schema_idMUST be a valid uint64 and a credential schema entry with this id MUST exist.did, if specified, MUST conform to the DID Syntax, as specified [DID-CORE].effective_frommust be in the future.effective_until, if not null, must be greater thaneffective_fromvalidation_fees(number) (mandatory): MUST be >= 0.issuance_fees(number) (mandatory): MUST be >= 0.verification_fees(number) (mandatory): MUST be >= 0.
§ [MOD-PERM-MSG-7-2-2] Create Root Permission permission checks
To execute this method, account MUST match at least one these rules, else transaction MUST abort.
- The related
CredentialSchemaentry is loaded withschema_id, and will be namedcsin this section. - The related
TrustRegistryentrytris loaded fromcs.tr_id. authorityexecuting the method MUST betr.authority.- else MUST abort.
§ [MOD-PERM-MSG-7-2-3] Create Root Permission fee checks
Fee payer MUST have the required estimated transaction fees available.
§ [MOD-PERM-MSG-7-2-4] Create Root Permission overlap checks
We want to make sure that 2 permissions cannot be active at the same time. If authority wishes to create a new permission but existing active one never expires (or expire too far from now), authority MUST use first the Extend Perm Msg to set or adjust the effective_until value.
Find all active permissions perms[] (not revoked, not slashed, not repaid) for schema_id, ECOSYSTEM, authority.
Note: unlike overlap checks from other methods, here we do not need to check for
validator_perm_id, as for ECOSYSTEM type permissions it is NULL.
for each Permission entry p from perms[]:
- if
p.effective_untilis greater thaneffective_from, method execution MUST abort. - if
p.effective_fromis lower thaneffective_until, method execution MUST abort. - if
p.effective_untilis NULL (never expire), creation of a new permission doesn’t make any sense and method execution MUST abort.
note: this check was not present in v3.
§ [MOD-PERM-MSG-7-3] Create Root Permission execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp.
A new entry Permission perm MUST be created:
perm.id: auto-incremented uint64.perm.schema_id:schema_id.perm.modifiedtonow.perm.type: ECOSYSTEM.perm.did:did.perm.authority:authority.perm.created:nowperm.effective_from:effective_fromperm.effective_until:effective_untilperm.validation_fees:validation_feesperm.issuance_fees:issuance_feesperm.verification_fees:verification_feesperm.deposit: 0
§ [MOD-PERM-MSG-8] Adjust Permission
Any authorized operator CAN execute this method on behalf of an authority.
This method can be called:
- by
perm.authority, if permission is of type ECOSYSTEM. - by
perm.authority, if it is a self-created permission (schema configuration is open) - by an
authorityof a validator permission (if permission is managed by a VP).
§ [MOD-PERM-MSG-8-1] Adjust Permission parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of the permission;effective_until(timestamp) (mandatory): timestamp until when (exclusive) thisPermissionwill be effective.
§ [MOD-PERM-MSG-8-2] Adjust Permission precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-8-2-1] Adjust Permission basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. idMUST be a valid uint64.- Load
Permissionentryapplicant_permfromid. If no entry found, abort. applicant_permMUST be a active permissionapplicant_perm.effective_untilMUST be greater than now().- else MUST abort.
Note: This method can be used to both Extend or Reduce the
effective_until, or set aneffective_untilif it was null, which was not the case in spec v3.
§ [MOD-PERM-MSG-8-2-2] Adjust Permission advanced checks
- ECOSYSTEM permissions
- if
applicant_perm.validator_perm_idis null andapplicant_perm.typeis ECOSYSTEM,authorityrunning the method MUST beapplicant_perm.authority.
- Self-created permissions
- load
validator_permfromapplicant_perm.validator_perm_id.validator_permMUST be a active permission of type ECOSYSTEM.authorityrunning the method MUST beapplicant_perm.authority.
- VP managed permissions
effective_untilMUST be lower or equal toapplicant_perm.vp_expelse MUST abort.- load
validator_permfromapplicant_perm.validator_perm_id.validator_permMUST be a active permission.authorityrunning the method MUST bevalidator_perm.authority.
§ [MOD-PERM-MSG-8-2-3] Adjust Permission fee checks
Fee payer MUST have the required estimated transaction fees in its account, else transaction MUST abort.
§ [MOD-PERM-MSG-8-2-4] Adjust Permission overlap checks
We want to make sure that 2 permissions cannot be active at the same time for the same validator_perm_id. If authority wishes to create a new permission but existing active one never expires (or expire too far from now), authority MUST use first the Extend Perm Msg to set or adjust the effective_until value.
Find all active permissions perms[] (not revoked, not slashed, not repaid) for schema_id, type, validator_perm_id, authority.
for each Permission entry p from perms[]:
- if
p.effective_untilis greater thaneffective_from, method execution MUST abort. - if
p.effective_fromis lower thaneffective_until, method execution MUST abort. - if
p.effective_untilis NULL (never expire), creation of a new permission doesn’t make any sense and method execution MUST abort.
note: this check was not present in v3.
§ [MOD-PERM-MSG-8-3] Adjust Permission execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
define
now: current timestamp. -
Load
Permissionentryapplicant_permfromid. -
set
applicant_perm.effective_untiltoeffective_until -
set
applicant_perm.adjustedtonow -
set
applicant_perm.modifiedtonow
If applicant_perm.type is ISSUER or VERIFIER: Update authorization for applicant_perm.vs_operator so that the Verifiable Service will be able to call CreateOrUpdatePermissionSession when issuing or verifying credentials:
- if
applicant_perm.vs_operator_authz_enabled== true: call Grant VS Operator Authorization(applicant_perm.id).
§ [MOD-PERM-MSG-9] Revoke Permission
Any authorized operator CAN execute this method on behalf of an authority.
This method can only be called:
- by an ancestor (
authorityof a validator in the permission branch until the root permission (GRANTOR, ECOSYSTEM, OPEN schema mode)). - by the grantee
authority(OPEN, GRANTOR, ECOSYSTEM schema mode). - by the
TrustRegistryauthority(owner of the credential schema).
§ [MOD-PERM-MSG-9-1] Revoke Permission parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of the permission;
§ [MOD-PERM-MSG-9-2] Revoke Permission precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-9-2-1] Revoke Permission basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. idMUST be a valid uint64.- Load
Permissionentryapplicant_permfromid. If no entry found, abort. applicant_permMUST be a active permission
§ [MOD-PERM-MSG-9-2-2] Revoke Permission advanced checks
Either Option #1, #2 or #3 MUST return true, else abort.
Option #1: executed by a validator ancestor
if applicant_perm.validator_perm_id is defined:
- set
validator_perm=applicant_perm - while
validator_perm.validator_perm_idis defined,- load
validator_permfromvalidator_perm.validator_perm_id. - if
validator_permis a active permission andvalidator_perm.authorityis who is running the method, => return true.
- load
- end
- return false.
Option #2: executed by TrustRegistry controller
- load
CredentialSchemacsfromapplicant_perm.schema_id - load
TrustRegistrytrfromcs.tr_id - if
authorityrunning the method istr.authority, return true. - else return false.
Option #3: executed by applicant_perm.authority: return true.
Example:
In the following permission tree, “Verifier E” permission can be revoked:
- by “Verifier E”, if the corresponding permission is a active permission;
- by “Verifier Grantor D”, if the corresponding permission is a active permission;
- by “Ecosystem A”, if the corresponding root permission is a active permission;
- by the
TrustRegistryobject controller, obtained by resolving perm => credential schema => trust registry.
§ [MOD-PERM-MSG-9-2-3] Revoke Permission fee checks
Fee payer MUST have the required estimated transaction fees in its account, else transaction MUST abort.
§ [MOD-PERM-MSG-9-3] Revoke Permission execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
define
now: current timestamp. -
Load
Permissionentryapplicant_permfromid. -
set
applicant_perm.revokedtonow -
set
applicant_perm.modifiedtonow
If applicant_perm.type is ISSUER or VERIFIER: Delete authorization for applicant_perm.vs_operator:
- call Revoke VS Operator Authorization(
applicant_perm.id).
§ [MOD-PERM-MSG-10] Create or Update Permission Session
Any authorized operator CAN execute this method on behalf of an authority.
Any credential exchange that requires issuer or verifier to pay fees, register a digest_sri, or produce a proof implies the creation of a PermissionSession.
If the peer wants to issue a credential, the agent, the Verifiable User Agent or Verifiable Service that receive the request MUST send to peer:
- a
uuidfor session identification; - the
wallet_agent_perm_idpermission id of the agent wallet that will store the credential.
If the peer wants to verify a credential, agent must send to peer:
- a
uuidfor session identification; - a map of compatible found credentials in available wallets for the requested schema_id: Map<uint64: wallet_agent_perm_id, uint64[] issuer_perm_ids>
payer MUST create a Permission Session using the above information, then, agent MUST check session has been created and is valid before accepting the action (receive and store issued credential, or accept a presentation request).
See VT spec.
§ [MOD-PERM-MSG-10-1] Create or Update Permission Session parameters
An account that would like to create or update a PermissionSession entry MUST send a Msg by specifying:
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uuid) (mandatory): id of thePermissionSession.issuer_perm_id(uint64) (optional): the id of the perm of the issuer, if we are dealing with the issuance of a credential.verifier_perm_id(uint64) (optional): the id of the perm of the verifier, if we are dealing with the verification of a credential.agent_perm_id(uint64) (mandatory): the agent credential issuer permission id (extracted from the agent credential that agent has in its wallet) of the agent that received the request (credential offer for issuance, presentation request for verification).wallet_agent_perm_id(uint64) (mandatory): the wallet credential issuer permission id of the agent where the credential will be or is stored. Can be the same perm thanagent_perm_idif agent and wallet_agent are the same agent.digest(string) (optional): digest derived from an issued or verified credential.
§ [MOD-PERM-MSG-10-2] Create or Update Permission Session precondition checks
If any of these precondition checks fail, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.idMUST be a valid uuid. If an entryexisting_entrywithidalready exist, thenexisting_entry.authorityMUST be equal toauthorityANDexisting_entry.vs_operatorMUST be equal tooperator, else abort.
if issuer_perm_id is null AND verifier_perm_id is null, MUST abort.
- define
issuer_permas null. - define
verifier_permas null.
if issuer_perm_id is not null:
- Load
issuer_permfromissuer_perm_id. - if
issuer_perm.typeis not ISSUER, abort. - if
issuer_permis not a active permission, abort. - if
issuer_perm.vs_operatoris not equal tooperator, abort. - if
issuer_perm.authorityis not equal toauthority, abort. - if
digest_sriis present but not a valid digest SRI, abort.
if verifier_perm_id is not null:
- Load
verifier_permfromverifier_perm_id. - if
verifier_perm.typeis not VERIFIER, abort. - if
verifier_permis not a active permission, abort. - if
verifier_perm.vs_operatoris not equal tooperator, abort. - if
verifier_perm.authorityis not equal toauthority, abort. - if
digest_sriis present but not a valid digest SRI, abort.
Define the primary permission perm: if verifier_perm is not null, perm = verifier_perm (the caller is the vs_operator of the verifier). Else, perm = issuer_perm (the caller is the vs_operator of the issuer).
[AUTHZ-CHECK-3] MUST pass for this (authority, operator, perm) tuple.
[AUTHZ-CHECK-4] MUST pass for this (authority, operator, perm) tuple.
agent:
- Load
agent_permfromagent_perm_id. - if
agent_perm.typeis not ISSUER, abort. - if
agent_permis not a active permission, abort.
wallet_agent:
- Load
wallet_agent_permfromwallet_agent_perm_id. - if
wallet_agent_perm.typeis not ISSUER, abort. - if
wallet_agent_permis not a active permission, abort.
we might want to check that credential schema of agent and wallet_agent perms is an Essential Credential Schema of type UserAgent. At the moment there is no way of doing it. We consider User Agent will not report a permission that is not controlled by its owner.
§ [MOD-PERM-MSG-10-3] Create or Update Permission Session fee checks
- Load
CredentialSchemaentrycsfromissuer_perm.schema_idifissuer_permis not null, else fromverifier_perm.schema_id. - Fee payer MUST have sufficient available balance for the required estimated transaction fees.
For trust fees, authority account MUST have sufficient available balance as explained below.
Step 1: Calculate total beneficiary fees in credential schema pricing asset
Use “Find Beneficiaries” query method to get the set of beneficiary permissions found_perm_set (all ancestors in the permission tree).
- define
total_beneficiary_fees= 0
If Credential Issuance (issuer_perm is NOT null):
- for each
perminfound_perm_set:total_beneficiary_fees=total_beneficiary_fees+perm.issuance_fees× (1 -issuer_perm.issuance_fee_discount)
If Credential Verification (verifier_perm is NOT null):
- for each
perminfound_perm_set:total_beneficiary_fees=total_beneficiary_fees+perm.verification_fees× (1 -verifier_perm.verification_fee_discount)
Note:
total_beneficiary_feesis expressed in the credential schema pricing asset(cs.pricing_asset_type, cs.pricing_asset).
Step 2: Calculate amounts payer must have available
Based on the credential schema pricing configuration, calculate the total amounts the payer (authority) must have available.
Define the following variables:
| Variable | Description |
|---|---|
total_fees_in_pricing_asset |
Total fees to be distributed to beneficiaries (in pricing asset) |
total_fees_in_native_denom |
Total fees converted to native denom (if needed) |
total_payer_trust_deposit |
Trust deposit payer must stake for themselves |
total_payees_trust_deposit |
Trust deposit payer must stake on behalf of payees |
total_payees_fees_to_account |
Fees to be transferred to payees’ accounts |
total_user_agent_reward |
Reward for user agent (in native denom) |
total_wallet_agent_reward |
Reward for wallet agent (in native denom) |
Initialize:
total_fees_in_pricing_asset=total_beneficiary_feestotal_fees_in_native_denom= 0total_payer_trust_deposit= 0total_payees_trust_deposit= 0total_payees_fees_to_account= 0total_user_agent_reward= 0total_wallet_agent_reward= 0
If a conversion is needed below, use Get Price to convert amounts.
Case A: (cs.pricing_asset_type, cs.pricing_asset) = (COIN, [[ref: native denom]])
Pricing is in native token. No conversion needed.
Calculate:
total_fees_in_native_denom=total_fees_in_pricing_assettotal_payer_trust_deposit=total_fees_in_native_denom×GlobalVariables.trust_deposit_ratetotal_payees_trust_deposit=total_payer_trust_deposittotal_payees_fees_to_account=total_fees_in_native_denom× (1 -GlobalVariables.trust_deposit_rate)total_user_agent_reward=total_fees_in_native_denom×GlobalVariables.user_agent_reward_ratetotal_wallet_agent_reward=total_fees_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Required balance check:
authorityMUST have available balance ≥total_fees_in_native_denom+total_payer_trust_deposit+total_user_agent_reward+total_wallet_agent_rewardin native denom.
Case B: (cs.pricing_asset_type, cs.pricing_asset) = (TU, "tu")
Pricing is in Trust Units. Convert to native denom for all on-chain payments.
Calculate:
total_fees_in_native_denom= getPrice(TU,"tu",COIN,[[ref: native denom]],total_fees_in_pricing_asset)total_payer_trust_deposit=total_fees_in_native_denom×GlobalVariables.trust_deposit_ratetotal_payees_trust_deposit=total_payer_trust_deposittotal_payees_fees_to_account=total_fees_in_native_denom× (1 -GlobalVariables.trust_deposit_rate)total_user_agent_reward=total_fees_in_native_denom×GlobalVariables.user_agent_reward_ratetotal_wallet_agent_reward=total_fees_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Required balance check:
authorityMUST have available balance ≥total_fees_in_native_denom+total_payer_trust_deposit+total_user_agent_reward+total_wallet_agent_rewardin native denom.
Case C: (cs.pricing_asset_type, cs.pricing_asset) = (COIN, <arbitrary_denom>)
Pricing is in an arbitrary on-chain coin (e.g., USDC). Fees to payees are paid in that coin; deposits and agent rewards are converted to native denom.
Calculate:
total_fees_in_native_denom= getPrice(COIN,<arbitrary_denom>,COIN,[[ref: native denom]],total_fees_in_pricing_asset)total_payer_trust_deposit=total_fees_in_native_denom×GlobalVariables.trust_deposit_ratetotal_payees_trust_deposit=total_payer_trust_deposittotal_payees_fees_to_account=total_fees_in_pricing_asset× (1 -GlobalVariables.trust_deposit_rate)total_user_agent_reward=total_fees_in_native_denom×GlobalVariables.user_agent_reward_ratetotal_wallet_agent_reward=total_fees_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Required balance check:
authorityMUST have available balance ≥total_payer_trust_deposit+total_payees_trust_deposit+total_user_agent_reward+total_wallet_agent_rewardin native denom.- AND
authorityMUST have available balance ≥total_payees_fees_to_accountin<arbitrary_denom>.
Case D: (cs.pricing_asset_type, cs.pricing_asset) = (FIAT, <fiat_denom>)
Pricing is in fiat currency (e.g., USD). Fiat fees are settled off-chain; only deposits and agent rewards are paid on-chain in native denom.
Calculate:
total_fees_in_native_denom= getPrice(FIAT,<fiat_denom>,COIN,[[ref: native denom]],total_fees_in_pricing_asset)total_payer_trust_deposit=total_fees_in_native_denom×GlobalVariables.trust_deposit_ratetotal_payees_trust_deposit=total_payer_trust_deposittotal_payees_fees_to_account= 0 (FIAT payments are managed off-chain)total_user_agent_reward=total_fees_in_native_denom×GlobalVariables.user_agent_reward_ratetotal_wallet_agent_reward=total_fees_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Required balance check:
authorityMUST have available balance ≥total_payer_trust_deposit+total_payees_trust_deposit+total_user_agent_reward+total_wallet_agent_rewardin native denom.
- Trust deposits MUST always be paid in native denom.
- When paying with COIN ≠ native denom or with FIAT, payer pays trust deposits on behalf of payees (since payees receive non-native assets that cannot be directly staked).
§ [MOD-PERM-MSG-10-4] Create or Update Permission Session execution
If all precondition checks passed, method is executed.
- Load all permissions as in basic checks.
- Load
CredentialSchemaentrycsfromissuer_perm.schema_idifissuer_permis not null, else fromverifier_perm.schema_id. - define
now: current timestamp. - use “Find Beneficiaries” to build
found_perm_set.
Note: All funds are transferred from the
authorityaccount executing the method. The steps below describe what each recipient must receive. Implementation details (batching, order of transfers) are left to the implementer.
Step 1: Process fee distribution to each beneficiary
Initialize accumulators for agent rewards:
accumulated_user_agent_reward= 0accumulated_wallet_agent_reward= 0
Determine the operation type and applicable discount:
-
If Credential Issuance (
issuer_permis NOT null):fee_field=issuance_feesdiscount=issuer_perm.issuance_fee_discountpayer_perm=issuer_perm
-
Else if Credential Verification (
verifier_permis NOT null):fee_field=verification_feesdiscount=verifier_perm.verification_fee_discountpayer_perm=verifier_perm
For each beneficiary permission perm in found_perm_set:
If perm.[fee_field] > 0:
-
Calculate the discounted fee for this beneficiary:
beneficiary_fee_in_pricing_asset=perm.[fee_field]× (1 -discount)
-
Calculate amounts based on pricing configuration (same logic as fee checks):
Case A:
(cs.pricing_asset_type, cs.pricing_asset)=(COIN, [[ref: native denom]])fee_in_native_denom=beneficiary_fee_in_pricing_assetpayer_trust_deposit=fee_in_native_denom×GlobalVariables.trust_deposit_ratepayee_trust_deposit=payer_trust_depositpayee_fees_to_account=fee_in_native_denom× (1 -GlobalVariables.trust_deposit_rate)user_agent_reward_portion=fee_in_native_denom×GlobalVariables.user_agent_reward_ratewallet_agent_reward_portion=fee_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Case B:
(cs.pricing_asset_type, cs.pricing_asset)=(TU, "tu")fee_in_native_denom= getPrice(TU,"tu",COIN,[[ref: native denom]],beneficiary_fee_in_pricing_asset)payer_trust_deposit=fee_in_native_denom×GlobalVariables.trust_deposit_ratepayee_trust_deposit=payer_trust_depositpayee_fees_to_account=fee_in_native_denom× (1 -GlobalVariables.trust_deposit_rate)user_agent_reward_portion=fee_in_native_denom×GlobalVariables.user_agent_reward_ratewallet_agent_reward_portion=fee_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Case C:
(cs.pricing_asset_type, cs.pricing_asset)=(COIN, <arbitrary_denom>)fee_in_native_denom= getPrice(COIN,<arbitrary_denom>,COIN,[[ref: native denom]],beneficiary_fee_in_pricing_asset)payer_trust_deposit=fee_in_native_denom×GlobalVariables.trust_deposit_ratepayee_trust_deposit=payer_trust_depositpayee_fees_to_account=beneficiary_fee_in_pricing_asset× (1 -GlobalVariables.trust_deposit_rate) (in<arbitrary_denom>)user_agent_reward_portion=fee_in_native_denom×GlobalVariables.user_agent_reward_ratewallet_agent_reward_portion=fee_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
Case D:
(cs.pricing_asset_type, cs.pricing_asset)=(FIAT, <fiat_denom>)fee_in_native_denom= getPrice(FIAT,<fiat_denom>,COIN,[[ref: native denom]],beneficiary_fee_in_pricing_asset)payer_trust_deposit=fee_in_native_denom×GlobalVariables.trust_deposit_ratepayee_trust_deposit=payer_trust_depositpayee_fees_to_account= 0 (FIAT payments are managed off-chain)user_agent_reward_portion=fee_in_native_denom×GlobalVariables.user_agent_reward_ratewallet_agent_reward_portion=fee_in_native_denom×GlobalVariables.wallet_user_agent_reward_rate
-
Execute transfers and deposits for this beneficiary:
- If
payee_fees_to_account> 0: transferpayee_fees_to_accounttoperm.authority(in the appropriate denom). - Use [MOD-TD-MSG-1] to increase the trust deposit of
perm.authoritybypayee_trust_deposit. Increaseperm.depositby the same value. - Use [MOD-TD-MSG-1] to increase the trust deposit of
authority(payer) bypayer_trust_deposit. Increasepayer_perm.depositby the same value.
- If
-
Accumulate agent rewards:
accumulated_user_agent_reward=accumulated_user_agent_reward+user_agent_reward_portionaccumulated_wallet_agent_reward=accumulated_wallet_agent_reward+wallet_agent_reward_portion
Step 2: Process agent rewards
After processing all beneficiaries, distribute accumulated rewards to agents.
User Agent Reward:
If accumulated_user_agent_reward > 0:
agent_trust_deposit=accumulated_user_agent_reward×GlobalVariables.trust_deposit_rateagent_fees_to_account=accumulated_user_agent_reward-agent_trust_deposit- Transfer
agent_fees_to_accounttoagent_perm.authorityin native denom. - Use [MOD-TD-MSG-1] to increase the trust deposit of
agent_perm.authoritybyagent_trust_deposit. Increaseagent_perm.depositby the same value.
Wallet Agent Reward:
If accumulated_wallet_agent_reward > 0:
wallet_agent_trust_deposit=accumulated_wallet_agent_reward×GlobalVariables.trust_deposit_ratewallet_agent_fees_to_account=accumulated_wallet_agent_reward-wallet_agent_trust_deposit- Transfer
wallet_agent_fees_to_accounttowallet_agent_perm.authorityin native denom. - Use [MOD-TD-MSG-1] to increase the trust deposit of
wallet_agent_perm.authoritybywallet_agent_trust_deposit. Increasewallet_agent_perm.depositby the same value.
Step 3: Create or update session records
Now that all transfers have been done, we can create the entries
Create a PermissionSessionRecord cspsr:
cspsr.created:nowcspsr.issuer_perm_id:issuer_perm_idcspsr.verifier_perm_id:verifier_perm_idcspsr.wallet_agent_perm_id:wallet_agent_perm_id
If new, create entry PermissionSession session:
session.id:idsession.authority:authoritysession.vs_operator:operatorsession.agent_perm_id:agent_perm_idsession.modified::nowsession.created::now
Else update:
session.modified::now
then, add the cspsr to session.session_records
if current transaction if for issuance of a credential, persist the digest SRI by calling [MOD-DI-MSG-1].
session.authz[] can contain null issuer_perm_id OR verifier_perm_id
§ [MOD-PERM-MSG-11] Update Permission Module Parameters
Update Permission Module Parameters.
Can only be executed through a governance proposal.
§ [MOD-PERM-MSG-11-1] Update Permission Module Parameters parameters
params(KeySet<String, String>): the parameters to update and their values.
§ [MOD-PERM-MSG-11-2] Update Permission Module Parameters precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-11-2-1] Update Permission Module Parameters basic checks
params: size ofparamsMUST be greater than 0. For eachparam<key,value>keyMUST exist, else abort.
§ [MOD-PERM-MSG-11-2-2] Update Permission Module Parameters fee checks
provided transaction fees MUST be sufficient for execution
§ [MOD-PERM-MSG-11-3] Update Permission Module Parameters execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
for each parameter param <key, value> in parameters:
- update parameter set value =
valuewhere key =key.
§ [MOD-PERM-MSG-12] Slash Permission Trust Deposit
This method can only be called by either:
- an
authorityancestor validator of this permission; - the
authoritycontroller of theTrustRegistryobject, owner of the corresponding credential schema.
§ [MOD-PERM-MSG-12-1] Slash Permission Trust Deposit parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of the permission;amount(number) (mandatory): the amount to slash
§ [MOD-PERM-MSG-12-2] Slash Permission Trust Deposit precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-12-2-1] Slash Permission Trust Deposit basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. idMUST be a valid uint64.- Load
Permissionentryapplicant_permfromid. If no entry found, abort. amountMUST be lower or equal toapplicant_perm.depositelse MUST abort.
Even if the permission has expired or is revoked, it is still possible to slash it.
§ [MOD-PERM-MSG-12-2-2] Slash Permission Trust Deposit validator perms
Either Option #1, or #2 MUST return true, else abort.
Option #1: executed by a validator ancestor
if applicant_perm.validator_perm_id is defined:
- set
validator_perm=applicant_perm - while
validator_perm.validator_perm_idis defined,- load
validator_permfromvalidator_perm.validator_perm_id. - if
validator_permis a active permission andvalidator_perm.authorityis who is running the method, => return true.
- load
- end
- return false.
Option #2: executed by TrustRegistry controller
- load
CredentialSchemacsfromapplicant_perm.schema_id - load
TrustRegistrytrfromcs.tr_id - if
authorityrunning the method istr.authority, return true. - else return false.
§ [MOD-PERM-MSG-12-2-3] Slash Permission Trust Deposit fee checks
Fee payer MUST have the required estimated transaction fees in its account, else transaction MUST abort.
§ [MOD-PERM-MSG-12-3] Slash Permission Trust Deposit execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
define
now: current timestamp. -
Load
Permissionentryapplicant_permfromid. -
Load
Permissionentryvalidator_permfromapplicant_perm.validator_perm_id. -
set
applicant_perm.slashedtonow -
set
applicant_perm.modifiedtonow -
set
applicant_perm.slashed_deposittoapplicant_perm.slashed_deposit+amount
use MOD-TD-MSG-7 to burn the slashed amount from the trust deposit of applicant_perm.authority.
If applicant_perm.type is ISSUER or VERIFIER: Delete authorization for applicant_perm.vs_operator:
- call Revoke VS Operator Authorization(
applicant_perm.id) with the following parameters:
§ [MOD-PERM-MSG-13] Repay Permission Slashed Trust Deposit
This method can only be called by the authority that want to repay the deposit of a slashed perm they own. This won’t make the perm re-usable: it will be needed for the authority associated to this permission to request a new permission, as slashed permissions cannot be revived (same happen for revoked, etc…).
Nevertheless, to get a new permission for a given ecosystem, it is needed, using this method, to repay the deposit of a slashed permission first.
§ [MOD-PERM-MSG-13-1] Repay Permission Slashed Trust Deposit parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.id(uint64) (mandatory): id of the permission
§ [MOD-PERM-MSG-13-2] Repay Permission Slashed Trust Deposit precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-13-2-1] Repay Permission Slashed Trust Deposit basic checks
if a mandatory parameter is not present, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. idMUST be a valid uint64.- Load
Permissionentryapplicant_permfromid. If no entry found, abort. - if
applicant_perm.authorityis not equal toauthority, abort.
§ [MOD-PERM-MSG-13-2-2] Repay Permission Slashed Trust Deposit fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
authorityMUST have at leastapplicant_perm.slashed_depositin its account balance, else transaction MUST abort.
§ [MOD-PERM-MSG-13-3] Repay Permission Slashed Trust Deposit execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp.
use Adjust Trust Deposit to transfer applicant_perm.slashed_deposit to trust deposit of applicant_perm.authority.
- Load
Permissionentryapplicant_permfromid. - set
applicant_perm.repaidtonow - set
applicant_perm.modifiedtonow - set
applicant_perm.repaid_deposittoapplicant_perm.slashed_deposit.
§ [MOD-PERM-MSG-14] Self Create Permission
Any authorized operator CAN execute this method on behalf of an authority.
This simple permission creation method can be used to self-create an ISSUER (resp. VERIFIER) permission if issuance mode (resp. verification mode) is set to OPEN for a given schema. As permissions are the anchor of ecosystem trust deposit operations, it is required for an issuer/verifier candidate to self-create a permission for being issuer or verifier of a given schema.
Even if a schema is OPEN, candidate MUST make sure they comply with the EGF else their permission may be revoked by ecosystem governance authority and their deposit slashed.
§ [MOD-PERM-MSG-14-1] Self Create Permission parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.type(PermissionType) (mandatory): ISSUER or VERIFIER.validator_perm_id(uint64) (mandatory): MUST be an ECOSYSTEM active permission or future permission.vs_operator(account) (optional): the account we want to authorize to create permission sessions linked to this permission. Required for payment delegation.did(string) (mandatory): DID of the VS grantee service.effective_from(timestamp) (optional): timestamp from when (exclusive) this Perm is effective. MUST be in the future.effective_until(timestamp) (optional): timestamp until when (exclusive) this Perm is effective, null if it doesn’t expire. If not null, MUST be greater thaneffective_from.verification_fees(number) (optional): price to pay by the verifier of a credential of this schema to the grantee of this ISSUER perm when a credential is verified, in the denom specified in the credential schema. Default to 0.validation_fees(number) (optional): price to pay by the holder of a credential of this schema to the issuer when executing a validation process to obtain a credential, in the denom specified in the credential schema. Default to 0.vs_operator_authz_enabled: boolean (mandatory): if set to true authorize this vs_operator to execute CreateOrUpdatePermissionSession on behalf ofauthorityaccount (trust fees will be paid by authority account)vs_operator_authz_spend_limit(DenomAmount[]) (optional): maximum amount of funds that the vs_operator is allowed to spend in the context of this permission. as a direct consequence of executing authorized messages.vs_operator_authz_with_feegrant: boolean (mandatory): if set to true, enable feegrant for this permission so vs_operator can pay the fees for CreateOrUpdatePermissionSession withauthorityaccount.vs_operator_authz_fee_spend_limit(DenomAmount[]) (optional): maximum total amount of fees that can be spent by vs_operator in the context of this permission.vs_operator_authz_spend_period: (period) (optional): reset period for vs_operator_authz_spend_limit and vs_operator_authz_fee_spend_limit in the context of this permission.
§ [MOD-PERM-MSG-14-2] Self Create Permission precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-PERM-MSG-14-2-1] Self Create Permission basic checks
if a mandatory parameter is not present, transaction MUST abort.
Load Permission validator_perm from validator_perm_id.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. type(PermissionType) (mandatory): MUST be ISSUER or VERIFIER, else abort.validator_perm_id(uint64) (mandatory):validator_permMUST be an ECOSYSTEM active permission or future permission.vs_operator(account) (optional): no check required.did, MUST conform to the DID Syntax, as specified [DID-CORE].effective_fromMUST be in the future AND- MUST be greater or equal to
validator_perm.effective_fromAND - if
validator_perm.effective_untilis not null, MUST be lower thanvalidator_perm.effective_until
- MUST be greater or equal to
effective_until:- if null,
validator_perm.effective_untilMUST be NULL - else if not null, must be greater than
effective_fromAND ifvalidator_perm.effective_untilis not null, MUST be lower or equal tovalidator_perm.effective_until
- if null,
verification_fees(number) (optional): If specified, MUST be >= 0 and MUST be a ISSUER permission.validation_fees(number) (optional): If specified, MUST be >= 0 and MUST be a ISSUER permission.vs_operator_authz_enabled: boolean (mandatory): if set to true,vs_operatorMUST NOT be null, else abort.vs_operator_authz_spend_limit(DenomAmount[]) (optional): maximum amount of funds that the vs_operator is allowed to spend in the context of this permission. as a direct consequence of executing authorized messages.vs_operator_authz_with_feegrant: boolean (mandatory): if set to true,vs_operatorMUST NOT be null, else abort.vs_operator_authz_fee_spend_limit(DenomAmount[]) (optional): maximum total amount of fees that can be spent by vs_operator in the context of this permission.vs_operator_authz_spend_period: (period) (optional): if not null,vs_operatorMUST NOT be null, else abort. Reset period for vs_operator_authz_spend_limit and vs_operator_authz_fee_spend_limit in the context of this permission.
§ [MOD-PERM-MSG-14-2-2] Self Create Permission permission checks
To execute this method, account MUST match at least one these rules, else transaction MUST abort.
- The related
CredentialSchemaentry is loaded withvalidator_perm.schema_id, and will be namedcsin this section. - if
typeis equal to ISSUER: ifcs.issuer_perm_management_modeis not equal to OPEN, MUST abort. - if
typeis equal to VERIFIER: ifcs.verifier_perm_management_modeis not equal to OPEN, MUST abort. - if
typeis equal to VERIFIER andvalidation_feesis specified and different than 0, MUST abort. - if
typeis equal to VERIFIER andverification_feesis specified and different than 0, MUST abort.
§ [MOD-PERM-MSG-14-2-3] Self Create Permission fee checks
Fee payer MUST have the required estimated transaction fees available.
§ [MOD-PERM-MSG-14-2-4] Self Create Permission overlap checks
We want to make sure that 2 permissions cannot be active at the same time for the same validator_perm_id. If authority wishes to create a new permission but existing active one never expires (or expire too far from now), authority MUST use first the Extend Perm Msg to set or adjust the effective_until value.
Find all active permissions perms[] (not revoked, not slashed, not repaid) for cs.id, type, validator_perm_id, authority.
for each Permission entry p from perms[]:
- if
p.effective_untilis greater thaneffective_from, method execution MUST abort. - if
p.effective_fromis lower thaneffective_until, method execution MUST abort. - if
p.effective_untilis NULL (never expire), creation of a new permission doesn’t make any sense and method execution MUST abort.
note: this check was not present in v3.
§ [MOD-PERM-MSG-14-3] Create Permission execution
If all precondition checks passed, method is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp. - Load
Permissionvalidator_permfromvalidator_perm_id.
A new entry Permission perm MUST be created:
perm.id: auto-incremented uint64.perm.validator_perm_id:validator_perm_idperm.schema_id:validator_perm.schema_idperm.modifiedtonow.perm.type:type.perm.did:did.perm.authority:authority.perm.vs_operator:vs_operator.perm.created:nowperm.effective_from:effective_fromperm.effective_until:effective_untilperm.validation_fees:validation_feesif specified andtypeis ISSUER, else 0.perm.issuance_fees: 0perm.verification_fees:verification_feesif specified andtypeis ISSUER, else 0.perm.deposit: 0perm.vs_operator_authz_enabled:vs_operator_authz_enabledperm.vs_operator_authz_spend_limit:vs_operator_authz_spend_limitperm.vs_operator_authz_with_feegrant:vs_operator_authz_with_feegrantperm.vs_operator_authz_fee_spend_limit:vs_operator_authz_fee_spend_limitperm.vs_operator_authz_spend_period:vs_operator_authz_spend_period
Create authorization for vs_operator so that the Verifiable Service will be able to call CreateOrUpdatePermissionSession when issuing or verifying credentials:
- if
perm.vs_operator_authz_enabled== true: call Grant VS Operator Authorization(perm.id).
§ [MOD-PERM-QRY-1] List Permissions
Anyone CAN execute this method.
Generic query used for (at least):
- find all permissions (all or limit to active) of a given schema;
- for a given validator, get PENDING validation processes;
- find all permissions of a given grantee;
- find all permissions of a given did;
- find all ISSUER_GRANTOR active permission, so that I can apply to an ISSUER permission; …
§ [MOD-PERM-QRY-1-1] List Permissions parameters
schema_id(number) (optional): the schema id.grantee(account) (optional): the grantee account.did(string) (optional): the did the permission refers to.perm_id(number) (optional): limit to permissions where thevalidator_perm_idisperm_id.type(PermissionType) (optional): if we want to limit to a specific permission type.only_valid(boolean) (optional): if set to true, only return active permissions.only_slashed(boolean) (optional): if set to true, only return slashed permissions.only_repaid(boolean) (optional): if set to true, only return repaid slashed permissions.modified_after(timestamp) (optional): limit to permissions modified after (or equal to)modified_after.vp_state(ValidationState) (optional): limit to permissions with avp_statenot null and equal tovp_state.response_max_size(small number) (optional): limit toresponse_max_sizeresults. Must be min 1, max 1,024. Default to 64.when(timestamp) (optional): if set, query atwhen, else query at now(). Used to query the VPR state at a previous datetime.
§ [MOD-PERM-QRY-1-2] List Permissions checks
Basic type check arg SHOULD be applied.
If any of these checks fail, query MUST fail.
response_max_sizemust be between 1 and 1,024. Default to 64 if unspecified.
§ [MOD-PERM-QRY-1-3] List Permissions execution
return a list of found entries, or an empty list if nothing found. Ordered by modified asc.
§ [MOD-PERM-QRY-2] Get Permission
Anyone CAN execute this method.
§ [MOD-PERM-QRY-2-1] Get Permission parameters
idof the credential schema permission (mandatory);
§ [MOD-PERM-QRY-2-2] Get Permission checks
idmust be a uint64.
§ [MOD-PERM-QRY-2-3] Get Permission execution
return found entry (if any).
§ [MOD-PERM-QRY-3] Void
Obsoleted by [MOD-PERM-QRY-1].
§ [MOD-PERM-QRY-4] Find Beneficiaries
Anyone can execute this method.
To calculate the fees required for paying the beneficiaries, it is needed to recurse all involved perms until the root of the permission tree (which is the trust registry perm), starting from the 2 branches issuer_perm and verifier_perm. As both branches may have common ancestors, we can create a Set (unordered collection with no duplicates), and recurse over the 2 branches, adding found perms. If verifier_perm is null, issuer_perm is never added to the set. If verifier_perm is NOT null, issuer_perm is added to the set if it exists but verifier_perm is not added to the set.
Example 1: verifier_perm: is not set: it’s a credential offer, schema configured to have Issuer Grantors.
Example 2: verifier_perm: is not set: it’s a credential offer. Schema configured to NOT have Issuer Grantors.
Example 3: verifier_perm is set, it’s a presentation request. Schema configured to have Verifier and Issuer Grantors.
§ [MOD-PERM-QRY-4-1] Find Beneficiaries parameters
issuer_perm_id(uint64) (optional): id of issuer permission.verifier_perm_id(uint64) (optional): id of verifier permission.
§ [MOD-PERM-QRY-4-2] Find Beneficiaries checks
- if
issuer_perm_idandverifier_perm_idare unset then MUST abort. - if
issuer_perm_idis specified, loadissuer_permfromissuer_perm_id, Permission MUST exist and MUST be a active permission. - if
verifier_perm_idis specified, loadverifier_permfromverifier_perm_id, Permission MUST exist and MUST be a active permission.
§ [MOD-PERM-QRY-4-3] Find Beneficiaries execution
Example: Let’s build the set. Revoked and slashed permissions will not be added to the set. Expired permissions, if not revoked/slashed, will be considered.
-
create Set
found_perm_set. -
define permission
current_permas null. -
load perms
issuer_permand optionalverifier_permas specified in basic checks above.
if issuer_perm is not null:
- set
current_perm=issuer_perm - while
current_perm.validator_perm_idis not null:- current_perm = load(
current_perm.validator_perm_id) - if
current_perm.revokedis NULL ANDcurrent_perm.slashedis NULL, Addcurrent_permtofound_perm_set.
- current_perm = load(
Additionally, if verifier_perm is not null:
- if
issuer_permis not null, addissuer_permtofound_perm_set - set
current_perm=verifier_perm - while
current_perm.validator_perm_id!= null:- current_perm = load(
current_perm.validator_perm_id) - if
current_perm.revokedis NULL ANDcurrent_perm.slashedis NULL, Addcurrent_permtofound_perm_set.
- current_perm = load(
return found_perms.
This works even is schema is open to any issuer or open to any verifier.
§ [MOD-PERM-QRY-5] Get PermissionSession
§ [MOD-PERM-QRY-5-1] Get PermissionSession parameters
id(uuid) (mandatory): the id of thePermissionSession.
§ [MOD-PERM-QRY-5-2] Get PermissionSession checks
§ [MOD-PERM-QRY-5-3] Get PermissionSession execution
return PermissionSession entry if found, else return not found.
§ [MOD-PERM-QRY-6] List Permission Module Parameters
§ [MOD-PERM-QRY-6-2] List Permission Module Parameters parameters
§ [MOD-PERM-QRY-6-2] List Permission Module Parameters query checks
§ [MOD-PERM-QRY-6-3] List Permission Module Parameters execution of the query
Return the list of the existing parameters and their values.
§ [MOD-PERM-QRY-6-4] List Permission Module Parameters API result example
{
"params": {
"key1": "value1",
"key2": "value2",
...
...
}
}
§ Validation Examples
§ Getting a Credential from an Authorized Issuer
This section is non-normative.
Example of an Applicant that would like to get issued a credential (HOLDER):
§ Add a DID to the List of Granted Issuers of a Credential Schema
This section is non-normative.
§ Trust deposit module
§ Trust deposit module overview
This section is non-normative.
Concept: the trust deposit is used to lock trust value as a stake. To process application messages that perform state changes, several modules methods are requiring a trust deposit to be sent, from the executing account, to the trust deposit module.
We will use a similar method than the one described here to manage trust deposit and yield calculation and easy way.
Example:
In our example, we suppose a VPR is just starting and no trust transaction have taken place yet. For this reason:
TrustDepositmodule has a balance of0:TrustDeposit.deposit:0.GlobalVariables.trust_deposit_share_valuehas a value of1.
Operation #1:
an account account1 wants to create a transaction that requires:
- 10
denomto be sent to theaccount1trust deposit; - 5
denomfor network fees.
First, the Trust Deposit: execution of the method will perform the following (we consider this account had no TrustDeposit entry yet):
-
10
denomare sent to theTrustDepositmodule.TrustDeposit.deposit=TrustDeposit.deposit+10
-
a
TrustDepositentrytd1is created foraccount1running the service with:td1.deposit=10td1.shares=10/GlobalVariables.trust_deposit_share_value=10
Second, fee distribution: let’s suppose that trust_deposit_block_reward_share is set to 0.30 so that 70% of transaction fees are distributed to validators, and 30% of transaction fees are distributed to trust deposit holders. For this specific transaction:
-
30% * 5 = 1.5
denomwill be sent toTrustDepositmodule, which will increase theGlobalVariables.trust_deposit_share_value: -
TrustDeposit.deposit=11.5 -
GlobalVariables.trust_deposit_share_value=1.15.
Now, account1 can (optionally) reclaim the difference between the GlobalVariables.trust_deposit_share_value * tt.share minus tt.denom, which represents the trust (yield) gains.
Operation #2:
Another account account2 wants to create a transaction that requires:
- 20
denomto be sent to theaccount2trust deposit; - 10
denomfor network fees.
First, Trust Deposit:
-
20
denomare sent to theTrustDepositmodule.TrustDeposit.deposit=31.5
-
a
TrustDepositentrytd2is created foraccount2:td2.deposit=20td2.shares=20/GlobalVariables.trust_deposit_share_value=20/1.15~=17.39...
Second, fee distribution: let’s suppose trust_deposit_block_reward_share is set to 0.30 so that 70% of transaction fees are distributed to validators, and 30% of transaction fees are distributed to trust deposit holders. For this specific transaction:
-
30% * 10 = 3
denomwill be sent toTrustDepositmodule, which will increase theGlobalVariables.trust_deposit_share_value: -
TrustDeposit.deposit=34.5 -
GlobalVariables.trust_deposit_share_value=1.15*34.5/31.5~=1.2595...
After the 2 operations:
account1real deposit (based on share) isaccount1.share*GlobalVariables.trust_deposit_share_value~=12.595..., available withdrawable yield isaccount1.share*GlobalVariables.trust_deposit_share_value-account1.deposit~=2.595...account2real deposit (based on share) isaccount2.share*GlobalVariables.trust_deposit_share_value~=21.90..., available withdrawable yield isaccount2.share*GlobalVariables.trust_deposit_share_value-account2.deposit~=1.90...
§ Trust Deposit Yield
The following global parameters are used to tune the Trust Deposit yield generation, in case the VPR is implemented as a ledger:
trust_deposit_max_yield_rate(number) (mandatory): Maximum yearly yield, in percent, that a trust deposit holder can obtain by receiving block rewards.trust_deposit_block_reward_share(number) (mandatory): Percentage of block reward that must be distributed to trust deposit holders. Default value: 20% (0.20)
Each time there is a block reward to be distributed, trust_deposit_block_reward_share percent MUST be directed to trust deposit holders, based on their trust deposit share.
Implementers MUST make sure, for each processed block reward, that the yearly effective yield is lower or equal than trust_deposit_max_yield_rate.
§ [MOD-TD-MSG-1] Adjust Trust Deposit
This method is used to increase or decrease the trust deposit of a specific authority account.
Only the modules that require trust deposit manipulation CAN call this method. If trust deposit has been slashed and not repaid, method execution MUST abort.
§ [MOD-TD-MSG-1-1] Adjust Trust Deposit method parameters
authority(group) (mandatory): authority owner of the trust deposit we want to adjust.augend(number) (mandatory): value to add to the deposit, in denom.
§ [MOD-TD-MSG-1-2] Adjust Trust Deposit precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-TD-MSG-1-2-1] Adjust Trust Deposit basic checks
- if a mandatory parameter is not present, transaction MUST abort.
Value checks:
-
augend(number) (mandatory): MUST be strictly positive or strictly negative. -
load
TrustDepositentrytdforauthority.- if
tddoes not exist:- if
augendis negative, transaction MUST abort.
- if
- else
- if
augendis negative andtd.claimable-augendis greater thantd.deposittransaction MUST abort. (td.claimabletrust deposit cannot be greater thantd.deposit).
- if
- if
§ [MOD-TD-MSG-1-2-2] Adjust Trust Deposit fee checks
- Fee payer the transaction MUST have the required estimated transaction fees in its account
Additionally:
-
load
TrustDepositentrytdforauthority. -
if
tdexists:- if
augendis positive:- calculate
needed_deposit=augend-td.claimable. - if
needed_deposit< 0:needed_deposit= 0.
- calculate
- else
needed_deposit= 0.
- if
-
else
needed_deposit=augend. -
authorityMUST haveneeded_depositin its account, else transaction MUST abort.
§ [MOD-TD-MSG-1-3] Adjust Trust Deposit execution of the method
If all precondition checks passed, method is executed in a transaction.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
-
if a
TrustDepositentrytddoes not exist for thisauthority, create entrytd:- transfer
augendfromauthorityaccount toTrustDepositaccount. - calculate
augend_share=augend/GlobalVariables.trust_deposit_share_value. - set
td.authoritytoauthority; - set
td.deposittoaugend; - set
td.sharetoaugend_share; - set
td.claimableto 0. - set
td.slashed_depositto 0. - set
td.repaid_depositto 0. - set
td.slash_countto 0.
- transfer
-
else if
td.slashed_deposit> 0 andtd.repaid_deposit<td.slashed_deposit=> deposit has been slashed and not repaid, so MUST abort. -
else if
augend> 0:-
if
td.claimable> 0:- if
td.claimable>=augend:- set
td.claimabletotd.claimable-augend
- set
- else
- use bank? to transfer
augend-td.claimablefrom authority account to authorityTrustDepositaccount. - set
td.deposittotd.deposit+augend-td.claimable - set
td.claimableto 0 - calculate
missing_augend_sharefrom missing tokens :missing_augend_share= (augend-td.claimable) /GlobalVariables.trust_deposit_share_value. - set
td.sharetotd.share+missing_augend_share
- use bank? to transfer
- if
-
else
- use bank? to transfer
augendfromaccounttoTrustDepositaccount. - calculate
augend_share=augend/GlobalVariables.trust_deposit_share_value. - set
td.deposittotd.deposit+augend - set
td.sharetotd.share+augend_share
- use bank? to transfer
-
-
else if
augend< 0:- set
td.claimabletotd.claimable-augend
- set
The last case, augend < 0, is to free trust deposit (ej when canceling a validation process).
§ [MOD-TD-MSG-2] Reclaim Trust Deposit Yield
This method is used to reclaim yield. If trust deposit has been slashed and not repaid, method execution MUST abort.
For a given TrustDeposit entry td, claimable yield is calculated like this:
claimable_yield = td.share * GlobalVariables.trust_deposit_share_value - td.deposit.
If claimable_yield is positive, it can be claimed.
§ [MOD-TD-MSG-2-1] Reclaim Trust Deposit Yield method parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.
§ [MOD-TD-MSG-2-2] Reclaim Trust Deposit Yield precondition checks
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type.
§ [MOD-TD-MSG-2-2-1] Reclaim Trust Deposit Yield basic checks
- Load
TrustDepositentrytdfromauthority. - if
td.slashed_deposit> 0 andtd.repaid_deposit<td.slashed_deposit=> deposit has been slashed and not repaid, so MUST abort. - calculate
claimable_yield=td.share*GlobalVariables.trust_deposit_share_value-td.deposit. - if
claimable_yield<= 0, transaction MUST abort.
§ [MOD-TD-MSG-2-2-2] Reclaim Trust Deposit Yield fee checks
Fee payer running the transaction MUST have the required estimated transaction fees in its account, else transaction MUST abort.
§ [MOD-TD-MSG-2-3] Reclaim Trust Deposit Yield execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
For the TrustDeposit entry td linked to authority:
- Load
TrustDepositentrytdfromauthority. - calculate
claimable_yield=td.share*GlobalVariables.trust_deposit_share_value-td.deposit. - update
td.share=td.share-claimable_yield/GlobalVariables.trust_deposit_share_value - transfer
claimable_yieldfromTrustDepositaccount to authority account.
§ [MOD-TD-MSG-3] Void
§ [MOD-TD-MSG-4] Update Module Parameters
Update Module Parameters.
Can only be executed through a governance proposal.
§ [MOD-TD-MSG-4-1] Update Module Parameters parameters
params(KeySet<String, String>): the parameters to update and their values.
§ [MOD-TD-MSG-4-2] Update Module Parameters precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-TD-MSG-4-2-1] Update Module Parameters basic checks
params: size ofparamsMUST be greater than 0. For eachparam<key,value>keyMUST exist, else abort.
§ [MOD-TD-MSG-4-2-2] Update Module Parameters fee checks
provided transaction fees MUST be sufficient for execution
§ [MOD-TD-MSG-4-3] Update Module Parameters execution
If all precondition checks passed, transaction is executed.
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
for each parameter param <key, value> in parameters:
- update parameter set value =
valuewhere key =key.
§ [MOD-TD-MSG-5] Slash Trust Deposit
This method is used by the network governance authority to globally slash an authority account trust deposit.
This method can only be called by a governance proposal. A globally slashed account MUST repay the slashed deposit in order to continue to use the services provided by the VPR. When and account is slashed, and while slashed deposit has not been repaid, all account linked permissions MUST be considered non trustable.
This method is for network governance authority slash. For ecosystem slash, see Slash Permission Trust Deposit.
§ [MOD-TD-MSG-5-1] Slash Trust Deposit method parameters
authority(group) (mandatory): authority we want to slash.amount(number) (mandatory): value to slash, in denom.
§ [MOD-TD-MSG-5-2] Slash Trust Deposit precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-TD-MSG-5-2-1] Slash Trust Deposit basic checks
if any of these conditions is not satisfied, transaction MUST abort.
amountmust be > 0.TrustDepositentrytdMUST exist for thisauthority, andtd.depositMUST be greater or equal toamount.
§ [MOD-TD-MSG-5-2-2] Slash Trust Deposit fee checks
Fee payer MUST have the required estimated transaction fees in its account, else transaction MUST abort.
§ [MOD-TD-MSG-5-3] Slash Trust Deposit execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp.
For the TrustDeposit entry td linked to authority:
- set
td.deposittotd.deposit-amount. - set
td.sharetotd.share-amount/GlobalVariables.trust_deposit_share_value - burn
amountfromTrustDepositaccount. - set
td.slashed_deposittotd.slashed_deposit+amount - set
td.last_slashedto now - if
td.slash_countis undefined, set it to1, else set it totd.slash_count+ 1
§ [MOD-TD-MSG-6] Repay Slashed Trust Deposit
Any authorized operator CAN execute this method on behalf of an authority.
§ [MOD-TD-MSG-6-1] Repay Slashed Trust Deposit method parameters
authority(group): (Signer) the signing authority on whose behalf this message is executed.operator(account): (Signer) the account authorized by theauthorityto run this Msg.amount(number) (mandatory): value to repay, in denom.
§ [MOD-TD-MSG-6-2] Repay Slashed Trust Deposit precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-TD-MSG-6-2-1] Repay Slashed Trust Deposit basic checks
if any of these conditions is not satisfied, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. amountmust be > 0.TrustDepositentrytdMUST exist for thisauthority, andamountMUST be exactly equal totd.slashed_deposit-td.repaid_deposit.
§ [MOD-TD-MSG-6-2-2] Repay Slashed Trust Deposit fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
authorityMUST have the requiredamountin its account, else transaction MUST abort.
§ [MOD-TD-MSG-6-3] Repay Slashed Trust Deposit execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp.
For the TrustDeposit entry td linked to authority account:
- set
td.deposittotd.deposit+amount. - set
td.sharetotd.share+amount/GlobalVariables.trust_deposit_share_value - add
amounttoTrustDepositaccount. - set
td.repaid_deposittotd.repaid_deposit+amount - set
td.last_repaidto now
§ [MOD-TD-MSG-7] Burn Ecosystem Slashed Trust Deposit
Burn the portion of the trust deposit of a given account. This method can only be called by the permission module when performing an ecosystem-related slash.
Make sure to properly protect access to the execution of this method else it may lead to very destructive actions.
§ [MOD-TD-MSG-7-1] Burn Ecosystem Slashed Trust Deposit method parameters
authority(group) (mandatory): authority of the trust deposit we want to burn.amount(number) (mandatory): value to burn, in denom.
Alternative approach: For security and consistency, implementers MAY choose to reference the ID of the slashed permission, load it and use its defined slashed_deposit value as the slashing amount.
The decision between this method and specifying the amount directly is left to implementers.
§ [MOD-TD-MSG-7-2] Burn Ecosystem Slashed Trust Deposit precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-TD-MSG-7-2-1] Burn Ecosystem Slashed Trust Deposit basic checks
if any of these conditions is not satisfied, transaction MUST abort.
amountmust be > 0.TrustDepositentrytdMUST exist for thisauthority, andamountMUST be lower or equal thantd.deposit.
§ [MOD-TD-MSG-7-2-2] Burn Ecosystem Slashed Trust Deposit fee checks
Fee payer running the transaction MUST have the required estimated transaction fees in its account else transaction MUST abort.
§ [MOD-TD-MSG-7-3] Burn Ecosystem Slashed Trust Deposit execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp.
For the TrustDeposit entry td linked to account:
- set
td.deposittotd.deposit-amount. - set
td.sharetotd.share-amount/GlobalVariables.trust_deposit_share_value - burn
amountfromTrustDepositaccount.
§ [MOD-TD-QRY-1] Get Trust Deposit
Any account CAN run this query. As this method does not modify data, it does not require a transaction.
§ [MOD-TD-QRY-1-1] Get Trust Deposit query parameters
account(account) (mandatory): the account for which we want to get the trust deposit value.
§ [MOD-TD-QRY-1-2] Get Trust Deposit query checks
If any of these checks fail, query MUST fail.
accountmust be a valid account.
§ [MOD-TD-QRY-1-3] Get Trust Deposit execution of the query
If found, returns trust deposit, else return not found.
§ [MOD-TD-QRY-2] List Module Parameters
Anyone CAN run this query.
§ [MOD-TD-QRY-2-2] List Module Parameters parameters
§ [MOD-TD-QRY-2-2] List Module Parameters query checks
§ [MOD-TD-QRY-2-3] List Module Parameters execution of the query
Return the list of the existing parameters and their values.
§ [MOD-TD-QRY-2-4] List Module Parameters API result example
{
"params": {
"key1": "value1",
"key2": "value2",
...
...
}
}
§ [MOD-DE-MSG-1] Grant Fee Allowance
This method can only be called directly by the following methods:
- Grant Operator Authorization
- Grant VS Operator Authorization
- Revoke VS Operator Authorization
§ [MOD-DE-MSG-1-1] Grant Fee Allowance method parameters
authority(group) (mandatory): the authority that grants the fees.grantee(account) (mandatory): the account that receives the fee grant fromauthority.msg_types(Msg[]) (mandatory): the type of messages for which we want to grant the fee allowance.expiration(timestamp) (optional): when the grant expires.spend_limit(DenomAmount[]) (optional): maximum spendableperiod(duration) (optional): can be combined withspend_limit
§ [MOD-DE-MSG-1-2] Grant Fee Allowance basic checks
if any of these conditions is not satisfied, transaction MUST abort.
msg_types(Msg[]) (mandatory): MUST be a list of VPR delegable messages only.expiration(timestamp): if specified, MUST be in the futurespend_limit(DenomAmount[]) if specified, MUST be a list of valid DenomAmountsperiod(duration): if specified MUST be a valid period.
§ [MOD-DE-MSG-1-3] Grant Fee Allowance fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DE-MSG-1-4] Grant Fee Allowance execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
Create (or update if it already exist) FeeGrant feegrant:
- set
feegrant.grantortoauthority - set
feegrant.granteetograntee - set
feegrant.msg_typestomsg_types - set
feegrant.expirationtoexpiration - set
feegrant.spend_limittospend_limit - set
feegrant.periodto `period``
§ [MOD-DE-MSG-2] Revoke Fee Allowance
This method can only be called directly by the following methods:
- Grant Operator Authorization
- Revoke Operator Authorization
- Revoke VS Operator Authorization
§ [MOD-DE-MSG-2-1] Revoke Allowance method parameters
authority(group) (mandatory): the authority.grantee(account) (mandatory): the grantee we want to revoke.
§ [MOD-DE-MSG-2-2] Revoke Fee Allowance basic checks
MUST abort if one of these conditions fails:
authority(group) (mandatory): MUST be specified.grantee(account) (mandatory): MUST be specified.
§ [MOD-DE-MSG-2-3] Revoke Fee Allowance fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DE-MSG-2-4] Revoke Fee Allowance execution of the method
If FeeGrant entry for this (authority, grantee) exist, delete it, else do nothing.
§ [MOD-DE-MSG-3] Grant Operator Authorization
- Any authorized
operatorCAN execute this method on behalf of anauthority. authorityCAN execute this method alone through a group proposal
§ [MOD-DE-MSG-3-1] Grant Operator Authorization method parameters
authority(group) (mandatory): (Signer) the signing authority on whose behalf this message is executed.operator(account) (optional): (Signer) the account authorized by theauthorityto run this Msg.grantee(account) (mandatory): the account that receives the authorization fromauthority.msg_types(Msg[]) (mandatory): the type of messages for which we want to grant the fee allowance.expiration(timestamp) (optional): when the authorization (and its optional feegrant) expires.authz_spend_limit(DenomAmount[]) (optional): maximum spendableauthz_spend_limit_period(duration) (optional): can be combined withspend_limitwith_feegrant(boolean) (mandatory): means this authorization grants feegrant, toofeegrant_spend_limit(DenomAmount[]) (optional): maximum spendablefeegrant_spend_limit_period(duration) (optional): can be combined withfeegrant_spend_limit
§ [MOD-DE-MSG-3-2] Grant Operator Authorization basic checks
if any of these conditions is not satisfied, transaction MUST abort.
-
authority(group): (Signer) signature must be verified. -
operator(account): (Signer) signature must be verified. -
[AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. -
msg_types(Msg[]) (mandatory): MUST be a list of VPR delegable messages only, exceptedCreateOrUpdatePermissionSessionwhich is not allowed. -
expiration(timestamp): if specified, MUST be in the future -
authz_spend_limit(DenomAmount[]) if specified, MUST be a list of valid DenomAmounts -
authz_spend_limit_period(duration): if specified MUST be a valid period. Ignored ifauthz_spend_limitis not set. -
feegrant_spend_limit(DenomAmount[]) if specified, MUST be a list of valid DenomAmounts. Ignored ifwith_feegrantis false. -
feegrant_spend_limit_period(duration): if specified MUST be a valid period. Ignored iffeegrant_spend_limitis not set or ifwith_feegrantis false. -
Check if a VS Operator Authorization exists for
authorityandgrantee. If this is the case, MUST abort.
An Operator Authorization CAN be granted ONLY IF no VS Operator Authorization exists for perm.authority and perm.vs_operator. Operator Authorization and VS Operator Authorization are mutually exclusive for a given grantee.
§ [MOD-DE-MSG-3-3] Grant Operator Authorization fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DE-MSG-3-4] Grant Operator Authorization execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
Create (or update if it already exist) Authorization authz:
- set
authz.authoritytoauthority - set
authz.operatortograntee - set
authz.msg_typestomsg_types - set
authz.expirationtoexpiration - set
authz.spend_limittoauthz_spend_limit - set
authz.periodtoauthz_spend_limit_period
if with_feegrant is false:
- call Revoke Fee Allowance (
authority,grantee).
else if with_feegrant is true:
- grant Fee Allowance (
authority,grantee,msg_types,expiration,feegrant_spend_limit,feegrant_spend_limit_period).
§ [MOD-DE-MSG-4] Revoke Operator Authorization
- Any authorized
operatorCAN execute this method on behalf of anauthority. authorityCAN execute this method alone through a group proposal
§ [MOD-DE-MSG-4-1] Revoke Operator Authorization method parameters
authority(group) (mandatory): (Signer) the signing authority on whose behalf this message is executed.operator(account) (mandatory): (Signer) the account authorized by theauthorityto run this Msg.grantee(account) (mandatory): the account that will be revoked its authorization`.
§ [MOD-DE-MSG-4-2] Revoke Operator Authorization basic checks
MUST abort if one of these conditions fails:
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. - An Authorization entry MUST exist for this (
authority,grantee)
§ [MOD-DE-MSG-4-3] Revoke Operator Authorization fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DE-MSG-4-4] Revoke Operator Authorization execution of the method
- Delete Authorization entry for this (
authority,grantee). - revoke Fee Allowance (
authority,grantee).
§ [MOD-DE-MSG-5] Grant VS Operator Authorization
This method can only be called directly by the following methods with no signer check:
- Self Create Permission
- Adjust Permission
- Set Permission VP to Validated
Note: This methid can only grant authorization for the
CreateOrUpdatePermissionSessionMsg.
§ [MOD-DE-MSG-5-1] Grant VS Operator Authorization method parameters
perm_id(uint64) (mandatory): the permission this authorization is referring to.
§ [MOD-DE-MSG-5-2] Grant VS Operator Authorization basic checks
if any of these conditions is not satisfied, transaction MUST abort.
perm_id(uint64) (mandatory): Permission MUST exist.- load Permission
permwithperm_id.perm.authorityandperm.vs_operatorMUST NOT be null. - Check if a Operator Authorization exists for
perm.authorityandperm.vs_operator. If this is the case, MUST abort.
A VS Operator Authorization CAN be granted ONLY IF no Operator Authorization exists for perm.authority and perm.vs_operator. VS Operator Authorization and Operator Authorization are mutually exclusive for a given grantee.
§ [MOD-DE-MSG-5-3] Grant VS Operator Authorization fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DE-MSG-5-4] Grant VS Operator Authorization execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
Load Permission perm with perm_id.
Create VSOperatorAuthorization vs_operator_authz if it doesn’t exist yet:
- set
vs_operator_authz.grantortoperm.authority - set
vs_operator_authz.granteetoperm.vs_operator
then, add the perm_id to the list of authorized permissions:
- Add
perm_idtovs_operator_authz.permissions
Then check for feegrant:
- if
perm.vs_operator_authz_with_feegrantis true:- set
max_expire=perm.effective_until - if
max_expire== null: call Grant Fee Allowance (authority,grantee,CreateOrUpdatePermissionSession, null, null, null) and EXIT. - else foreach
current_perm_idofvs_operator_authz.permissions- load Permission
current_permfromcurrent_perm_id - if
current_perm.vs_operator_authz_with_feegrantis true:- if
current_perm.effective_until== null: call Grant Fee Allowance (authority,grantee,CreateOrUpdatePermissionSession, null, null, null) and EXIT. - else if
current_perm.effective_until>max_expire=> setmax_expire=current_perm.effective_until
- if
- load Permission
- if
max_expire> now, call Grant Fee Allowance (authority,grantee,CreateOrUpdatePermissionSession,max_expire, null, null).
- set
We MUST align to the farthest effective_until for the feegrant, for the permissions that have current_perm.effective_until set.
§ [MOD-DE-MSG-6] Revoke VS Operator Authorization
This method can only be called by the following methods with no signer check:
- Revoke Permission
- Slash Permission Trust Deposit
§ [MOD-DE-MSG-6-1] Revoke VS Operator Authorization method parameters
perm_id(uint64) (mandatory): the permission this authorization is referring to.
§ [MOD-DE-MSG-6-2] Revoke VS Operator Authorization basic checks
MUST abort if one of these conditions fails:
perm_id(uint64) (mandatory): Permission MUST exist.- load Permission
permwithperm_id.perm.authorityandperm.vs_operatorMUST NOT be null.
§ [MOD-DE-MSG-6-3] Revoke VS Operator Authorization fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DE-MSG-6-4] Revoke VS Operator Authorization execution of the method
- load Permission
permwithperm_id. - load VSOperatorAuthorization
vs_operator_authzwithperm.authorityandperm.vs_operator. - If
vs_operator_authzis not null:- remove
perm_idfromvs_operator_authz.permissionsif present. - if
perm.vs_operator_authz_with_feegrantis true:- if size(vs_operator_authz.permissions) == 0 => call Revoke Fee Allowance (
perm.authority,perm.vs_operator). - else define
max_expire= null - foreach
current_perm_idofvs_operator_authz.permissions- load Permission
current_permfromcurrent_perm_id - if
current_perm.vs_operator_authz_with_feegrantis true:- if
current_perm.effective_until== null setmax_expire= null - else if
max_expire== null setmax_expire=current_perm.effective_until - else
max_expire= max (max_expire,current_perm.effective_until)
- if
- load Permission
- if
max_expire> now, call Grant Fee Allowance (authority,grantee,CreateOrUpdatePermissionSession,max_expire, null, null).
- if size(vs_operator_authz.permissions) == 0 => call Revoke Fee Allowance (
- remove
When a permission is removed from authorization, and the removed permission had a feegrant, new expire of the feegrant is the biggest effective_until of all associated permissions that have feegrant enabled.
In the case of VS Operator Authorizations, spending limit are managed by the Permission module.
§ [MOD-DE-QRY-1] List Operator Authorizations
Anyone CAN execute this method.
§ [MOD-DE-QRY-1-1] List Operator Authorizations parameters
authority(group) (optional): filter by the authority group that granted the authorization.operator(account) (optional): filter by the operator account that received the authorization.response_max_size(small number) (optional): limit toresponse_max_sizeresults. Must be min 1, max 1,024. Default to 64.
§ [MOD-DE-QRY-1-2] List Operator Authorizations checks
Basic type check arg SHOULD be applied.
If any of these checks fail, query MUST fail.
response_max_sizemust be between 1 and 1,024. Default to 64 if unspecified.
§ [MOD-DE-QRY-1-3] List Operator Authorizations execution
Return a list of OperatorAuthorization entries matching the filter criteria, or an empty list if nothing found.
§ [MOD-DE-QRY-2] List VS Operator Authorizations
Anyone CAN execute this method.
§ [MOD-DE-QRY-2-1] List VS Operator Authorizations parameters
authority(group) (optional): filter by the authority group that granted the authorization.vs_operator(account) (optional): filter by the VS operator account that received the authorization.response_max_size(small number) (optional): limit toresponse_max_sizeresults. Must be min 1, max 1,024. Default to 64.
§ [MOD-DE-QRY-2-2] List VS Operator Authorizations checks
Basic type check arg SHOULD be applied.
If any of these checks fail, query MUST fail.
response_max_sizemust be between 1 and 1,024. Default to 64 if unspecified.
§ [MOD-DE-QRY-2-3] List VS Operator Authorizations execution
Return a list of VSOperatorAuthorization entries matching the filter criteria, or an empty list if nothing found.
§ [MOD-DI-MSG-1] Store Digest
- Any authorized
operatorCAN execute this method on behalf of anauthority. - This method can be called directly by Create or Update Permission Session module with no checks.
§ [MOD-DI-MSG-1-1] Store Digest method parameters
authority(group) (mandatory): (Signer) the signing authority on whose behalf this message is executed.operator(account) (mandatory): (Signer) the account authorized by theauthorityto run this Msg.digest(string) (mandatory): digest to store.
§ [MOD-DI-MSG-1-2] Store Digest precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-DI-MSG-1-2-1] Store Digest basic checks
if any of these conditions is not satisfied, transaction MUST abort.
authority(group): (Signer) signature must be verified.operator(account): (Signer) signature must be verified.- [AUTHZ-CHECK] MUST pass for this (
authority,operator) pair and this message type. - if
digestis not present, abort.
§ [MOD-DI-MSG-1-2-2] Store Digest fee checks
- Fee payer MUST have the required estimated transaction fees in its account;
§ [MOD-DI-MSG-1-3] Store Digest execution of the method
Method execution MUST perform the following tasks in a transaction, and rollback if any error occurs.
- define
now: current timestamp.
Create Digest digest:
- set
digest.digestto digest - set
digest.createdto now.
§ [MOD-DI-QRY-1] Get Digest
Anyone CAN execute this method.
§ [MOD-DI-QRY-1-1] Get Digest parameters
digest(string) (mandatory): the digest to look up.
§ [MOD-DI-QRY-1-2] Get Digest checks
If any of these checks fail, query MUST fail.
digestMUST not be empty.
§ [MOD-DI-QRY-1-3] Get Digest execution
If all checks passed, query is executed.
Return found Digest entry (if any) matching digest.
§ [MOD-DI-QRY-1-4] Get Digest API result example
{
"digest": {
"digest": "sha384-MzNNbQTWCSUSi0bbz7dbua+RcENv7C6FvlmYJ1Y+I727HsPOHdzwELMYO9Mz68M26",
"created": "2025-01-14T19:40:37.967Z"
}
}
§ [MOD-XR-MSG-1] Create Exchange Rate
The Create Exchange Rate method allows creating an ExchangeRate entry for a given (base_asset_type, base_asset, quote_asset_type, quote_asset) pair.
- Only a governance proposal CAN execute this method.
§ [MOD-XR-MSG-1] Create Exchange Rate method parameters
base_asset_type(PricingAssetType, mandatory)base_asset(string, mandatory)quote_asset_type(PricingAssetType, mandatory)quote_asset(string, mandatory)rate(string, mandatory)rate_scale(uint32, mandatory)validity_duration(duration, mandatory)
§ [MOD-XR-MSG-1] Create Exchange Rate precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-XR-MSG-1] Create Exchange Rate basic checks
If any of the following conditions is not satisfied, transaction MUST abort.
-
Asset type validity
base_asset_typeMUST be a validPricingAssetTypevalue.quote_asset_typeMUST be a validPricingAssetTypevalue.
-
Asset identifier basic validity
base_assetMUST be non-empty.quote_assetMUST be non-empty.
-
Asset type / identifier consistency
-
If
base_asset_type = TRUST_UNIT:base_assetMUST equal"TU".
-
If
quote_asset_type = TRUST_UNIT:quote_assetMUST equal"TU".
-
If
base_asset_type = COIN:base_assetMUST be a valid Cosmos-SDK denom string.base_assetMUST correspond to an asset that exists on-chain (i.e., denom is recognized by the chain and can be held in balances).- If
base_assetstarts withibc/, a denom trace for this denom MUST exist in the IBC transfer module store. - If
base_assetstarts withfactory/, the denom MUST be a valid tokenfactory denom and the corresponding token MUST exist.
-
If
quote_asset_type = COIN:quote_assetMUST be a valid Cosmos-SDK denom string.quote_assetMUST correspond to an asset that exists on-chain.- If
quote_assetstarts withibc/, a denom trace for this denom MUST exist in the IBC transfer module store. - If
quote_assetstarts withfactory/, the denom MUST be a valid tokenfactory denom and the corresponding token MUST exist.
-
If
base_asset_type = FIAT:base_assetMUST be a valid ISO-4217 currency code.
-
If
quote_asset_type = FIAT:quote_assetMUST be a valid ISO-4217 currency code.
-
-
Pair validity
- The pair
(base_asset_type, base_asset, quote_asset_type, quote_asset)MUST NOT be identical on both sides (base and quote MUST NOT represent the same asset). - The pair
(base_asset_type, base_asset, quote_asset_type, quote_asset)MUST be unique in storage. If an entry already exists, execution MUST abort.
- The pair
-
Rate validity
rateMUST be a base-10 encoded unsigned integer string.rateMUST be strictly greater than"0".rate_scaleMUST be within protocol-defined limits (e.g.,rate_scale <= 18).
-
validity_duration
validity_durationMUST be greater or equal to1 minute.
§ [MOD-XR-MSG-1] Create Exchange Rate fee checks
Fee payer MUST have sufficient estimated transaction fees.
§ [MOD-XR-MSG-1] Create Exchange Rate execution of the method
Create ExchangeRate entry xr:
xr.id= auto generated idxr.base_asset_type=base_asset_typexr.base_asset=base_assetxr.quote_asset_type=quote_asset_typexr.quote_asset=quote_assetxr.rate=ratexr.rate_scale=rate_scalexr.validity_duration=validity_durationxr.expires= block timestamp +validity_durationxr.state= falsexr.updated= block timestamp
§ [MOD-XR-MSG-2] Update Exchange Rate
Only an authorized operator that has an ExchangeRateAuthorization can execute this method.
§ [MOD-XR-MSG-2] Update Exchange Rate method parameters
id(uint64, mandatory)rate(string, mandatory)
§ [MOD-XR-MSG-2] Update Exchange Rate precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-XR-MSG-2] Update Exchange Rate basic checks
If any of the following conditions is not satisfied, transaction MUST abort.
- Authorization
Only an authorized operator that has an ExchangeRateAuthorization can execute this method.
id(uint64, mandatory) must refer to an existingExchangeRateentryxrwithxr.active= truerateMUST be strictly greater than"0".
§ [MOD-XR-MSG-2] Update Exchange Rate fee checks
Fee payer MUST have sufficient estimated transaction fees.
§ [MOD-XR-MSG-2] Update Exchange Rate execution of the method
Load ExchangeRate xr.
xr.rate=ratexr.expires= block time +validity_durationxr.updated= block time
§ [MOD-XR-MSG-3] Toggle Exchange Rate State
The Toggle Exchange Rate State method allows an authorized actor to enable or disable an exchange rate.
§ [MOD-XR-MSG-3] Toggle Exchange Rate State method parameters
id(uint64, mandatory): id of the exchange ratestate(boolean, mandatory): true to set enabled, false to set disabled
§ [MOD-XR-MSG-3] Toggle Exchange Rate State precondition checks
If any of these precondition checks fail, transaction MUST abort.
§ [MOD-XR-MSG-3] Toggle Exchange Rate State basic checks
If any of the following conditions is not satisfied, transaction MUST abort.
-
Authorization
- Only a governance proposal can enable or disable an exchange rate.
-
ExchangeRate with id
idMUST exist.
§ [MOD-XR-MSG-3] Toggle Exchange Rate State fee checks
Fee payer MUST have sufficient estimated transaction fees.
§ [MOD-XR-MSG-3] Toggle Exchange Rate State execution of the method
Load ExchangeRate xr.
- set
xr.stateto !xr.state. - set
xr.updatedto block time
§ [MOD-XR-QRY-1] Get Exchange Rate
Any account CAN run this query.
§ [MOD-XR-QRY-1-1] Get Exchange Rate query parameters
state(boolean, optional): to force state, enabled or disabledexpire_ts(timestamp, optional): return only if expire_ts is greater thanexpire_ts
AND:
(
id(uint64) (mandatory): the id of the exchange rate to get
OR:
base_asset_type(PricingAssetType, mandatory)base_asset(string, mandatory)quote_asset_type(PricingAssetType, mandatory)quote_asset(string, mandatory)
)
§ [MOD-XR-QRY-1-2] Get Exchange Rate query checks
If any of these checks fail, query MUST fail.
id(uint64) (mandatory): MUST exist,
OR
an ExchangeRate entry with base_asset_type, base_asset, quote_asset_type, quote_asset MUST exist.
§ [MOD-XR-QRY-1-3] Get Exchange Rate execution of the query
If found, returns ExchangeRate entry, else return not found.
§ [MOD-XR-QRY-2] List Exchange Rates
Any account CAN run this query. As this method does not modify data, it does not require a transaction.
§ [MOD-XR-QRY-2-1] List Exchange Rates query parameters
base_asset_type(PricingAssetType, optional)base_asset(string, optional)quote_asset_type(PricingAssetType, optional)quote_asset(string, optional)state(boolean, optional): to force state, enabled or disabledexpire(timestamp, optional): return only if expire is greater thanexpire
§ [MOD-XR-QRY-2-2] List Exchange Rates query checks
§ [MOD-XR-QRY-2-3] List Exchange Rates execution of the query
If found, returns a list of found ExchangeRates, else return an empty list.
§ [MOD-XR-QRY-3] Get Price
Anyone CAN run this query, throgh module call or using the API.
§ [MOD-XR-QRY-3] Get Price Example
base_asset_type = TU base_asset = “tu” quote_asset_type = COIN quote_asset = “uvna” rate = R rate_scale = S
If a valid ExchangeRate entry exists with:
base_asset_type = TUbase_asset = "tu"quote_asset_type = COINquote_asset = "uvna"
then the price of amount Trust Unit expressed in uvna MUST be computed using the following formula:
price_uvna = floor(amount * rate / 10^rate_scale)
Where:
rateandrate_scaleare the values stored in the correspondingExchangeRateentry.price_uvnais expressed in micro-denominated VNA units (uvna).- Rounding MUST always be performed downwards.
If the corresponding ExchangeRate entry is expired or missing, the conversion MUST fail.
§ [MOD-XR-QRY-3-1] Get Price parameters
base_asset_type(PricingAssetType, optional)base_asset(string, optional)quote_asset_type(PricingAssetType, optional)quote_asset(string, optional)amount(number, mandatory)
§ [MOD-XR-QRY-3-2] Get Price query checks
If the corresponding ExchangeRate entry is expired or missing, the conversion MUST fail and an error is returned
§ [MOD-XR-QRY-3-3] Get Price execution of the query
- if (base_asset_type, base_asset) == (quote_asset_type, quote_asset):
price=amount. - else load (base_asset_type, base_asset, quote_asset_type, quote_asset).
- if entry doesn’t exist or is not active or expired, abort and generate an error.
- else return
price= floor(amount * rate / 10^rate_scale)
- Conversions use base units only.
- Integer arithmetic MUST be used.
quote_amount = floor(base_amount × rate / 10^rate_scale).- Expired rates MUST NOT be used.
§ Initial Data Requirements
§ [GLO] Global Variables
Global variables CAN only be changed by the governance authority through proposals.
Default values MUST be set at VPR initialization (genesis). Below you’ll find some possible values. These values will have to be defined in the governance framework.
Credential Schema:
credential_schema_schema_max_size(number) (mandatory): 8192.credential_schema_issuer_grantor_validation_validity_period_max_days(number) (mandatory): 3650.credential_schema_verifier_grantor_validation_validity_period_max_days(number) (mandatory): 3650.credential_schema_issuer_validation_validity_period_max_days(number) (mandatory): 3650.credential_schema_verifier_validation_validity_period_max_days(number) (mandatory): 3650.credential_schema_holder_validation_validity_period_max_days(number) (mandatory): 3650.
Trust Deposit:
-
trust_deposit_share_value(number) (mandatory): 1. -
trust_deposit_rate(number) (mandatory): 0.20. -
trust_deposit_max_yield_rate(number) (mandatory): 0.20 -
trust_deposit_block_reward_share(number) (mandatory): 0.20 -
wallet_user_agent_reward_rate(number) (mandatory): 0.10. -
user_agent_reward_rate(number) (mandatory): 0.10.
§ References
§ Normative References
- DID-CORE
- Decentralized Identifiers (DIDs) v1.0. Manu Sporny; Amy Guy; Markus Sabadello; Drummond Reed; 2022-07-19. Status: REC.
- RFC3986
- Uniform Resource Identifier (URI): Generic Syntax. T. Berners-Lee; R. Fielding; L. Masinter; 2005-01. Status: Internet Standard.
- VC-DATA-MODEL
- Verifiable Credentials Data Model v1.1. Manu Sporny; Grant Noble; Dave Longley; Daniel Burnett; Brent Zundel; Kyle Den Hartog; 2022-03-03. Status: REC.