diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 9cadf5bd..c991ca77 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -88,7 +88,7 @@ export default defineConfig({ { text: 'Protect Data', link: '/manage-data/what-is-protected-data' }, { text: 'Build iApp', link: '/build-iapp/what-is-iapp' }, { text: 'Use iApp', link: '/use-iapp/introduction' }, - { text: 'Core Concept', link: '/core-concept/glossary' }, + { text: 'Protocol', link: '/protocol/sdk' }, ], outline: { level: [2, 4], diff --git a/.vitepress/sidebar.ts b/.vitepress/sidebar.ts index c7090523..91037513 100644 --- a/.vitepress/sidebar.ts +++ b/.vitepress/sidebar.ts @@ -411,7 +411,6 @@ export function getSidebar() { { text: '🚀 Getting Started', link: '/use-iapp/getting-started' }, { text: '📖 Guides', - link: '/use-iapp/guides', items: [ { text: 'Different ways to execute an iApp', @@ -423,11 +422,11 @@ export function getSidebar() { }, { text: 'Use iApp with Protected Data', - link: '/use-iapp/use-iapp-with-protected-data', + link: '/use-iapp/guides/use-iapp-with-protected-data', }, { text: 'Find iApps to Use', - link: '/use-iapp/find-iapps', + link: '/use-iapp/guides/find-iapps', }, { text: 'How to pay the executions', @@ -437,23 +436,22 @@ export function getSidebar() { }, { text: '💰 How to Pay', - link: '/use-iapp/payment', items: [ { text: 'How to Pay for Web3mail', - link: '/overview/how-to-pay-for-web3mail', + link: '/use-iapp/how-to-pay/how-to-pay-for-web3mail', }, { text: 'How to Pay for Web3telegram', - link: '/use-iapp/web3telegram/how-to-pay-for-web3telegram', + link: '/use-iapp/how-to-pay/how-to-pay-for-web3telegram', }, { text: 'Pricing Considerations', - link: '/overview/pricing-considerations', + link: '/use-iapp/how-to-pay/pricing-considerations', }, { - text: 'Voucher Authorization Guide', - link: '/use-iapp/voucher-guide', + text: 'Voucher', + link: '/use-iapp/how-to-pay/voucher', }, ], }, @@ -563,21 +561,21 @@ export function getSidebar() { ], }, ], - '/core-concept/': [ + '/protocol/': [ { - text: 'CORE CONCEPTS', + text: 'PROTOCOL', items: [ { text: '🔧  iExec SDK', - link: '/core-concept/sdk', + link: '/protocol/sdk', }, { text: '⚙️  Workers & Workerpools', - link: '/core-concept/workers', + link: '/protocol/workers', }, { text: '📖  Glossary', - link: '/core-concept/glossary', + link: '/protocol/glossary', }, ], }, diff --git a/README.md b/README.md index 3b257617..046fad3f 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ Fork this repository and ensure you're working on the `main` branch: ## TODO +- Add an audit section - Add Arbitrum support - On arbitrum hide : Oracle Factory ? , DataProtector Sharing ?? - Adapt hardcoded address to feat with new contracts deployed on arbitrum @@ -159,4 +160,4 @@ Fork this repository and ensure you're working on the `main` branch: - complete `use-iapp` section - complete `explorer` section - complete `build-iapp` section -- complete `deep-dive`section +- complete `Protocol`section diff --git a/src/index.md b/src/index.md index 893add4e..5005078c 100644 --- a/src/index.md +++ b/src/index.md @@ -43,11 +43,11 @@ features: details: Create revenue streams from your data while maintaining full control and privacy - link: /manage-data/guides/monetize-protected-data + link: /use-iapp/how-to-pay/how-to-pay-for-web3mail - icon: 🧠 - title: Core Concepts + title: Protocols details: Deep dive into the core concepts of the protocol and understand how iExec enables privacy, governance, and monetization - link: /core-concept/sdk + link: /protocol/sdk --- diff --git a/src/overview/helloWorld/1-overview.md b/src/overview/helloWorld/1-overview.md index 1091a125..5200c628 100644 --- a/src/overview/helloWorld/1-overview.md +++ b/src/overview/helloWorld/1-overview.md @@ -84,7 +84,7 @@ Computing technologies. iExec combines three fundamental elements that work together seamlessly: -#### 1. Protect data with our devtool [DataProtector](../../tools/dataProtector/getting-started) +#### 1. Protect data with our devtool [DataProtector](../../manage-data/dataProtector/getting-started) - Encrypt your sensitive data and store it securely on Arweave or IPFS - Only you control who can access it and when diff --git a/src/overview/helloWorld/2-protectData.md b/src/overview/helloWorld/2-protectData.md index 684dc97f..587d8f5c 100644 --- a/src/overview/helloWorld/2-protectData.md +++ b/src/overview/helloWorld/2-protectData.md @@ -118,10 +118,26 @@ simple through our developer tools.

1. Install the Developer Tool

Run the install command:

-```sh +::: code-group + +```sh [npm] npm install @iexec/dataprotector ``` +```sh [yarn] +yarn add @iexec/dataprotector +``` + +```sh [pnpm] +pnpm add @iexec/dataprotector +``` + +```sh [bun] +bun add @iexec/dataprotector +``` + +::: +

2. Import and Initialize it in your project

diff --git a/src/overview/helloWorld/3-buildIApp.md b/src/overview/helloWorld/3-buildIApp.md index 5621e218..b2268ec1 100644 --- a/src/overview/helloWorld/3-buildIApp.md +++ b/src/overview/helloWorld/3-buildIApp.md @@ -8,7 +8,7 @@ import InfoIcon from '../../components/InfoIcon.vue'

Time to build!

-

Let's build an iApp that can process protected data in a secure environment using the iExec iApp generator tool. This tool helps you create, test and deploy iApps with just a few commands.

+

Let's build an iApp that can process protected data in a secure environment using the iExec iApp generator tool. This tool helps you create, test and deploy iApps with just a few commands.

If you wanna explore and deep dive in the CLI. You can check the @@ -56,33 +56,49 @@ Here are some popular use cases: Send privacy-preserving emails to registered Ethereum account holders without knowing or storing their email addresses. [Github](https://github.com/iExecBlockchainComputing/web3mail-sdk/tree/main/dapp) -| [Documentation](../../tools/web3mail.md) +| [Documentation](../../use-iapp/web3mail) ### 💬 Web3 Telegram Send privacy-preserving Telegram messages without knowing or storing their Telegram handles. [Github](https://github.com/iExecBlockchainComputing/web3telegram-sdk/tree/main/dapp) -| [Documentation](../../tools/web3telegram.md) +| [Documentation](../../use-iapp/web3telegram) ### 🌐 Content Delivery Transfer, sell or rent protected content to authorized users. [Github](https://github.com/iExecBlockchainComputing/dataprotector-sdk/tree/main/packages/protected-data-delivery-dapp) -| [Documentation](../../tools/dataProtector/dataProtectorSharing) +| [Documentation](../../manage-data/dataProtector/dataProtectorSharing)
-

These are just a few examples, the possibilities are endless. Want to explore iApp Generator? Check out our documentation and see what you can build!

+

These are just a few examples, the possibilities are endless. Want to explore iApp Generator? Check out our documentation and see what you can build!

## 💾 Installation (win / mac / linux) First, you need to install the `iapp` package. Open your terminal and run: -```sh +::: code-group + +```sh [npm] npm i -g @iexec/iapp ``` +```sh [yarn] +yarn global add @iexec/iapp +``` + +```sh [pnpm] +pnpm add -g @iexec/iapp +``` + +```sh [bun] +bun add -g @iexec/iapp +``` + +::: + You can check if the installation was successful by running: ```sh diff --git a/src/overview/helloWorld/4-manageDataAccess.md b/src/overview/helloWorld/4-manageDataAccess.md index 3eb0ed72..82b1dc03 100644 --- a/src/overview/helloWorld/4-manageDataAccess.md +++ b/src/overview/helloWorld/4-manageDataAccess.md @@ -108,7 +108,7 @@ Want to see it in action? Check out our - Track your earnings For more technical details, see the -[DataProtector Sharing](../../tools/dataProtector/dataProtectorSharing.html) +[DataProtector Sharing](../../manage-data/dataProtector/dataProtectorSharing) documentation.
diff --git a/src/overview/how-to-pay-for-web3mail.md b/src/overview/how-to-pay-for-web3mail.md deleted file mode 100644 index a1e7166c..00000000 --- a/src/overview/how-to-pay-for-web3mail.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: How to Pay for Web3mail -description: How to pay for Web3mail services ---- - -# How to Pay for Web3mail - -This page is under development. - - diff --git a/src/overview/use-case-demo.md b/src/overview/use-case-demo.md deleted file mode 100644 index 93a9f499..00000000 --- a/src/overview/use-case-demo.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -description: - Discover real-world demos of iExec's privacy-first tools like DataProtector, - Web3Telegram and Web3Mail. Learn how to empower users to monetize their data, - protect personal info, and integrate confidential computing into your apps - with seamless TypeScript and Web3 support. ---- - -# 📽 Use case demo - -Here you'll find several use cases built using iExec's **tools**. These examples -demonstrate ways to use iExec's features across multiple industries and -applications to ensure data **privacy** and **ownership** while sharing and -**monetizing computing resources**. - -These examples combine our tools in different ways. For example, the -[Web3Messaging](./use-case-demo/web3messaging.md) use case leverages the -Web3Mail and Web3Telegram tools to deliver targeted messages directly to a -user's email or Telegram inbox. To preserve user privacy, it integrates the -DataProtector module, which securely obfuscates sensitive identifiers such as -the user's email address and Telegram chat ID. - -### Integration opportunities - -The [content creator](./use-case-demo/content-creator.md) use case, powered by -our DataProtector SDK, gives a clean example of how our tools can integrate with -your application. This use case showcases how a user can create and monetize -content and use smart contracts to earn compensation when their content is -accessed. This tool is a great candidate for applications such as a website to -share instructional videos. You can recruit a group of creators who are -automatically compensated when certain conditions are met, such as view length -and audience engagement. Using our DataProtector SDK within your web application -shields users from the complexity of blockchain while still delivering to them -the benefits of distributed ledger and smart contract technologies. diff --git a/src/core-concept/glossary.md b/src/protocol/glossary.md similarity index 100% rename from src/core-concept/glossary.md rename to src/protocol/glossary.md diff --git a/src/core-concept/sdk.md b/src/protocol/sdk.md similarity index 100% rename from src/core-concept/sdk.md rename to src/protocol/sdk.md diff --git a/src/core-concept/workers.md b/src/protocol/workers.md similarity index 100% rename from src/core-concept/workers.md rename to src/protocol/workers.md diff --git a/src/use-iapp/guides.md b/src/use-iapp/guides.md deleted file mode 100644 index e69de29b..00000000 diff --git a/src/use-iapp/find-iapps.md b/src/use-iapp/guides/find-iapps.md similarity index 100% rename from src/use-iapp/find-iapps.md rename to src/use-iapp/guides/find-iapps.md diff --git a/src/use-iapp/use-iapp-with-protected-data.md b/src/use-iapp/guides/use-iapp-with-protected-data.md similarity index 100% rename from src/use-iapp/use-iapp-with-protected-data.md rename to src/use-iapp/guides/use-iapp-with-protected-data.md diff --git a/src/use-iapp/how-to-pay/how-to-pay-for-web3mail.md b/src/use-iapp/how-to-pay/how-to-pay-for-web3mail.md new file mode 100644 index 00000000..ba76cca3 --- /dev/null +++ b/src/use-iapp/how-to-pay/how-to-pay-for-web3mail.md @@ -0,0 +1,153 @@ +# How to pay for Web3mail + +[Web3Mail](../web3mail) dev tool offers secure, blockchain-based communication +by encrypting emails and protecting user privacy. + +The `sendEmail` function uses confidential computing power to encrypt and send +messages, ensuring secure and decentralized email exchanges. + +This guide explains how to pay for Web3Mail's computing power using **vouchers** +and **xRLC**, detailing the steps for each method. + +## Using Vouchers for Web3Mail + +### Step 1: Obtain a Voucher + +- **Acquire Vouchers**: Obtain vouchers through the + [iExec Builder Dashboard](https://builder.iex.ec/). Note that the number of + Web3Mail executions and the expiration time of each voucher is restricted + based on its validity period. Refer to + [pricing documentation](https://www.iex.ec/voucher) for more information. +- **Support**: For specific limitations related to your voucher, please contact + iExec Support. + +### Step 2: Use the Builder Dashboard + + + Builder dashboard screenshot + + +The iExec Builder Dashboard is a comprehensive tool for managing vouchers and +resources, providing an intuitive interface for: + +- **Claiming Vouchers**: Builders can claim vouchers during the BUILD and EARN + stages. +- **Top-Up Vouchers**: Future updates will allow direct top-ups via the + dashboard. Currently, builders are redirected to Discord. +- **Checking Voucher Balance**: Track your voucher balance and usage history. + +🧙🏼 [Go here](https://builder.iex.ec/) + +### Step 3: Grant Allowance (If Necessary) + +Use `iexec.account.approve(voucherAddress)` to authorize the voucher smart +contract to debit your account if the voucher balance is insufficient. This +ensures that if the voucher alone doesn't cover the execution cost, the +remaining balance is automatically deducted from your account. + +For additional information on using xRLC for fallback payment in Web3Mail, refer +to the **Using xRLC with Web3Mail** section. + +### Step 4: Execute Web3Mail's sendEmail Function + +When using a voucher for payment, set the `useVoucher` parameter to `true`: + +```ts twoslash +import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail'; + +const web3Provider = getWeb3Provider('PRIVATE_KEY'); +const web3mail = new IExecWeb3mail(web3Provider); +// ---cut--- +const sendEmail = await web3mail.sendEmail({ + protectedData: '0x123abc...', + emailSubject: 'My email subject', + emailContent: 'My email content', + useVoucher: true, // [!code focus] +}); +``` + +## Using xRlC for Web3Mail + +If you choose to use xRLC to cover the computational cost of Web3Mail (or if you +need to cover data access costs such as retrieving the recipient's email +address), follow these steps: + +### Install the iExec SDK + +To manage RLC tokens, developers must use the iExec SDK, which offers all the +necessary tools for interacting with the iExec platform. This includes +depositing, withdrawing, and checking balances of RLC and xRLC + +- In your JS/TS project npm install iexec +- Instantiate the iExec SDK (see the + [doc](https://github.com/iExecBlockchainComputing/iexec-sdk/blob/master/docs/README.md#quick-start)) + +```javascript +import { IExec } from 'iexec'; +// connect injected provider +const iexec = new IExec({ ethProvider: window.ethereum }); +``` + +### Purchase RLC + +Obtain RLC tokens from a supported cryptocurrency exchange. + +### Convert to xRLC + +Use the iExec Bridge to convert your RLC into xRLC for use on iExec's sidechain. +The bridging operation follows the lock & mint / burn & unlock principle. When +sending tokens from Mainnet to Bellecour, the bridge locks the initial amount on +the source chain and mints the equivalent on the destination chain. When going +in the other direction, it burns tokens on the Sidechain and unlocks the same +amount on Mainnet. The bridged asset is called xRLC on Bellecour. + +Users can send tokens from the Ethereum Mainnet to the iExec Sidechain or +vice-versa using the Account Manager +([iExec Explorer](https://explorer.iex.ec/bellecour) or +[POA Bridge UI](https://bridge-bellecour.iex.ec/)) available across all iExec +products. + +### Deposit xRLC + +Deposit the xRLC into your iExec account using the command: + +```javascript +iexec.account.deposit(xRLC_amount); +``` + +This converts xRLC into sRLC, used as proof of funds for task execution. + +### Check sRLC Balance + +Use the command below to check your balance: + +```javascript +iexec.account.show(); +``` + +### Execute sendEmail + +Set the `useVoucher` parameter to `false` when using Web3Mail's sendEmail +function to pay with xRLC: + +```ts twoslash +import { IExecWeb3mail, getWeb3Provider } from '@iexec/web3mail'; + +const web3Provider = getWeb3Provider('PRIVATE_KEY'); +const web3mail = new IExecWeb3mail(web3Provider); +// ---cut--- +const sendEmail = await web3mail.sendEmail({ + protectedData: '0x123abc...', + emailSubject: 'My email subject', + emailContent: 'My email content', + useVoucher: false, // [!code focus] +}); +``` + +### Withdraw sRLC (If Desired) + +Convert sRLC back to xRLC and withdraw to your wallet using: + +```javascript +iexec.account.withdraw(RLC_amount); +``` diff --git a/src/use-iapp/web3telegram/how-to-pay-for-web3telegram.md b/src/use-iapp/how-to-pay/how-to-pay-for-web3telegram.md similarity index 98% rename from src/use-iapp/web3telegram/how-to-pay-for-web3telegram.md rename to src/use-iapp/how-to-pay/how-to-pay-for-web3telegram.md index 94799f58..7465894e 100644 --- a/src/use-iapp/web3telegram/how-to-pay-for-web3telegram.md +++ b/src/use-iapp/how-to-pay/how-to-pay-for-web3telegram.md @@ -7,7 +7,7 @@ description: # How to pay for Web3telegram -[Web3Telegram](../tools/web3telegram) dev tool offers secure, blockchain-based +[Web3Telegram](../web3telegram) dev tool offers secure, blockchain-based communication by encrypting emails and protecting user privacy. The `sendTelegram` function uses confidential computing power to encrypt and diff --git a/src/overview/pricing-considerations.md b/src/use-iapp/how-to-pay/pricing-considerations.md similarity index 100% rename from src/overview/pricing-considerations.md rename to src/use-iapp/how-to-pay/pricing-considerations.md diff --git a/src/use-iapp/how-to-pay/voucher.md b/src/use-iapp/how-to-pay/voucher.md new file mode 100644 index 00000000..cf1c7822 --- /dev/null +++ b/src/use-iapp/how-to-pay/voucher.md @@ -0,0 +1,10 @@ +--- +title: Voucher Guide +description: Voucher Guide +--- + +# Voucher Guide + +This page is under development. + + diff --git a/src/use-iapp/payment.md b/src/use-iapp/payment.md deleted file mode 100644 index d054865c..00000000 --- a/src/use-iapp/payment.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: How to Pay -description: How to pay for iApps ---- - -# 💰 How to Pay - -This page is under development. - - diff --git a/src/use-iapp/voucher-guide.md b/src/use-iapp/voucher-guide.md deleted file mode 100644 index c3a5d280..00000000 --- a/src/use-iapp/voucher-guide.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Voucher Authorization Guide -description: Voucher Authorization Guide ---- - -# Voucher Authorization Guide - -This page is under development. - -