PADO AO Process is processes on AO. It mainly manage nodes, data and verifiable confidential computation tasks and results. It also handles computation cost. It includes Node Registry Process
, Data Registry Process
and Task Management Process
.
Node Registry Process manages the public keys of PADO Node. It provides the functionality of add, update, delete and query. These operations are allowed only when the caller is in the white list. A node has the following attributes:
- name: the name of the node
- index: the index of the node, starting from 1, allocated when registered
- publicKey: the public key of the node
- desc: description of the node
- from: the process which register the node
aos> Send({Target = <Node Manager ID>, Action = "AddWhiteList", Address = <Address>})
aos> Send({Target = <Node Manager ID>, Action = "GetWhiteList"})
aos> Send({Target = <Node Manager ID>, Action = "RemoveWhiteList", Address = <Address>})
aos> Send({Target = <Node Manager ID>, Action = "Register", Name = <Name>, Data = <Public Key>, Desc = <Desc>})
aos> Send({Target = <Node Manager ID>, Action = "Update", Name = <Name>, Data = <Public Key>, Desc = <Desc>})
aos> Send({Target = <Node Manager ID>, Action = "Delete", Name = <Name>})
aos> Send({Target = <Node Manager ID>, Action = "Nodes"})
aos> Send({Target = <Node Manager ID>, Action = "GetNodeByName", Name = <Name>})
Data Registry Process manages data uploaded by data provider.
The data has the following attributes:
- id: the identify of the data
- dataTag: the tag of the data
- price: the price of the data
- data: the content of the data
- from: the process which upload the data
aos> Send({Target = <Data Manager ID>, Action = "Register", DataTag = <Data Tag>, Price = <Price>, Data = <EncSks>, Nonce = <Nonce>, EncMsg = <EncMsg>})
aos> Send({Target = <Data Manager ID>, Action = "AllData"})
aos> Send({Target = <Data Manager ID>, Action = "GetDataById", DataId = <Data ID>})
aos> Send({Target = <Data Manager ID>, Action = "Delete", DataId = <Data ID>})
A task means the process that data user submits a request for purchase data, compute nodes operate on the data and provide their computation results, finally data user decrypt the data basing on the computation results.
The task has the following attributes:
- id: the identity of the task
- type: the task type of the task
- inputData: the params of the task
- computeLimit: the compute limit of the task
- memoryLimit: the memory limit of the task
- computeNodes: the nodes which participant in computing
aos> Send({Target = <Task Manager ID>, Action = "ComputationPrice"})
aos> Send({Target = <Task Manager ID>, Action = "Submit", TaskType = <TaskType>, Data = <InputData>, ComputeLimit = <ComputeLimit>, MemoryLimit = <MemoryLimit>, ComputeNodes = <ComputeNodes>})
aos> Send({Target = <Task Manger ID>, Action = "ReportResult", TaskId = <TaskID>, NodeName = <NodeName>})
aos> Send({Target = <Task Manager ID>, Action = "GetPendingTasks"})
aos> Send({Target = <Task Manager ID>, Action = "GetCompletedTasks"})
aos> Send({Target = <Task Manager ID>, Action = "GetCompletedById", TaskId = <TaskId>})
aos> Send({Target = <Task Manager ID>, Action = "GetAllTasks"})
aos> Send({Target = <TaskManager ID>, Action = "Allowances"})
aos> Send({Target = <Task Manager ID>, Action = "Withdraw", Recipient = <Recipient>, Quantity = <Quantity>})
For now, PADO AO uses AOCRED to incentive data providers and PADO Nodes. The quantity of AOCRED tokens received from data user is decided by data price when uploading data. Every PADO Node participanting in the task will get a constant quantity of AOCRED tokens(0.001 AOCRED for now) from data users. Data user should transfer AOCRED tokens to the Task Management Process
before submiting tasks. In Task Management Process
, It maintains FreeAllowances
and LockedAllowances
to track the tokens of data users. It mainly consist of the following steps.
- Preparation: Data users transfer AOCRED tokens to this process, which are kept in FreeAllowances.
- Submit Tasks: If a task is submitted successfully, AOCRED tokens will be moved from FreeAllowances to LockedAllowances.
- Report Results: If PADO Nodes finish computing tasks submitted, they will report result. AOCRED tokens will be transfered from this process to PADO Nodes and data providers. LockedAllowances will be decreased.
- Withdraw: If some tokens is left in FreeAllowances, data users can withdraw.