Granting Data Access
A guide for DataDAO owners on how to securely manage and approve on-chain permissions for data consumers.
As a DataDAO owner, one of your key responsibilities is managing access to your dataset. This guide walks you through the on-chain process for approving a request from a developer or researcher.
Before You Begin
This guide assumes you have already published a dataset and have a
refinerId
for it. You should have also received a request from a data consumer that includes their wallet address and thecomputeInstructionId
they wish to use.
The Two-Part Approval Model
To maintain security and control, Vana uses a two-part permission system. You are not just granting access to data; you are approving a specific compute script to run on that data. You will grant two separate on-chain permissions:
- Data Permission: Approves a user to query specific tables or columns of your dataset.
- Compute Permission: Approves a specific compute script to be used with your dataset.
Step 1: Grant Data Permission
First, grant the user permission to query your data by calling the addPermission
function on the QueryEngine
contract.
- Contract:
QueryEngine
(0xd25...) - Function:
function addPermission( address grantee, uint256 refinerId, string calldata tableName, string calldata columnName, uint256 price )
- Parameters:
grantee
: The wallet address of the data consumer.refinerId
: Your published dataset's ID.tableName
/columnName
: Leave these blank to grant access to the entire dataset, or specify them for more granular control.price
: The amount in $VANA you wish to charge per query.
Step 2: Approve the Compute Instruction
Next, approve the specific compute job the user wants to run. You only need to approve each computeInstructionId
once; afterward, any user with data permission can use it.
- Contract:
ComputeInstructionRegistry
(0x578...) - Function:
function updateComputeInstruction( uint256 instructionId, uint256 dlpId, bool approved )
- Parameters:
instructionId
: The ID provided by the data consumer.dlpId
: Your DataDAO's ID.approved
: Set totrue
.
Note on the Default Instruction
Even if the consumer is using a default compute instruction (e.g.,
id = 3
on Mainnet), you must still approve it for your DataDAO once.
Understanding Access Fees
Once both permissions are on-chain, the data consumer can run their job. For every query they execute, the access fee you set is paid in $VANA.
Per the current data access model, 80% of this fee is sent directly to your DataDAO's treasury, creating a direct revenue stream from your data's utility.
Updated 1 day ago