Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions .vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ export function getSidebar() {
{
text: 'Run iApp without ProtectedData',
link: '/guides/use-iapp/run-iapp-without-ProtectedData',
collapsed: true,
items: [
{
text: 'Encrypt iApp Results',
link: '/guides/use-iapp/encrypt-result',
},
],
},
{
text: 'Integrate Web3 Messaging',
Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,31 @@ for input parameters:
- 💬 [Discord Community](https://discord.com/invite/pbt9m98wnU)
- 🐛
[Issue Tracker](https://github.com/iExecBlockchainComputing/documentation/issues)

## TODO

- Add link to the new explorer feature Asset_Types in the guide =>
`handle-schemas-dataset-types`
- Add link to remix for deploying whitelist
- Explorer l'intégration de codeSpace
- Add a Development workflow section (1 - ProtectData, 2- ...)
- Update context7 when doc will be deployed (Martin)
- Check theGraph Images with design Team
- Update the Dune Dashboard to the final version
- Add new section in `iexec-explorer.md` file to talk about: available chain on
the UI + SRLC/RLC on account section feature of the protocol
- check glossary
- migrate pay-per-task page into a guide
- check pages (introduction & getting-started) for use-iapp guide
- Schema what is iexec to do and implement
- Give recap of Workerpool address fo chains
- Talk about ENS on Bellecour(it's not supported on arbitrum)
- Talk about encrypting results in use-iapp
- Refactor "advanced" section in build-iapp
- Rework src\get-started\protocol\iexec-doracle.md (transfer to guide or
rewrite)
- Rework src\get-started\protocol\oracle.md (transfer to guide or rewrite)
- Talk about iApp secret
- Improve Guide in build-iapp section - be more clear for builder ( how to
process process protectedData, clarify input-output guide)
- Add illustration in the different pages
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ to use some confidential data to get the full potential of the **Confidential
Computing** paradigm. Check out next chapters to see how:

- [Access confidential assets from your iApp](access-confidential-assets.md)
- [Protect the result](/guides/build-iapp/advanced/protect-the-result.md)

<script setup>
import { computed } from 'vue';
Expand Down
156 changes: 0 additions & 156 deletions src/guides/build-iapp/advanced/protect-the-result.md

This file was deleted.

2 changes: 0 additions & 2 deletions src/guides/build-iapp/outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,3 @@ Continue building with these guides:
Control who can use your iApp
- **[Debugging Your iApp](/guides/build-iapp/debugging)** - Troubleshoot
execution issues
- **[How to Get and Decrypt Results](/guides/use-iapp/getting-started)** -
User-side result handling
143 changes: 143 additions & 0 deletions src/guides/use-iapp/encrypt-iapp-result.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
---
title: Encrypt iApp Results
description:
Learn how to encrypt iApp execution results using end-to-end encryption with
your own encryption key pair
---

# 🔐 Encrypt iApp Results

::: info

If you're using DataProtector, result encryption is handled automatically within

Check notice on line 12 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L12

[Google.Passive] In general, use active voice instead of passive voice ('is handled').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is handled').", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 12, "column": 50}}}, "severity": "INFO"}
the processProtectedData method, with the associated parameter. This section is
only needed for manual encryption when not using DataProtector.

:::

Secure your outputs with end‑to‑end encryption so only you (the beneficiary) can

Check notice on line 18 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L18

[Google.Parens] Use parentheses judiciously.
Raw output
{"message": "[Google.Parens] Use parentheses judiciously.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 18, "column": 60}}}, "severity": "INFO"}
read them. Results leave the enclave and may traverse untrusted storage and
networks; encryption ensures nobody else (operators, storage providers,

Check notice on line 20 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L20

[Google.Semicolons] Use semicolons judiciously.
Raw output
{"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 20, "column": 9}}}, "severity": "INFO"}
intermediaries) can access the content.

## 1) Generate your encryption key pair

The beneficiary key pair is the root of trust for result confidentiality. The
public key will be used inside the TEE to encrypt results for the beneficiary;

Check warning on line 26 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L26

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 26, "column": 12}}}, "severity": "WARNING"}

Check notice on line 26 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L26

[Google.Passive] In general, use active voice instead of passive voice ('be used').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('be used').", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 26, "column": 17}}}, "severity": "INFO"}

Check notice on line 26 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L26

[Google.Semicolons] Use semicolons judiciously.
Raw output
{"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 26, "column": 78}}}, "severity": "INFO"}
the private key stays with the beneficiary to decrypt them locally.

Run from your iExec project directory:

```bash
iexec result generate-encryption-keypair
```

This creates two files in `.secrets/beneficiary/`:

```
.secrets/
└─ beneficiary/
├─ <0x-your-wallet-address>_key # PRIVATE KEY (keep safe)
└─ <0x-your-wallet-address>_key.pub # PUBLIC KEY
```

Back up the private key securely. You will only need it locally to decrypt

Check warning on line 44 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L44

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 44, "column": 39}}}, "severity": "WARNING"}
results.

