- NodeManager
NodeManager is responsible for the registration and management of storage nodes and broadcast nodes. Users can also query the list and status of nodes through this contract. - StorageManager
The StorageManager contract is responsible for the registration and management of nodeGroups and namespaces.- nodeGroup: A group of broadcast nodes, with a specified minimum number of signatures required.
- nameSpace: A group of storage nodes.
- CommitmentManager
CommitmentManager handles commitments submitted by users, verifies signatures based on the nodeGroupKey, and deducts fees accordingly. - ChallengeContract
ChallengeContract allows challengers to create challenges by specifying the nameSpaceKey and storage node address. The contract facilitates interaction between challengers and storage nodes to reach a final challenge outcome. - Verifier
Verifier provides an implementation of the KZG algorithm using the BN254 curve.
- BroadcastNode
Broadcast nodes register by staking tokens in NodeManager.sol. They provide temporary data storage and signatures for users. They subscribe to messages from CommitmentManager.sol and broadcast data across the network based on commitment information. - StorageNode
Storage nodes register by staking tokens in NodeManager.sol. They provide long-term storage services for users. They subscribe to messages from CommitmentManager.sol and request data across the network based on commitment information for long-term storage.
They also subscribe to events in ChallengeContract.sol to respond to challenges by uploading aggregated commitments/proofs/opening values to ChallengeContract.sol to complete the challenge. - User
Users can view registered broadcast nodes and storage nodes through the NodeManager.sol contract. After selecting the desired nodes, they can register a nodeGroup for broadcast nodes and a namespace for storage nodes if long-term storage is needed.
Users send data to the broadcast nodes to obtain signatures, and after obtaining the signatures, they call the submitCommitment method in CommitmentManager.sol to submit their commitment. - Challenger
Challengers can create challenges in ChallengeContract.sol by specifying the nameSpaceKey and storage node address. They need to interact with the contract to reach a consensus on the aggregated commitment. The contract will use KZG verification to determine the challenge outcome.
A user(project) can challenge a storage node(storage provider) that stores its data. The challenge needs to specify the commitment range, such as the data within the first commitment to the 1000th commitment submitted by the user.When each time the project submits data to storage contract, the contract records the commitments
We can divide the scheme into two parts.The first part uses an interactive protocol to reach consensus between the project and storage provider on the aggregated commitment.The second part involves the process of challenge, responce, and verify among the project, storage provider, and contract.
The main purpose of this part is to reach consensus between the project and the storage provider on aggregated commitment. If consensus cannot be reached, the dishonest party needs to be identified by the contract. Before calculating the aggregated commitment, the project has already set random numbers submitOpinion
function of the project file ChallengeContract.sol
, the consensus on the aggregate commitment can be determined.
Calculate the aggregated commitment
During the period of determining whether the aggregate commitment has reached consensus, the storage provider need to calculate aggregate commitments FoldedCommits
function in the kzgSDK/sdk.go
file, the aggregate commitment can be calculated.
The prerequisite for this part is that both the project and the storage provider have reached consensus on the aggregated commitment corresponding to
Challenge
Challenge is initiated by the project, which selects an opening point
Response
The storage provider receives the challenge value
In the Responce
function in the kzgSDK/sdk.go
file, the responce can be calculated.
Verification
Finally, using the opening value
In the verify
function of the project file kzg/Verifier.sol
, the verification can be done.