Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
153 changes: 60 additions & 93 deletions src/manage-data/dataProtector/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,129 +2,97 @@

Types in DataProtector.

## GrantedAccess
## 🔑 GrantedAccess

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

`string`
- Address of the `protectedData` containing user data

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

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

`string`
### volume: <span class="text-yellow">`string`</span>

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

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

`string`
- Defines whether a `protectedData` is usable in a TEE environment; `0x00` is
TEE while `0x03` is non-TEE

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

### tag
- Address of the authorized application; a value of 0x0 indicates any
application may access this data

`string`
### requesterrestrict: <span class="text-yellow">`string`</span>

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

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

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

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

### requesterrestrict
- Random value to make an order unique and reusable as nonce in a blockchain
transaction

`string`
### sign: <span class="text-yellow">`string`</span>

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

### workerpoolrestrict
## 🔐 ProtectedData

`string`
### name: <span class="text-yellow">`string`</span>

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

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

`string`
- Ethereum address of the protected data.

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

### sign
- Ethereum address of the protected data owner.

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

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

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

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

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

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

### address
## ❌ RevokedAccess

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

Ethereum address of the protected data.
- The granted access that was revoked.

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

`Address`

Ethereum address of the protected data owner.

### schema

`DataSchema`

Data schema for the protected data as defined when the protected data was
created (see [protectedData](./dataProtectorCore/protectData.md)). `schema`
provides a structured representation of the protected data format and
attributes. This field plays a crucial role in understanding and interpreting
the underlying structure of the sensitive information.

### creationTimestamp

`number`

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

### multiaddr

`string` | `undefined`

The multiaddr field is the IPFS path of your encrypted data.

## RevokedAccess

### access

[`GrantedAccess`](./types.md#grantedaccess)

The granted access that was revoked.

### txHash

`string`

The ID of the transaction that happened on iExec's side chain. You may view
details on the transaction using the [iExec explorer](https://explorer.iex.ec).
- The ID of the transaction that happened on iExec's side chain. You may view
details on the transaction using the
[iExec explorer](https://explorer.iex.ec).

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

## SuccessWithTransactionHash

### txHash
## ✅ SuccessWithTransactionHash

`string`
### txHash: <span class="text-yellow">`string`</span>

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

<!-- prettier-ignore-start -->
_Hash example:_ `0xc9c2d58fc01fe54149b7daf49a0026d4ab1fdd3d10fb7c76350790fff03fe24d`
Expand Down
35 changes: 17 additions & 18 deletions src/manage-data/guides/create-and-share-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ description:
**Want to keep your data private while still using it in confidential
applications?**

Here's how DataProtector works: first you encrypt your data, then manage your
orders to control exactly who can access it, how many times, and at what price.

Once data is protected, it's only accessible inside secure enclaves (TEEs) by
the specific people and iApps you authorize through the orders you create. No
exceptions.
DataProtector lets you encrypt data and control access through orders -
specifying who can use it, how many times, and at what price. Protected data is
only accessible in secure enclaves (TEEs) by authorized users and iApps.

## Installation

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

### What You Can Protect

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

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

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

::: tip

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

## Grant Access

**Here's the key:** The protocol blocks all access to your protected data by
default. You must explicitly grant permission for each app and user combination.
By doing this, you publish signed orders that ensure your protected data stays
private while controlling access to it.
By default, your protected data is private. To let others use it, you need to
grant access to both:

- An authorized user (who can trigger the processing)
- An authorized iApp (the application that will process the data in the private
environment)

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

```ts twoslash
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
Expand Down
5 changes: 5 additions & 0 deletions src/manage-data/guides/handle-schemas-dataset-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ MIME types manually.

## Why Schemas Matter

- **Clarity**: Makes your data easier to understand and reuse
- **Safety**: Ensures iExec apps don’t process the wrong data
- **Structure**: Facilitates structured communication between **front-end and
iApp logic**

### 🎯 **For iApp Development**

Schemas let your iApps validate and process data safely:
Expand Down
Loading