Skip to content

🔑 Manage Data Access

Reading time 🕒 6 mins

Control Your Data

Alice will learn how to grant access to her protected data and manage who can use it.

When you protect your data, you can authorize specific users and applications to access it. This means an authorized user will be able to use an authorized iApp to compute your protected data.

🔐 The Authorization Flow

Here is a simple diagram to explain the process:

alt text

1Protect your data using DataProtector SDK
2Authorize a user (wallet address) to access your data
3Authorize the iApp to access your data
4Authorized user can now run your iApp to process your protected data

🔓 Grant the iApp Access to Your Data

Remember the iApp address you saved from the previous chapter? You'll need it now to grant access to your protected data.

Connect Your Wallet:

You will sign two messages:

  1. A message granting access to the iApp
  2. An authentication message to post your granted access on a broadcasting service (iExec marketplace)

Let's look at the code that makes this possible:

ts
const 
grantedAccess
= await
dataProtectorCore
.
grantAccess
({
protectedData
: '0x123abc...',
authorizedApp
: '0x456def...',
authorizedUser
: '0x789cba...',
});
📄 protectedData
The protected data address (local storage for the demo)
💻 authorizedApp
The iApp address you want to authorize
👤 authorizedUser
User's wallet address (0x... means all users)

As we don't have the Bob's wallet address, we'll use the zero address to grant access to all users.

🏃 Time to run

You're now ready to process your protected data in a trusted environment:

sh
iapp run <my-iapp-address> --protectedData 

🎉 Congratulations! You've successfully completed the core workflow of protecting and processing data with iExec!

What's next: Data Monetization

We've completed the first step of the journey! You can now integrate the DataProtector SDK into your dApp, secure your data, grant access to users and iApps, and process it safely.

But here's where it gets even more exciting... monetization!.

Our SDK offers flexible monetization mechanisms, allowing you to create protected data collections and implement advanced models like subscriptions, rentals, or direct sales. The choice is yours!

Want to see it in action? Check out our Content Creator Demo where you can:

  • Create and protect your own content
  • Set pricing and access rules
  • Manage subscriptions and rentals
  • Track your earnings

For more technical details, see the DataProtector Sharing documentation.

You have one more step to complete the journey, and it's the easy one. Let's go to the bonus chapter!