Introduction
Introduction
Developers can use Primus Network SDK to create confidential dApps and send confidential computation tasks on Ethereum or AO.
Data-Sharing Computation
Primus builds the computation network from simple use cases to a comprehensive suite. Currently, the peer-to-peer data-sharing is supported, which provides a secure and practical way to transfer accessability of the private data from the data owner to a third party. In particular, it completes the following peer-to-peer data-sharing process.
- Alice encrypts her private text/image/video, and stores it on a storage blockchain, e.g., Arweave.
- Bob sees the metadata information about Alice's data from a data marketplace, and completes a token transfer through the smart contract, e.g., either Ethereum smart contracts or AO processes.
- Primus network runs a confidential computation, and the result will be private data owned by Alice and encrypted by Bob's public key. Bob downloads the encrypted data and decrypts it locally to recover the plain data file.
The core technique within this data-sharing paradigm primarily involves linear homomorphic encryption. Initially, the content encryption key K for the private data is split into multiple shares, with each share encrypted using the public keys of three distinct workers. During the confidential computation phase, all key shares are decrypted and subsequently re-encrypted using Bob's public key. These re-encrypted ciphertexts are then linearly combined to produce a single ciphertext that securely encrypts K with Bob's public key. A threshold encryption scheme is employed to enhance network robustness. One can also find more technical details in the post and the repository.
Main Components
The data sharing and incentive workflow allows data providers to share their data securely and privately with data users. Key components are listed as follows:
Primus SDK
Through the SDK developers can upload a user's encrypted data, and decrypt the ciphertext data.
The github link: Primus SDK.
Primus Contract
Primus Contract, which mainly manages data, nodes, verifiable confidential computing tasks and related results. The contract also handles computation costs.
The github link of Ethereum: Primus Network Contracts.
The github link of AO: Primus AO Process.
Primus Node
Primus Node is an environment that truly performs verifiable confidential computations. Mainly to obtain verifiable confidential computing tasks, execute tasks, and report results.
The github link: Primus Node. The WASM wrapper for threshold-zk-LHE.
Workflow
Register Primus Node
After the Primus Node is started, it shall be registered in the Worker Management Contract. The registered information includes name, description, public key, owner address, etc.
Upload data
Data Providers can upload encrypted data through dapp based on the Primus SDK and set data prices at the time of upload. The data encrypted by the FHE algorithm and the Primus Node public key will be uploaded to Arweave, and the data information will be registered to the Data Management Contract.
Submit task
Data users can submit computation tasks with their public keys through dapp based on Primus SDK, and pay certain computation fees and data usage fees. The computation tasks will be submitted to the Task Management Contract.
Task execution
Primus Node obtains computing tasks from the Task Management Contract and storage blockchain, uses the LHE algorithm to compute the tasks, and reports the results to the Task Management Contract and storage blockchain after computation. Task Management Contract verifies the results. After completing the verification, the fee is distributed to the data provider and Primus Nodes.
Get Result
Data users obtain encrypted data from Arweave, obtain task results and related information from the contracts and storage blockchain, and then use the LHE algorithm with their private key in the SDK to decrypt the results.