Skip to content

Commit 2776454

Browse files
committed
Guides pour la section protect and manage data
Page Guide Guide Protect and share Guide Schema and Data Type Guide Data Monetization
1 parent a461648 commit 2776454

File tree

5 files changed

+775
-102
lines changed

5 files changed

+775
-102
lines changed

manage_data/guides.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: DataProtector Guides
3+
description:
4+
Step-by-step guides for protecting, managing, and monetizing your data with
5+
iExec DataProtector
6+
---
7+
8+
# 📖 DataProtector Guides
9+
10+
**Master data protection, sharing, and monetization** with these comprehensive
11+
step-by-step guides. Each guide focuses on a specific aspect of building with
12+
DataProtector.
13+
14+
## Essential Guides
15+
16+
### 🛡️ [Create and Share Access to Protected Data](/manage_data/guides/create-and-share-access)
17+
18+
**Start here if you're new to DataProtector.** Learn how to protect your data
19+
and control exactly who can access it.
20+
21+
- Protect data with client-side encryption
22+
- Grant access to specific users and apps
23+
- Set pricing and usage limits
24+
- Debug mode for development
25+
26+
---
27+
28+
### 🏷️ [Handle Schemas and Dataset Types](/manage_data/guides/handle-schemas-dataset-types)
29+
30+
**Understand how your data structure works with iApps.** Learn about automatic
31+
schema generation and how to use data types effectively.
32+
33+
- Auto-generated schemas from your JSON data
34+
- Supported data types and format conversion
35+
- Using schemas in iApp development
36+
- Type safety and error handling
37+
38+
---
39+
40+
### 💰 [Manage Data Monetization](/manage_data/guides/manage-data-monetization)
41+
42+
**Turn your protected data into revenue.** Explore different monetization
43+
strategies from simple pay-per-use to advanced marketplace distribution.
44+
45+
- Pay-per-use with DataProtector Core
46+
- DataProtector Sharing with collections
47+
- Rental, subscription, and sale models
48+
- Revenue optimization strategies
49+
50+
## Quick Navigation
51+
52+
::: tip What You'll Learn These guides cover the complete journey from
53+
protecting your first dataset to building a sustainable data business with
54+
automated monetization. :::
55+
56+
### By Use Case
57+
58+
- **🚀 Just getting started?**
59+
[Create and Share Access](/manage_data/guides/create-and-share-access)
60+
- **🔧 Building an iApp?**
61+
[Handle Schemas and Dataset Types](/manage_data/guides/handle-schemas-dataset-types)
62+
- **💡 Want to monetize data?**
63+
[Manage Data Monetization](/manage_data/guides/manage-data-monetization)
64+
65+
### By Experience Level
66+
67+
**Beginner**: Start with data protection basics
68+
[Create and Share Access](/manage_data/guides/create-and-share-access)
69+
70+
**Intermediate**: Learn about data structures and iApp integration
71+
[Handle Schemas and Dataset Types](/manage_data/guides/handle-schemas-dataset-types)
72+
73+
**Advanced**: Explore monetization strategies and business models
74+
[Manage Data Monetization](/manage_data/guides/manage-data-monetization)
75+
76+
## Additional Resources
77+
78+
### 📚 **SDK Reference**
79+
80+
- [DataProtector Core SDK](/manage_data/dataProtector/dataProtectorCore) -
81+
Complete method reference
82+
- [DataProtector Sharing SDK](/manage_data/dataProtector/dataProtectorSharing) -
83+
Advanced distribution features
84+
- [Type Definitions](/manage_data/dataProtector/types) - TypeScript interfaces
85+
and types
86+
87+
### 🎯 **Real Examples**
88+
89+
- [Content Creator Demo](/overview/use-case-demo/content-creator) - Live example
90+
of data monetization
91+
- [Hello World Tutorial](/overview/helloWorld) - End-to-end walkthrough
92+
93+
### 🔧 **Advanced Topics**
94+
95+
- [Apps Whitelist](/manage_data/dataProtector/advanced/apps-whitelist) - Control
96+
which iApps can access data
97+
- [Smart Contract Details](/manage_data/dataProtector/advanced/dps-smart-contract) -
98+
Blockchain implementation
99+
- [Migration Guide](/manage_data/dataProtector/migrate-from-v1) - Upgrade from
100+
v1 to v2
101+
102+
---
103+
104+
**Ready to start?** Pick the guide that matches your current goal and dive in!
105+
🚀
Lines changed: 186 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,192 @@
11
---
22
title: Create and Share Access to Protected Data
3-
description: Créer et partager l'accès aux données protégées
3+
description:
4+
Learn how to protect data and grant secure access for specific apps and users
45
---
56

