Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add terms of agreement #621

Merged
merged 2 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .gitbook/1-users/3-data-exchange/1-consume-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@ For `deal-file-path`, create a following JSON file.
"amount": "1000000"
},
"max_num_data": 10,
"consumer_address": "panacea1..."
"consumer_address": "panacea1...",
"agreement_terms": [
{
"id": 1,
"required": true,
"title": "Terms of data provision",
"description": "The provided data will be used for ..."
}
]
}
```
It is very important to set data schema specifically and correctly, so that data being provided can be validated accurately by oracles.

For more details about data deals, please see the [Data Deal](../../3-protocol-devs/1-dep-specs/2-data-deal.md) specification.


## Query deals

You can query a deal with its deal ID.
Expand Down
24 changes: 21 additions & 3 deletions .gitbook/1-users/3-data-exchange/2-provide-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The certificate form is like below:
"cid" : "{ipfs-cid}",
"unique_id" : "{oracle-unique-id}",
"oracle_address" : "{oracle-address}",
"deal_id": "{deal-id}",
"deal_id": <deal-id>,
"provider_address" : "{your-address}",
"data_hash" : "{data-hash}"
},
Expand All @@ -76,9 +76,27 @@ Now you can use this certificate in the next step.

## Submit consent

Broadcast the following `submit-consent` transaction with certificate from oracle.
Broadcast the following `submit-consent` transaction with the certificate from oracle and agreements of terms for data provision.

**consent.json**

```json
{
"deal_id": <deal-id>,
"certificate": {
...
},
"agreements": [
{
"id": 1,
"agreement": true
}
]
}
```

```bash
panacead submit-consent ${certificate-file-path} \
panacead submit-consent ${consent-file-path} \
--from ${data-provider-addr} \
--chain-id ${chain-id} \
--gas auto --gas-adjustment 1.30 --gas-prices 5umed \
Copy link
Contributor

@gyuguen gyuguen Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is what I was talking about. :)

Expand Down
12 changes: 11 additions & 1 deletion .gitbook/3-protocol-devs/1-dep-specs/2-data-deal.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ message Deal {
uint64 max_num_data = 5;
uint64 cur_num_data = 6;
string consumer_address = 7;
DealStatus status = 8;
repeated AgreementTerm agreement_terms = 8;
DealStatus status = 9;
}

message AgreementTerm {
uint32 id = 1;
bool required = 2;
string title = 3;
string description = 4;
}
```

Expand All @@ -58,6 +66,7 @@ message Deal {
- `max_num_data`: The maximum number of data the consumer want
- `cur_num_data`: The current number of data provided
- `consumer_address`: A consumer's account address of the form `panacea1...`
- `agreement_terms`: Terms of agreement of data provision
- `status`: The status of deal. 3 statuses can be possible
- `DEAL_STATUS_ACTIVE`: The status when deal is active (`cur_num_data` < `max_num_data`).
- `DEAL_STATUS_INACTIVE`: The status when deal is deactivated (when consumer deactivated the deal)
Expand All @@ -73,6 +82,7 @@ message MsgCreateDeal {
cosmos.base.v1beta1.Coin budget = 2;
uint64 max_num_data = 3;
string consumer_address = 4;
repeated AgreementTerm agreement_terms = 5;
}
```

Expand Down
12 changes: 10 additions & 2 deletions .gitbook/3-protocol-devs/1-dep-specs/3-data-provider-consent.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,30 @@ message UnsignedCertificate {
}
```

Using the `Certificate`, provider can submit consent to provide the data.
Using the `Certificate`, provider can submit consent to provide the data with agreement of terms.

```proto
message MsgSubmitConsent {
Consent consent = 1;
}

message Consent {
Certificate certificate = 1;
uint64 deal_id = 1;
Certificate certificate = 2;
repeated Agreement agreements = 3;
}

message Agreement {
uint32 term_id = 1;
bool agreement = 2;
}
```

When this consent is submitted, blockchain will check:
- if the data is provided by the owner of the data
- if the data is validated by a registered and active oracle
- if the data is provided in duplicate
- if the provider agrees to the required terms of agreement

If all checks pass, rewards are distributed to the provider and oracle(more about [incentive](./6-incentives.md)).

Expand Down