Data Validation
Vana uses a Proof of Contribution system to validate data submitted to the network. "Valid" means something different in each DLP, because different DLPs value data differently.
Running Proof-of-Contribution in the Satya Network
The recommended way of validating data securely in the Vana Network is by using the Satya Network, a group of highly confidential nodes that run on special hardware. At a high level, the data contributor adds unverified data, and requests a proof-of-contribution job from the Satya Validators (and pay a small fee to have their data validated). Once validated, the Satya validator will write the proof on chain.
Proof-of-Contribution Template
To run PoC in the Satya Network, a DLP builder must implement a simple proof-of-contribution function using this template.
PoC Template: https://github.com/vana-com/vana-satya-proof-template
The diagram below explains how this PoC template works.
The data contributor adds their encrypted data onchain, via the Data Registry.
They request a validation job, paying a small fee. Once a Satya node is available to run the job, they connect directly to the node, and send them the encryption key and the proof-of-contribution docker image that needs to run on the data to validate it.
The Satya node receives the key, and downloads the encrypted file, and decrypts it
The Satya node places the decrypted file in a temporary, shielded* location. The node operator cannot see the contents of this location.
The Satya node downloads and initializes a docker container to run the specified proof-of-contribution, and mounts the input and output volumes. The PoC container will have access to the decrypted file.
The PoC container runs its validations on the decrypted data, and outputs the attestation. More information on data attestation can be found here: Data Attestation.
The Satya node reads the output, and generates the proof.
The Satya node writes the proof onchain, and claims the fee as a reward for completing that work.
* A Gramine shielded container is a specialized type of container that leverages the Gramine library OS to run applications in a secure, isolated environment, typically utilizing hardware-based trusted execution environments (TEEs) like Intel SGX.
Satya Network Integration
Once a data contributor has uploaded their encrypted file to the Data Registry, it's time to run a proof of contribution job to validate it. The steps below show how to use the Satya Network to validate it.
Each validation job requires a small fee (which changes based on load). The data contributor can get the current fee by calling
teeFee()
on the TEE Pool Contract.The current job fee is returned: ex:
job_fee = 3 VANA
.The DLP UI now attaches a listener to listen for
JobSubmitted
events from the TEE Pool contract, which emits when the job is successfully submitted.The DLP UI submits the job request to the TEE Pool to get the data contributor's file validated:
requestContributionProof(file_id, { value: job_fee })
.The TEE Pool assigns a Satya node to handle the job, and the
JobSubmitted
event is fired.The DLP UI receives the
JobSubmitted
event, and gets the correspondingjob_id
.The DLP UI gets the details of the Satya node assigned to the job by calling the TEE Pool's
jobTee(job_id)
.The TEE Pool returns the address of a Satya node, so the UI can connect to it directly: ex:
https://satya-1.com
.The DLP UI sends a
/RunProof
request to the Satya node to begin the validation. It includes the encryption key used by the Satya node to decrypt the file, along with the URL of the proof-of-contribution docker image that will be run to generate the attestation. More information about the request below.The Satya node downloads the encrypted data, decrypts it, and spins up the proof-of-contribution container, which validates the data and generates a result. It then builds the attestation according to the Data Attestation schema, and the proof is uploaded to IPFS.
The Satya node sends the proof to the TEE Pool.
The TEE Pool contract verifies the proof.
The TEE Pool adds the proof to the data registry.
The Satya node claims the
job_fee
for completing the job.The TEE Pool releases the
job_fee
.
The Satya Network is a work in progress. It is subject to change, and may be unstable at this time. Do not send sensitive information to the Satya nodes while in testnet.
Running Proofs on a Satya Node
POST
/RunProof
Once a Satya node has been selected to run the proof-of-contribution for a data point, the data contributor can talk to that node directly.
Headers
Name | Value |
---|---|
Content-Type |
|
Body
Name | Type | Description |
---|---|---|
| number | File ID from the Data Registry |
| number | Job ID sent by the JobSubmitted event |
| string | The symmetric key used to decrypt the file (a wallet signature like |
| string | The message that was signed to generate the |
| string | The proof-of-contribution docker image URL, ex: |
| object | Any environment variables that get passed into the proof-of-contribution container as key/value pairs |
| object | Any sensitive environment variables that are get passed into the proof-of-contribution container as key/value pairs, encrypted using the process below. Only decryptable by a registered Satya node. |
| number | A random number that will be signed and returned in the response, useful for checking the Satya node's wallet address. |
Sample Request
Response
Sending Secrets to PoC Container
When your Proof-of-contribution container runs, you may need to access secrets such as API keys, passwords, etc. The Satya nodes accept an env_vars
object to send environment variables in plain text, however, this is not suitable for secret values.
To send secrets, encrypt them with the public key below, and send them as a part of the secrets
object in the /RunProof
request. They will be decrypted and injected into the Proof-of-contribution container as environment variables along with the env_vars
. These secrets can only be decrypted by a TEE that's currently registered in the TEE Pool.
Last updated