6-
# Create and Share Access to Protected Data
7+
# 🛡️ Create and Share Access to Protected Data
78

8-
Cette page est en cours de développement.
9+
**Want to keep your data private while still using it in applications?** Here's
10+
how DataProtector works: first you encrypt your data, then you control exactly
11+
who can access it and when.
912

10-
<!-- TODO: Ajouter le guide de création et partage d'accès -->
13+
Once data is protected, it's only accessible inside secure enclaves (TEEs) by
14+
the specific people and iApps you authorize. No exceptions.
15+
16+
## Quick Start
17+
18+
First, install DataProtector in your project:
19+
20+
::: code-group
21+
22+
```bash [npm]
23+
npm install @iexec/dataprotector
24+
```
25+
26+
```bash [yarn]
27+
yarn add @iexec/dataprotector
28+
```
29+
30+
```bash [pnpm]
31+
pnpm add @iexec/dataprotector
32+
```
33+
34+
:::
35+
36+
## Protect Your Data
37+
38+
**Here's what happens:** Your data gets encrypted client-side and stored as an
39+
NFT. Only you control who can decrypt and use it.
40+
41+
```ts
42+
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
43+
44+
const web3Provider = getWeb3Provider('PRIVATE_KEY');
45+
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
46+
47+
const protectedData = await dataProtectorCore.protectData({
48+
name: 'My Email Contact',
49+
data: {
50+
51+
firstName: 'Alice',
52+
lastName: 'Smith',
53+
},
54+
});
55+
56+
console.log('Protected data address:', protectedData.address);
57+
```
58+
59+
### What You Can Protect
60+
61+
**Data**: Any JSON object with custom keys. Think user profiles, API
62+
credentials, datasets, model parameters - anything you want to keep private but
63+
still use in computations.
64+
65+
**Supported types**: Strings, numbers, booleans, nested objects, files (convert
66+
to ArrayBuffer first), and arrays (convert to Record format).
67+
68+
**Limits**: File size depends on your storage choice (IPFS or Arweave). For
69+
large datasets, consider using another IPFS node.
70+
71+
::: tip Need Help? Check our
72+
[Schema and Dataset Types guide](/manage_data/guides/handle-schemas-dataset-types)
73+
for detailed formatting instructions. :::
74+
75+
### Debug Mode Option
76+
77+
```ts
78+
const protectedData = await dataProtectorCore.protectData({
79+
data: { email: '[email protected]' },
80+
allowDebug: true, // Only for development/testing
81+
});
82+
```
83+
84+
::: warning Debug mode lets you test with debug iApps during development. As
85+
"debug" iApps don't have the same security standards, we recommend using this
86+
mode only during iApp development. :::
87+
88+
## Grant Access
89+
90+
**Here's the key:** The protocol blocks all access to your protected data by
91+
default. You must explicitly grant permission for each app and user combination.
92+
93+
Once you own protected data, here's how to share access:
94+
95+
```ts
96+
const grantedAccess = await dataProtectorCore.grantAccess({
97+
protectedData: '0x123abc...', // Your protected data address
98+
authorizedApp: '0x456def...', // iApp that can process the data
99+
authorizedUser: '0x789cba...', // User who can trigger the processing
100+
pricePerAccess: 0, // Cost per use (in nRLC)
101+
numberOfAccess: 10, // Maximum number of uses
102+
});
103+
```
104+
105+
### Parameters Explained
106+
107+
#### `protectedData` <Badge type="danger" text="required" />
108+
109+
The address of your protected data (returned when you created it). **You must
110+
own this data** to grant access.
111+
112+
#### `authorizedApp` <Badge type="danger" text="required" />
113+
114+
**What it is**: The iApp address that's allowed to process your data inside the
115+
secure enclave.
116+
117+
**Why needed**: This ensures only specific, audited applications can access your
118+
data. No random code can touch it.
119+
120+
**Pro tip**: Use app whitelists for production. Instead of a single app address,
121+
you can specify a whitelist contract that contains multiple approved app
122+
versions. Very useful for when you need to upgrade your iApps, without losing
123+
all the granted access.
124+
125+
```ts
126+
// Single app
127+
authorizedApp: 'web3mail.apps.iexec.eth';
128+
129+
// Or use a whitelist (recommended for production)
130+
authorizedApp: '0x781482C39CcE25546583EaC4957Fb7Bf04C277D2'; // Web3Mail whitelist
131+
```
132+
133+
#### `authorizedUser` <Badge type="danger" text="required" />
134+
135+
**What it is**: The wallet address that can initiate processing of your data.
136+
137+
**Why needed**: Even with an authorized app, only specific users can trigger the
138+
computation. This gives you granular control over who uses your data.
139+
140+
**Don't forget**: Even if you are the owner of the data, you need to authorize
141+
yourself!
142+
143+
**Special case**: Set to `0x0000000000000000000000000000000000000000` to allow
144+
**any user** to trigger processing (useful for public datasets).
145+
146+
#### `pricePerAccess` <Badge type="tip" text="optional" />
147+
148+
**Quick explanation**: How much you charge per data usage (in nano RLC - nRLC).
149+
150+
Set to `0` for free access, or specify a price to monetize your data
151+
automatically.
152+
153+
**Example**: `pricePerAccess: 1000000000` = 1 RLC per access
154+
155+
**Want to learn more monetization capabilities?** See our detailed
156+
[Manage Data Monetization guide](/manage_data/guides/manage-data-monetization)
157+
158+
#### `numberOfAccess` <Badge type="tip" text="optional" />
159+
160+
**Quick explanation**: Maximum number of times this authorization can be used.
161+
162+
::: warning Important If someone tries to process your data more times than
163+
allowed, they'll get a "no dataset orders" error. Set this high enough for your
164+
use case. :::
165+
166+
**Example values**:
167+
168+
- `1` - Single use (great for one-time data analysis)
169+
- `100` - Limited campaign (email marketing with usage cap)
170+
- `10000` - Effectively unlimited for most use cases
171+
172+
## What's Next?
173+
174+
**You now have protected data with controlled access.** Here are your next
175+
steps:
176+
177+
- **Process the data**: Use
178+
[processProtectedData](/manage_data/dataProtector/dataProtectorCore/processProtectedData)
179+
to run computations
180+
- **Manage access**:
181+
[Revoke](/manage_data/dataProtector/dataProtectorCore/revokeOneAccess) or
182+
[modify permissions](/manage_data/dataProtector/dataProtectorCore/grantAccess)
183+
anytime
184+
- **Learn data types**: Deep dive into
185+
[schemas and dataset types](/manage_data/guides/handle-schemas-dataset-types)
186+
- **Monetize data**: Explore
187+
[data monetization strategies](/manage_data/guides/manage-data-monetization)
188+
189+
---
190+
191+
**TL;DR**: Protect data → Grant access to specific app + user → Data stays
192+
encrypted except inside authorized secure enclaves. You keep full control. 🔒

0 commit comments

Comments
 (0)