## 2) Push your public key to the SMS

Check warning on line 47 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L47

[Google.Headings] '2) Push your public key to the SMS' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '2) Push your public key to the SMS' should use sentence-style capitalization.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 47, "column": 4}}}, "severity": "WARNING"}

The Secret Management Service securely delivers your public key, at runtime, to
the enclave running your iApp. Without this, the iApp cannot encrypt outputs for

Check notice on line 50 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L50

[Google.Contractions] Use 'can't' instead of 'cannot'.
Raw output
{"message": "[Google.Contractions] Use 'can't' instead of 'cannot'.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 50, "column": 55}}}, "severity": "INFO"}
you.

Make the public key available to TEEs at runtime:

```bash
iexec result push-encryption-key --tee-framework scone
```

Verify it:

```bash
iexec result check-encryption-key --tee-framework scone
```

## 3) Run the iApp with encrypted results

The --encrypt-result flag instructs the platform to perform envelope encryption
inside the enclave using your public key, so the archive that leaves the TEE is
unreadable to others.

Trigger a task and request encrypted outputs:

```bash
iexec app run <0x-app-address> \
--workerpool <0x-workerpool-address> \
--tag tee,scone \
--encrypt-result \
--watch
```

When completed, download the results archive:

```bash
iexec task show <0x-task-id> --download
```

Inside the archive, `iexec_out/result.zip.aes` is encrypted.

Check notice on line 87 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L87

[Google.Passive] In general, use active voice instead of passive voice ('is encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is encrypted').", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 87, "column": 48}}}, "severity": "INFO"}

Note: Results are encrypted for the task beneficiary. Ensure the beneficiary

Check warning on line 89 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L89

[Google.Colons] ': R' should be in lowercase.
Raw output
{"message": "[Google.Colons] ': R' should be in lowercase.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 89, "column": 5}}}, "severity": "WARNING"}

Check notice on line 89 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L89

[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 89, "column": 15}}}, "severity": "INFO"}
address is yours to be able to decrypt the archive.

If you extract the archive and try to read the encrypted file, you'll see
unreadable content:

```bash
mkdir /tmp/trash && \
unzip <0x-your-task-id>.zip -d /tmp/trash && \
cat /tmp/trash/iexec_out/result.zip.aes
```

The output will look like:

Check warning on line 101 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L101

