Skip to content

Commit a19e327

Browse files
committed
refactor(dataverse): restructure the contract to align with the OKP4 ontology
1 parent 2ebb6cd commit a19e327

File tree

1 file changed

+27
-86
lines changed
  • contracts/okp4-dataverse/src

1 file changed

+27
-86
lines changed

contracts/okp4-dataverse/src/msg.rs

Lines changed: 27 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -16,93 +16,38 @@ pub struct InstantiateMsg {
1616
/// This enum provides variants for registering services, datasets, and other operations related to the dataverse.
1717
#[cw_serde]
1818
pub enum ExecuteMsg {
19-
/// # RegisterService
20-
/// Registers a new Service within the dataverse.
19+
/// # SubmitClaims
20+
/// Submits new claims about a resource to the dataverse.
2121
///
22-
/// The term 'Service' in this context is employed to denote any form of service that is accessible over a network.
23-
/// This encompasses, but is not limited to, services such as REST APIs, gRPC services, and similar network-based
24-
/// services.
22+
/// The SubmitClaims message is a pivotal component in the dataverse, enabling entities to contribute new claims about various
23+
/// resources. A claim represents a statement made by an entity, referred to as the issuer, which could be a person, organization,
24+
/// or service. These claims pertain to a diverse range of resources, including digital resources, services, zones, or individuals,
25+
/// and are asserted as factual by the issuer.
2526
///
26-
/// A fundamental characteristic of each service is its unique Uniform Resource Identifier (URI), which serves as
27-
/// the definitive entry point for accessing the service. This URI is pivotal in the identification and location of
28-
/// the service within the network.
29-
RegisterService {
30-
/// The decentralized identity (DID) of the service.
31-
///
32-
/// Preconditions:
33-
/// - The identity must be unique within the dataverse.
34-
identity: Did,
35-
/// The URI that identifies and locates the service.
36-
///
37-
/// The URI serves a dual purpose:
38-
/// 1. **Identification**: It provides a unique identifier for the service, ensuring that each service can be distinctly recognized within the dataverse.
39-
/// 2. **Endpoint**: The URI acts as the access point or endpoint for the service. It specifies where the service can be accessed and how interactions with the service should be initiated.
40-
identifier: Uri,
41-
/// The URI of the entity responsible for registering and managing the service in the dataverse (i.e. on the blockchain).
42-
/// It's an optional field, if not provided the service is registered by the entity that invokes the transaction.
43-
registrar: Option<Did>,
44-
},
45-
46-
/// # RegisterDigitalResource
47-
/// Registers a new digital resource within the dataverse.
27+
/// #### Format
4828
///
49-
/// A Digital Resource represents a broad category encompassing various digital entities registerable in the dataverse.
50-
/// This category includes, but is not limited to, datasets, algorithms, machine learning models, and other digital assets.
29+
/// Claims are injected into the dataverse through Verifiable Presentations (VPs). These presentations effectively amalgamate and
30+
/// showcase multiple credentials, thus providing a cohesive and comprehensive view of the assertions being made.
5131
///
52-
/// The unique identification of each Digital Resource is achieved through a combination of its Uniform Resource Identifier (URI)
53-
/// and the specific service responsible for its provision. This dual-component identification mechanism guarantees the distinct
54-
/// recognition and operationalization of each Digital Resource within the dataverse environment.
55-
RegisterDigitalResource {
56-
/// The decentralized identity (DID) of the Digital Resource.
57-
///
58-
/// Preconditions:
59-
/// - The identity must be unique within the dataverse.
60-
identity: Did,
61-
/// The URI that identifies the resource.
62-
/// This URI makes sense only in the context of the service that provides the resource.
63-
///
64-
/// Preconditions:
65-
/// - The URI must be unique within the dataverse.
66-
identifier: Uri,
67-
/// The URI of the service, already registered in the dataverse, that provides the resource.
68-
///
69-
/// Preconditions:
70-
/// - The Service must be registered in the dataverse before the resource can be registered.
71-
provided_by: Uri,
72-
/// The URI of the entity responsible for registering and managing the resource in the dataverse (i.e. on the blockchain).
73-
/// It's an optional field, if not provided the resource is registered by the entity that invokes the transaction.
74-
registrar: Option<Did>,
75-
},
76-
77-
/// # FoundZone
78-
/// Founds a new zone within the dataverse.
32+
/// While the data in a VP typically revolves around a common subject, it accommodates an unlimited number of subjects and issuers.
33+
/// This flexibility allows for a broad spectrum of claims to be represented.
7934
///
80-
/// `Zone` is a conceptual framework that is established based on a set of rules, within which
81-
/// recognized Resources must conform, considering associated consents.
82-
FoundZone {
83-
/// The decentralized identity (DID) of the Zone.
84-
/// This identity must be unique within the dataverse.
85-
identity: Did,
86-
/// The URI of the entity responsible for registering and managing the zone in the dataverse (i.e. on the blockchain).
87-
/// It's an optional field, if not provided the zone is registered by the entity that invokes the transaction.
88-
registrar: Option<Did>,
89-
},
90-
91-
/// # SubmitClaims
92-
/// Submits new claims about a resource to the dataverse.
35+
/// Primarily, the claims leverage the OKP4 ontology, which facilitates articulating assertions about widely acknowledged resources
36+
/// in the dataverse, including digital services, digital resources, zones, governance, and more.
37+
///
38+
/// Additionally, other schemas may also be employed to supplement and enhance the validated knowledge contributed to these resources.
39+
///
40+
/// #### Preconditions
9341
///
94-
/// A claim is a statement made by an entity, the issuer (e.g. a person, an organization, or a machine) about a resource
95-
/// (e.g. an entity, a service, or a zone) that the issuer asserts to be true.
42+
/// To maintain integrity and coherence in the dataverse, several preconditions are set for the submission of claims:
9643
///
97-
/// The claims are submitted to the dataverse in the form of Verifiable Presentations (VPs), which combine and present credentials.
98-
/// The data in the presentation concerns usually the same subject, but there is no limit to the number of subjects or
99-
/// issuers in the data.
44+
/// 1. **Format Requirement**: Claims must be encapsulated within Verifiable Presentations (VPs).
10045
///
101-
/// Preconditions:
102-
/// - The claims must be submitted in the form of Verifiable Presentations (VPs).
103-
/// - The subjects of the Verifiable Credentials must exist in the dataverse before the claims can be submitted.
104-
/// - The identifiers of the Veriable Credentials must be unique within the dataverse.
105-
/// - The claims must be signed by the issuer and the signature must be verifiable.
46+
/// 2. **Unique Identifier Mandate**: Each Verifiable Credential within the dataverse must possess a unique identifier.
47+
///
48+
/// 3. **Singularity of Credential Instances**: For any given subject, there can only be one instance of a Verifiable Credential of a particular type.
49+
///
50+
/// 4. **Issuer Signature**: Claims must bear the issuer's signature. This signature must be verifiable, ensuring authenticity and credibility.
10651
SubmitClaims {
10752
/// The serialized metadata intended for attachment.
10853
/// This metadata should adhere to the format specified in the `format` field.
@@ -115,8 +60,9 @@ pub enum ExecuteMsg {
11560
/// # RevokeClaims
11661
/// Revoke or withdraw a previously submitted claims.
11762
///
118-
/// Preconditions:
119-
/// - The identifier of the claims must exist in the dataverse.
63+
/// #### Preconditions:
64+
///
65+
/// 1. **Identifier Existance**: The identifier of the claims must exist in the dataverse.
12066
RevokeClaims {
12167
/// The unique identifier of the claims to be revoked.
12268
identifier: Uri,
@@ -242,11 +188,6 @@ pub enum RdfFormat {
242188
/// see https://en.wikipedia.org/wiki/Uniform_Resource_Identifier.
243189
type Uri = String;
244190

245-
/// # Did
246-
/// `Did` represents a Decentralized Identifier (DID), a globally unique identifier.
247-
/// see https://www.w3.org/TR/did-core/.
248-
type Did = Uri;
249-
250191
/// `QueryMsg` defines the set of possible queries that can be made to retrieve information about the dataverse.
251192
///
252193
/// This enum provides variants for querying the dataverse's details and other related information.

0 commit comments

Comments
 (0)