Skip to content

Commit fd963a6

Browse files
authored
Feature/protect and manage data martin (#12)
2 parents 4b540d9 + d7c6ea8 commit fd963a6

File tree

4 files changed

+272
-150
lines changed

4 files changed

+272
-150
lines changed

src/manage-data/dataProtector/types.md

Lines changed: 60 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2,129 +2,97 @@
22

33
Types in DataProtector.
44

5-
## GrantedAccess
5+
## 🔑 GrantedAccess
66

7-
### dataset
7+
### dataset: <span class="text-yellow">`string`</span>
88

9-
`string`
9+
- Address of the `protectedData` containing user data
1010

11-
Address of the `protectedData` containing user data
11+
### datasetprice: <span class="text-yellow">`string`</span>
1212

13-
### datasetprice
13+
- Price (iun nRLC) to charge the user specified in `requesterrestrict` for each
14+
use of this `protectedData`
1415

15-
`string`
16+
### volume: <span class="text-yellow">`string`</span>
1617

17-
Price (iun nRLC) to charge the user specified in `requesterrestrict` for each
18-
use of this `protectedData`
18+
- Number of authorized uses of this `protectedData`; each use decrements this
19+
counter
1920

20-
### volume
21+
### tag: <span class="text-yellow">`string`</span>
2122

22-
`string`
23+
- Defines whether a `protectedData` is usable in a TEE environment; `0x00` is
24+
TEE while `0x03` is non-TEE
2325

24-
Number of authorized uses of this `protectedData`; each use decrements this
25-
counter
26+
### apprestrict: <span class="text-yellow">`string`</span>
2627

27-
### tag
28+
- Address of the authorized application; a value of 0x0 indicates any
29+
application may access this data
2830

29-
`string`
31+
### requesterrestrict: <span class="text-yellow">`string`</span>
3032

31-
Defines whether a `protectedData` is usable in a TEE environment; `0x00` is TEE
32-
while `0x03` is non-TEE
33+
- Address of the requester authorized to use this `protectedData` in workloads;
34+
a value of 0x0 indicates any requester may use this data
3335

34-
### apprestrict
36+
### workerpoolrestrict: <span class="text-yellow">`string`</span>
3537

36-
`string`
38+
- Address of the decentralized infrastructure (worker pool) authorized to
39+
execute the application; a value of 0x0 indicates any worker pool may access
40+
this data
3741

38-
Address of the authorized application; a value of 0x0 indicates any application
39-
may access this data
42+
### salt: <span class="text-yellow">`string`</span>
4043

41-
### requesterrestrict
44+
- Random value to make an order unique and reusable as nonce in a blockchain
45+
transaction
4246

43-
`string`
47+
### sign: <span class="text-yellow">`string`</span>
4448

45-
Address of the requester authorized to use this `protectedData` in workloads; a
46-
value of 0x0 indicates any requester may use this data
49+
- Order signature of all the `grantedAccess` fields
4750

48-
### workerpoolrestrict
51+
## 🔐 ProtectedData
4952

50-
`string`
53+
### name: <span class="text-yellow">`string`</span>
5154

52-
Address of the decentralized infrastructure (worker pool) authorized to execute
53-
the application; a value of 0x0 indicates any worker pool may access this data
55+
- Name specified when the protected data was created. This piece of information
56+
is public and visible on-chain.
5457

55-
### salt
58+
### address: <span class="text-yellow">`Address`</span>
5659

57-
`string`
60+
- Ethereum address of the protected data.
5861

59-
Random value to make an order unique and reusable as nonce in a blockchain
60-
transaction
62+
### owner: <span class="text-yellow">`Address`</span>
6163

62-
### sign
64+
- Ethereum address of the protected data owner.
6365

64-
`string`
66+
### schema: <span class="text-yellow">`DataSchema`</span>
6567

66-
Order signature of all the `grantedAccess` fields
68+
- Data schema for the protected data as defined when the protected data was
69+
created (see [protectedData](./dataProtectorCore/protectData.md)). `schema`
70+
provides a structured representation of the protected data format and
71+
attributes. This field plays a crucial role in understanding and interpreting
72+
the underlying structure of the sensitive information.
6773

68-
## ProtectedData
74+
### creationTimestamp: <span class="text-yellow">`number`</span>
6975

70-
### name
76+
- Timestamp specifying when the protected data was created, expressed in
77+
milliseconds since the epoch. This timestamp provides precise information
78+
about the moment of creation and can be used for chronological ordering or
79+
time-based operations.
7180

72-
`string`
81+
### multiaddr: <span class="text-yellow">`string` | `undefined`</span>
7382

74-
Name specified when the protected data was created. This piece of information is
75-
public and visible on-chain.
83+
- The multiaddr field is the IPFS path of your encrypted data.
7684

77-
### address
85+
## ❌ RevokedAccess
7886

79-
`Address`
87+
### access: <span class="text-yellow">[`GrantedAccess`](#🔑-grantedaccess)</span>
8088

81-
Ethereum address of the protected data.
89+
- The granted access that was revoked.
8290

83-
### owner
91+
### txHash: <span class="text-yellow">`string`</span>
8492

85-
`Address`
86-
87-
Ethereum address of the protected data owner.
88-
89-
### schema
90-
91-
`DataSchema`
92-
93-
Data schema for the protected data as defined when the protected data was
94-
created (see [protectedData](./dataProtectorCore/protectData.md)). `schema`
95-
provides a structured representation of the protected data format and
96-
attributes. This field plays a crucial role in understanding and interpreting
97-
the underlying structure of the sensitive information.
98-
99-
### creationTimestamp
100-
101-
`number`
102-
103-
Timestamp specifying when the protected data was created, expressed in
104-
milliseconds since the epoch. This timestamp provides precise information about
105-
the moment of creation and can be used for chronological ordering or time-based
106-
operations.
107-
108-
### multiaddr
109-
110-
`string` | `undefined`
111-
112-
The multiaddr field is the IPFS path of your encrypted data.
113-
114-
## RevokedAccess
115-
116-
### access
117-
118-
[`GrantedAccess`](./types.md#grantedaccess)
119-
120-
The granted access that was revoked.
121-
122-
### txHash
123-
124-
`string`
125-
126-
The ID of the transaction that happened on iExec's side chain. You may view
127-
details on the transaction using the [iExec explorer](https://explorer.iex.ec).
93+
- The ID of the transaction that happened on iExec's side chain. You may view
94+
details on the transaction using the
95+
[iExec explorer](https://explorer.iex.ec).
12896

12997
<!-- prettier-ignore-start -->
13098
_Hash example:_ `0xc9c2d58fc01fe54149b7daf49a0026d4ab1fdd3d10fb7c76350790fff03fe24d`
@@ -133,14 +101,13 @@ _Hash example:_ `0xc9c2d58fc01fe54149b7daf49a0026d4ab1fdd3d10fb7c76350790fff03fe
133101
You can read more about he iExec Explorer
134102
[here](https://protocol.docs.iex.ec/for-developers/toolbox/iexec-explorer).
135103

136-
## SuccessWithTransactionHash
137-
138-
### txHash
104+
## ✅ SuccessWithTransactionHash
139105

140-
`string`
106+
### txHash: <span class="text-yellow">`string`</span>
141107

142-
The hash of the transaction that happened on iExec's side chain. You may view
143-
details on the transaction using the [iExec explorer](https://explorer.iex.ec).
108+
- The hash of the transaction that happened on iExec's side chain. You may view
109+
details on the transaction using the
110+
[iExec explorer](https://explorer.iex.ec).
144111

145112
<!-- prettier-ignore-start -->
146113
_Hash example:_ `0xc9c2d58fc01fe54149b7daf49a0026d4ab1fdd3d10fb7c76350790fff03fe24d`

src/manage-data/guides/create-and-share-access.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ description:
99
**Want to keep your data private while still using it in confidential
1010
applications?**
1111

12-
Here's how DataProtector works: first you encrypt your data, then manage your
13-
orders to control exactly who can access it, how many times, and at what price.
14-
15-
Once data is protected, it's only accessible inside secure enclaves (TEEs) by
16-
the specific people and iApps you authorize through the orders you create. No
17-
exceptions.
12+
DataProtector lets you encrypt data and control access through orders -
13+
specifying who can use it, how many times, and at what price. Protected data is
14+
only accessible in secure enclaves (TEEs) by authorized users and iApps.
1815

1916
## Installation
2017

@@ -65,15 +62,14 @@ console.log('Protected data address:', protectedData.address);
6562

6663
### What You Can Protect
6764

68-
**Data**: Any JSON object with custom keys. Think user profiles, API
69-
credentials, datasets, model parameters - anything you want to keep private but
70-
still use in computations.
65+
**Data**: Any kind of data you want to keep private and make available for
66+
computations by authorized users and iApps.
7167

72-
**Supported types**: Strings, numbers, booleans, nested objects, files (convert
73-
to ArrayBuffer first), and arrays (convert to Record format).
68+
**Supported types**: Common data types like text, numbers, true/false values,
69+
and files. See the [full list here](/manage-data/dataProtector/types).
7470

75-
**Limits**: File size depends on your storage choice (IPFS or Arweave). For
76-
large datasets, consider using another IPFS node.
71+
**Storage**: Store your data on IPFS or Arweave. For larger files, you can use
72+
your own IPFS node.
7773

7874
::: tip
7975

@@ -106,12 +102,15 @@ const protectedData = await dataProtectorCore.protectData({
106102

107103
## Grant Access
108104

109-
**Here's the key:** The protocol blocks all access to your protected data by
110-
default. You must explicitly grant permission for each app and user combination.
111-
By doing this, you publish signed orders that ensure your protected data stays
112-
private while controlling access to it.
105+
By default, your protected data is private. To let others use it, you need to
106+
grant access to both:
107+
108+
- An authorized user (who can trigger the processing)
109+
- An authorized iApp (the application that will process the data in the private
110+
environment)
113111

114-
Once you own protected data, here's how to share access:
112+
This ensures that only specific users can use specific applications to process
113+
your data. Here's how to set it up:
115114

116115
```ts twoslash
117116
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';

src/manage-data/guides/handle-schemas-dataset-types.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ MIME types manually.
8686

8787
## Why Schemas Matter
8888

89+
- **Clarity**: Makes your data easier to understand and reuse
90+
- **Safety**: Ensures iExec apps don’t process the wrong data
91+
- **Structure**: Facilitates structured communication between **front-end and
92+
iApp logic**
93+
8994
### 🎯 **For iApp Development**
9095

9196
Schemas let your iApps validate and process data safely:

0 commit comments

Comments
 (0)