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 DEP docs #567

Merged
merged 86 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
31aa300
docs: frontpage
youngjoon-lee Dec 22, 2022
23b2399
fix
youngjoon-lee Dec 22, 2022
d0eae6f
fix
youngjoon-lee Dec 22, 2022
2d0aa14
fix
youngjoon-lee Dec 22, 2022
915e8c9
fix
youngjoon-lee Dec 22, 2022
963f489
fix
youngjoon-lee Dec 22, 2022
d0cae23
consume data
youngjoon-lee Dec 23, 2022
ef00c1e
spec
youngjoon-lee Dec 23, 2022
f6faecc
typo
youngjoon-lee Dec 23, 2022
e43756c
link
youngjoon-lee Dec 23, 2022
6b226b8
tmp
youngjoon-lee Dec 23, 2022
6274357
Update .gitbook/0-about-panacea/1-roadmap.md
Jan 4, 2023
37085a4
Update .gitbook/0-about-panacea/1-roadmap.md
Jan 4, 2023
427af07
Update .gitbook/1-users/3-data-exchange/0-about-dep.md
Jan 4, 2023
0fa399f
Update .gitbook/1-users/3-data-exchange/0-about-dep.md
Jan 4, 2023
4423709
Update .gitbook/1-users/3-data-exchange/0-about-dep.md
Jan 4, 2023
701637e
Update .gitbook/1-users/3-data-exchange/0-about-dep.md
Jan 4, 2023
d18fdb6
Update .gitbook/1-users/3-data-exchange/0-about-dep.md
Jan 4, 2023
71708ed
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
7d54caf
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
9f4a242
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
fa7116b
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
fa9d0ce
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
7205c04
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
38d124a
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
92ce731
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
13c9776
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
7d9b4df
Update .gitbook/3-protocol-devs/1-dep-specs/0-overview.md
Jan 4, 2023
9174493
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
fc5e809
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
28f6c56
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
34bb9cf
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
8cb5975
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 4, 2023
1643046
docs: add data-deal specs for protocol devs (#585)
0xHansLee Jan 5, 2023
950574f
Update .gitbook/0-about-panacea/1-roadmap.md
Jan 6, 2023
be07e99
Update .gitbook/1-users/3-data-exchange/1-consume-data.md
Jan 6, 2023
9a04d48
revert unintentional changes
youngjoon-lee Jan 6, 2023
984539f
add jwt guide
youngjoon-lee Jan 6, 2023
9dd634e
deal json
youngjoon-lee Jan 6, 2023
f62e72e
docs: rename buyer and seller
Jan 6, 2023
39daf84
docs: add list of operating oracle nodes
audtlr24 Jan 9, 2023
7187b83
Merge remote-tracking branch 'origin/docs/560' into docs/560
audtlr24 Jan 9, 2023
a8d0a7b
docs: add operate oracle nodes to SUMMARY.md
audtlr24 Jan 9, 2023
05f1204
docs: add data validation spec for protocol devs (#596)
gyuguen Jan 9, 2023
a151c11
docs: add data provider consent spec for protocol devs (#592)
0xHansLee Jan 10, 2023
d4976bd
docs: add user guide for provider (#594)
audtlr24 Jan 10, 2023
e2cdd32
docs: incentives for protocol devs (#601)
0xHansLee Jan 10, 2023
5b43933
docs: add oracle installation (#607)
audtlr24 Jan 12, 2023
4efe303
docs: oracle-registration for oracle operators (#609)
0xHansLee Jan 12, 2023
bab1547
docs: update oracle info (#616)
0xHansLee Jan 12, 2023
612606f
docs: add a genesis oracle registration docs (#613)
gyuguen Jan 12, 2023
d70675d
docs: add oracle initialization docs (#611)
inchori Jan 13, 2023
f09c838
docs: add DEP user flow spec (#597)
Jan 13, 2023
97788f5
docs: running oracle node (#617)
audtlr24 Jan 13, 2023
9362564
docs: oracle upgrade for oracle operators (#619)
0xHansLee Jan 13, 2023
074efbf
docs: add confidential oracle docs (#599)
inchori Jan 13, 2023
140f721
docs: add verify remote report (#620)
gyuguen Jan 13, 2023
0530076
Merge branch 'main' into docs/560
youngjoon-lee Jan 13, 2023
7d247d8
remove unnecessary images
youngjoon-lee Jan 13, 2023
b3ac6d1
add tj
youngjoon-lee Jan 13, 2023
d5b448c
docs: add terms of agreement (#621)
0xHansLee Jan 13, 2023
5798157
Update 0-panacea-ecosystem.md
tjyoon0324 Jan 18, 2023
a3e26aa
Update 1-roadmap.md
tjyoon0324 Jan 18, 2023
4652176
Update 0-about-dep.md
tjyoon0324 Jan 18, 2023
a03df74
Update 1-consume-data.md
tjyoon0324 Jan 18, 2023
069ef75
Update 2-provide-data.md
tjyoon0324 Jan 18, 2023
7d797b8
Update 1-consume-data.md
tjyoon0324 Jan 18, 2023
ef094f8
Update 1-user-flow.md
tjyoon0324 Jan 18, 2023
4d2f1c0
Update 2-data-deal.md
tjyoon0324 Jan 18, 2023
220a535
Update 3-data-provider-consent.md
tjyoon0324 Jan 19, 2023
91d180e
Update 3-data-provider-consent.md
tjyoon0324 Jan 19, 2023
b44506e
Update 4-data-validation.md
tjyoon0324 Jan 19, 2023
13b8c58
Update 2-data-deal.md
tjyoon0324 Jan 19, 2023
6090c08
Update 6-incentives.md
tjyoon0324 Jan 19, 2023
f2a5463
Update 6-incentives.md
tjyoon0324 Jan 19, 2023
8a36429
docs: update 5-confidential-oracle.md (#622)
tjyoon0324 Jan 19, 2023
be7f0b3
Update 1-oracle-installation.md
tjyoon0324 Jan 19, 2023
19db378
Update 2-oracle-intialization.md
tjyoon0324 Jan 20, 2023
66883c8
Update 3-genesis-oracle.md
tjyoon0324 Jan 20, 2023
1e75822
Update 4-oracle-registration.md
tjyoon0324 Jan 20, 2023
342abaa
Update and rename 5-running-node.md to 5-running-oracle-node.md
tjyoon0324 Jan 20, 2023
ed0f996
Update 6-update-oracle-info.md
tjyoon0324 Jan 20, 2023
7afe97e
Update 7-oracle-upgrade.md
tjyoon0324 Jan 20, 2023
769e1b8
Update 8-verify-remote-report.md
tjyoon0324 Jan 20, 2023
1439033
Update .gitbook/5-oracles/1-operate-oracle-nodes/5-running-oracle-nod…
tjyoon0324 Jan 20, 2023
8d8c3d2
Update 5-running-oracle-node.md
tjyoon0324 Jan 20, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Now, MediBloc would like to shift its focus to boosting the potential of Panacea

Nowadays, many businesses and technologies are data-driven. Many companies are already familiar with handling large dataset and deriving new values by analyzing sets of data. But, secure data exchange is still the one of the hardest area for data-driven industries. Data requesters want well-refined data or fine-grained raw data for successful data analysis. But, data owners (individuals) don’t want their privacy exposed and abused. Additionally, Web3 users are already aware that proper rewards should be guaranteed for their data and actions transparently on Web3. Traditional systems in Web2 have solved this issue in various ways, but MediBloc believes that we all can build more transparent and reliable systems for secure data exchange in Web3 ecosystem.

Our data exchange protocol has the concept of data Pool, so that anyone can specify the type and the quantity of the data they want. Also, they can specify how much cryptocurrency they are willing to pay for the data. All of these data pools are recorded in Panacea and everyone who wants to sell their data can see all data pools. Data sellers can choose data pools by checking how many parts of their data to be shared to data buyers. Then, they sign the consents for data exchange. Verified off-chain data validators validate whether data provided by data sellers conforms to criteria that data pool creator has specified. If all the requirements are met, the data is provided to data buyers via secure connections and the promised amount of cryptocurrency is transferred to data sellers. In this entire protocol, data is not recorded on any blockchain such as Panacea. All data transmissions are performed off-chain and Panacea guarantees all agreements for data exchanges and transparent payments.
Our data exchange protocol has the concept of data Pool, so that anyone can specify the type and the quantity of the data they want. Also, they can specify how much cryptocurrency they are willing to pay for the data. All of these data pools are recorded in Panacea and everyone who wants to sell their data can see all data pools. Data providers can choose data pools by checking how many parts of their data to be shared to data consumers. Then, they sign the consents for data exchange. Verified off-chain data validators validate whether data provided by data providers conforms to criteria that data pool creator has specified. If all the requirements are met, the data is provided to data consumers via secure connections and the promised amount of cryptocurrency is transferred to data providers. In this entire protocol, data is not recorded on any blockchain such as Panacea. All data transmissions are performed off-chain and Panacea guarantees all agreements for data exchanges and transparent payments.

This data exchange protocol is being developed to be as general as possible, so that not only the healthcare data but also all the other types of data can be handled by the protocol. Since Panacea and data exchange protocol is publicly opened, any service providers can build their own services on the top of the data exchange protocol, so that their users can exchange their data securely and get proper rewards. As the first use case, MediBloc is going to build a healthcare data marketplace service based on this protocol.
Well, it sounds like the protocol should work well, right? However, there are so many issues that we have to resolve. For privacy and security, data sellers should be able to expose only a small part of their data that is really desired by data buyers. Data transmission must be secure, so that anyone cannot steal data. In order to guarantee the right of data buyers, all criteria that data buyers specified has to be validated clearly before the payment is finalized. In addition, the ecosystem should be attractive enough for many data sellers and buyers to join.
Well, it sounds like the protocol should work well, right? However, there are many issues that we have to resolve. For privacy and security, data providers should be able to expose only a small part of their data that is really desired by data consumers. Also, data transmission must be secure, so that no one can steal or intercept the data. In order to guarantee the right of data consumers, all criteria that data consumers specified has to be validated clearly before the payment is finalized. Last but not least, the ecosystem should be attractive enough for many data providers and consumers to join.

In order to resolve these challenges, the team is developing this data exchange protocol with several latest technologies.
The detailed tech stack of the data exchange protocol is described in the [Panacea Ecosystem](./panacea-ecosystem.md) document.
The detailed tech stack of the data exchange protocol is described in the [Panacea Ecosystem](./0-panacea-ecosystem.md) document.

There will be more details that we have to solve, and we know that all of them cannot be achieved in one step. Hence, we will complete this big task step by step. In 2022, MediBloc will release the v0 of data exchange protocol as a proof of concept that includes only essential features. Also, a data marketplace web service will be introduced as a simple example service based on the protocol. Based on this proof of concepts, the data exchange protocol will be improved as v1 from 2023 with enhanced security and interoperability. MediBloc has already opened all source codes and progresses publicly on GitHub. We encourage anyone to join the project and share your insights.
There will be more detailed issues that we would have to solve, and we know that all of them cannot be solved in one step. Hence, we will complete this big task step by step. In 2022, MediBloc have released the v0 of data exchange protocol as a proof of concept that includes only essential features on testnet. Based on this proof of concepts, the data exchange protocol will be improved as v1 in 2023 with enhanced security and interoperability. Also, MediBloc will be introducing dApps for data providers using data exchange protocol and keep designing the services that go on top of data exchange protocol. MediBloc has already opened all source codes and progresses publicly on GitHub. We encourage anyone to join the project and share your insights.
We are so excited and thrilled to share our vision to achieve our goal to become the world’s best patient centric health data platform. Thank you for your continued support!
File renamed without changes.
43 changes: 43 additions & 0 deletions .gitbook/1-users/3-data-exchange/0-about-dep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# About Data Exchange Protocol

Data Exchange Protocol (hereafter 'DEP') is a communication layer for sharing and exchanging various types of data
between two parties in decentralized environments.


## What can you do with DEP?

Data consumers can open data deals by specifying the type, the quantity, and the pricing of the data that they are willing to consume.

Data providers can choose and participate in the deals that match the data that they have when they are willing to provide.

To guarantee data consumers only consume data in the form they want,
decentralized oracles verify and issue certificates for all data being provided by the data provider.

Panacea public blockchain manages the status of all data deals and data sharing consents,
ensuring data providers and ecosystem operators are rewarded appropriately.


## Motivation and Goals

### Data Ownership and Sovereignty

The ultimate goal of owning our own data is having a control about how our data is used.

### Decentralized off-chain data validation

To ensure data consumers can only consume data that they want, all data being shared must be validated by
decentralized players who are not malicious.

### Privacy

Throughout the entire process of data verification and transmission,
the data content must not be exposed to anyone other than the consumer intended by the data provider.

### Generalized data exchange

Not only healthcare data, but various types of data should be covered through this protocol.

### Open-sourced protocol

All protocol specifications and implementations must be open-sourced, so any participants can understand
how data is exchanged and how privacy is guaranteed.
108 changes: 108 additions & 0 deletions .gitbook/1-users/3-data-exchange/1-consume-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Consume data

Data consumers can open data deals by specifying the type, the quantity, and the pricing of the data that they are willing to consume.

Data deals are registered in the Panacea public blockchain, so all data providers can find data deals, which match their data.


## Create a data deal

Broadcast the following `create-deal` transaction with specifying data schema, a data count, and a budget in the deal-file in JSON format.
```bash
panacead tx datadeal create-deal ${deal-file-path} \
--from ${data-consumer-addr} \
--chain-id ${chain-id} \
--gas auto --gas-adjustment 1.30 --gas-prices 5umed \
--node ${chain-node-rpc-addr}
```

For `deal-file-path`, create a following JSON file.
```json
{
"data_schema": [
"http://jsonschema.gopanacea.org/vaccination-cert.json"
],
"budget": {
"denom": "umed",
"amount": "1000000"
},
"max_num_data": 10,
"consumer_address": "panacea1..."
}
```
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.
```bash
panacead query datadeal deal ${deal-id} \
--node ${chain-node-rpc-addr}
```
Also, you can query all deals registered in the chain.
```bash
panacead query datadeal deals \
--node ${chain-node-rpc-addr}
```


## Query consents

If some data providers have data that fit the requirements of your data deal, they will submit consents to the chain.
The consent means that the data provider has agreed to provide their data to a specific data consumer.
Also, each consent can contain a data validation certificate issued by an oracle, so that data consumers can trust the validity of data.

As soon as data providers submit their consents, you can query all consents submitted to a specific data deal.
```bash
panacead query datadeal consents ${deal-id} \
--node ${chain-node-rpc-addr}
```
Or, you can query a specific consent, which contains a certain data hash.
```bash
panacead query datadeal consent ${deal-id} ${data-hash} \
--node ${chain-node-rpc-addr}
```

For more details about data consents, please see the [Data Provider Consent](../../3-protocol-devs/1-dep-specs/3-data-provider-consent.md) specification.


## Access data

A data validation certificate issued by an oracle contains the methods to access the data.
For example, if the oracle decides to transmit data via [IPFS](https://ipfs.tech/), the certificate will contain a [CID](https://docs.ipfs.io/concepts/content-addressing/) of data.
If so, you can access any IPFS node connected to the public IPFS network, and obtain the data.

For more details about data validation certificates, please see the [Data Validation](../../3-protocol-devs/1-dep-specs/4-data-validation.md) specification.

In general, the data transmitted is encrypted by oracles, so that only a specific data consumer is able to decrypt it.
Using the following REST API, you can get a secret key of each data from the oracle that issued the data validation certificate.
```bash
curl -v -X GET -H "Authorization: Bearer ${jwt}" \
"${oracle-url}/v0/data-deal/secret-key?deal-id=${deal-id}&data-hash=${data-hash}"
```
You must specify a JWT issued using your account key in order to prove that you are the data consumer who created the data deal.
For this authentication, the JWT must be signed by your (data consumer's) chain account private key.

We highly recommend to set the expiration of JWT as short as possible for security reasons.
You can use the `panacead` CLI to issue JWTs easily by the following command.
In near future, the protocol will adopt the 'nonce' concept to improve the security of authentications.
```bash
panacead issue-jwt ${expiration-duration} --from ${your-account-key-name}

# e.g.
# panacead issue-jwt 10s --from panacea1zqum...
```

Please note that the returned secret key is also encrypted, so that only the specific data consumers can decrypt the key using his/her chain account private key.
Nevertheless, we highly recommend you to communicate with oracles who provides an HTTPS endpoint with SSL/TLS encryption.

Using the encrypted secret key that you obtained from the oracle, you can decrypt data by the following CLI.
```bash
panacead decrypt-data ${input-file-path} ${your-account-key-name} ${encrypted-secret-key} \
--node ${chain-node-rpc-addr}
```
This command will decrypt the secret key using your account key first, and decrypt the data using the decrypted secret key.
So, please note that you should specify the `your-account-key-name` which is registered in the `panacead` keyring.
97 changes: 97 additions & 0 deletions .gitbook/1-users/3-data-exchange/2-provide-data.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Provide data

Data providers can provide their data that match the requirements of the data deal and in return earn a reward.

Since only the data verified by oracle can be provided to a deal, providers should first request data verification to oracle.

As a result of verification, oracle will issue a certificate, then provider can provide their data by submitting a consent with the certificate to Panacea.

In the whole process of data transmission, the data is encrypted so that no one can access the original data.

The transmission of data and the payment of rewards are managed atomically through the Panacea, so consumers can get the data only when the reward payment is completed.

## Request data verification to oracle

Before request to oracle, you should encrypt your data for privacy preserving.
Encryption can be done using your chain account key and oracle public key which is registered in Panacea.
This makes only oracles can decrypt and verify your original data in secure area.
For more details about data secure area, please see [Confidential Oracle](../../3-protocol-devs/1-dep-specs/5-confidential-oracle.md).

You can encrypt data by the following CLI:
```bash
panacead encrypt-data ${input-file-path} ${your-account-key-name}
```

You must specify a JWT issued by yourself in order to prove that you are the data provider.
For that authentication, the JWT must be signed by your (data provider's) chain account private key.

We highly recommend to set the expiration of JWT as short as possible for security reasons.
In the near future, the protocol will adopt the 'nonce' concept to improve the security of authentications.

You can issue JWT by the following CLI:
```bash
panacead issue-jwt ${expiration-duration} --from ${your-account-key-name}

# e.g.
# panacead issue-jwt 10s --from panacea1zqum...
```

Using the following REST API, you can post encrypted data to oracle for verification with deal ID you want to provide.
```bash
curl -v -X POST -H "Authorization: Bearer ${jwt}" ${oracle-url}/v0/data-deal/deals/${deal-id}/data -d ${encrpyted-data-json-path}
```

For `encrpyred-data-json`, create a following JSON file.
```json
{
"provider_address" : "{your-address}",
"data_hash" : "{data-hash-of-original-data}",
"encrypted_data_base64" : "{encrypted-data}"
}
```
You have to use data hash of original data with SHA-256 hash function. For example, you can get hash by following CLI:
```bash
sha256sum ${original-data-path}
```

Through this process, the data is safely and securely transmitted to oracle, and the oracle verifies the data hash and data schema.
For more details about oracle data validation, please see the [Data Validation](../../3-protocol-devs/1-dep-specs/4-data-validation.md) specification.

When the verification is completed, you can get a data certificate that includes the oracle's signature.
The certificate form is like below:
```json
{
"unsigned_certificate" : {
"cid" : "{ipfs-cid}",
"unique_id" : "{oracle-unique-id}",
"oracle_address" : "{oracle-address}",
"deal_id": "{deal-id}",
"provider_address" : "{your-address}",
"data_hash" : "{data-hash}"
},
"signature" : "{oracle-signature}"
}
```
Now you can use this certificate in the next step.

## Submit consent

Broadcast the following `submit-consent` transaction with certificate from oracle.
```bash
panacead submit-consent ${certificate-file-path} \
--from ${data-provider-addr} \
--chain-id ${chain-id} \
--gas auto --gas-adjustment 1.30 --gas-prices 5umed \
--node ${chain-node-rpc-addr}
```

After you submit consent, Panacea verifies the certificate and checks the status of the deal.

When the verification is completed, Panacea makes the data accessible to consumers and makes you can get reward.

## Query consent
You can query a consent by the deal ID and data hash you provided.
```bash
panacead query datadeal consent ${deal-id} ${data-hash} \
--node ${chain-node-rpc-addr}
```
File renamed without changes.
19 changes: 19 additions & 0 deletions .gitbook/3-protocol-devs/1-dep-specs/0-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Data Exchange Protocol Specifications

Prior to diving into the technical specifications of Data Exchange Protocol (hereafter 'DEP'),
we recommend you to understand the definition of DEP, its motivation, and its goals from the [About DEP](../../1-users/3-data-exchange/0-about-dep.md) documentation.

## Specifications

In the following sections, you can find detailed protocol specifications including technical architectures, message formats,
hardware requirements, and core implementation details.

According to these specifications, protocol developers can make implementations
based on various programming languages and infrastructure.

1. [User Flow](1-user-flow.md)
2. [Data Deal](2-data-deal.md)
3. [Data Provider Consent](3-data-provider-consent.md)
4. [Data Validation](4-data-validation.md)
5. [Confidential Oracle](5-confidential-oracle.md)
6. [Incentives](6-incentives.md)
Loading