[Google.Will] Avoid using 'will'.
Raw output
{"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 101, "column": 12}}}, "severity": "WARNING"}

```bash
)3XqYvzEfRu<\ݵmm疞rc(a{{'ܼ͛q/[{hgD$g\.kj"s?"hJ_Q41_[{XԚa蘟vEr肽
Յ]9WTL*tdzO`!e&snoL3K6L9%
```

This confirms the results are properly encrypted and unreadable without the
private key.

## 4) Decrypt results locally

Check warning on line 111 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L111

[Google.Headings] '4) Decrypt results locally' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] '4) Decrypt results locally' should use sentence-style capitalization.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 111, "column": 4}}}, "severity": "WARNING"}

Results are encrypted end‑to‑end; only your private key can decrypt them. This

Check notice on line 113 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L113

[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('are encrypted').", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 113, "column": 9}}}, "severity": "INFO"}

Check notice on line 113 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L113

[Google.Semicolons] Use semicolons judiciously.
Raw output
{"message": "[Google.Semicolons] Use semicolons judiciously.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 113, "column": 33}}}, "severity": "INFO"}
step restores the plaintext so you can use the output files.

Check failure on line 114 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L114

[Vale.Spelling] Did you really mean 'plaintext'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'plaintext'?", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 114, "column": 19}}}, "severity": "ERROR"}

Use your private key generated in step 1:

```bash
iexec result decrypt iexec_out/result.zip.aes
```

This produces `results.zip`. Extract it to view plaintext outputs:

Check failure on line 122 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L122

[Vale.Spelling] Did you really mean 'plaintext'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'plaintext'?", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 122, "column": 49}}}, "severity": "ERROR"}

```bash
unzip results.zip -d my-decrypted-result
```

And you can see the content of your result file:

```bash
$ cat my-decrypted-result/result.txt
Hello, world!
```

Your results are now decrypted and ready to use.

## Notes and tips

- Keep the private key offline and backed up.
- You can rotate keys by re-running generation and push steps; old tasks remain
decryptable with the old private key.

Check failure on line 141 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L141

[Vale.Spelling] Did you really mean 'decryptable'?
Raw output
{"message": "[Vale.Spelling] Did you really mean 'decryptable'?", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 141, "column": 3}}}, "severity": "ERROR"}
- iApp code does not need changes to enable result encryption; it is enforced by

Check notice on line 142 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L142

[Google.Contractions] Use 'doesn't' instead of 'does not'.
Raw output
{"message": "[Google.Contractions] Use 'doesn't' instead of 'does not'.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 142, "column": 13}}}, "severity": "INFO"}

Check notice on line 142 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L142

[Google.Contractions] Use 'it's' instead of 'it is'.
Raw output
{"message": "[Google.Contractions] Use 'it's' instead of 'it is'.", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 142, "column": 64}}}, "severity": "INFO"}

Check notice on line 142 in src/guides/use-iapp/encrypt-iapp-result.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/encrypt-iapp-result.md#L142

[Google.Passive] In general, use active voice instead of passive voice ('is enforced').
Raw output
{"message": "[Google.Passive] In general, use active voice instead of passive voice ('is enforced').", "location": {"path": "src/guides/use-iapp/encrypt-iapp-result.md", "range": {"start": {"line": 142, "column": 67}}}, "severity": "INFO"}
the TEE using the public key from SMS.
6 changes: 6 additions & 0 deletions src/guides/use-iapp/run-iapp-without-ProtectedData.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,9 @@
workerpoolorder: workerpoolOrders.orders[0].order,
});
```

## Next Steps

Check warning on line 204 in src/guides/use-iapp/run-iapp-without-ProtectedData.md

View workflow job for this annotation

GitHub Actions / vale

[vale] src/guides/use-iapp/run-iapp-without-ProtectedData.md#L204

[Google.Headings] 'Next Steps' should use sentence-style capitalization.
Raw output
{"message": "[Google.Headings] 'Next Steps' should use sentence-style capitalization.", "location": {"path": "src/guides/use-iapp/run-iapp-without-ProtectedData.md", "range": {"start": {"line": 204, "column": 4}}}, "severity": "WARNING"}

For advanced use cases where you need to encrypt the results of your iApp
execution, refer to the
[Encrypt iApp Results](/guides/use-iapp/encrypt-iapp-result) guide.