Running Verification Client
Last updated
Last updated
The verification client in the 2PM Network plays a crucial role in maintaining the integrity and reliability of the network through a rigorous verification process. This process focuses on validating proofs or commitments provided by nodes participating in various tasks.
In the 2PM.Network, each 2PM node participating in a task must submit specific proofs or commitments that are subject to validation to ensure that all computations or data contributions are correct and meet the predefined standards of the task.
Try it here (Coming Soon)
Proofs: These are cryptographic assurances that a node's computations were performed correctly. Proofs are typically zero-knowledge proofs (ZKPs), which allow a node to prove that it has performed specific computations correctly without revealing the underlying data or computation details.
Commitments: Commitments refer to the values related to the data or computational results that are sealed in a way that they can only be revealed or validated using the correct cryptographic keys or conditions.
The verification client operates through the following steps:
Submission of Proofs and Public Signals:
Nodes submit their proofs and public signals to the subnet contracts. This includes the task ID, the verifier contract address, zero-knowledge proof, public signals, and other necessary details such as the index of the node in the committee (often hardcoded as 0) and the number of samples used by the node.
Verification:
The verification client calls verifier contract, which processes the proofs and public signals. It assesses whether the proofs meet the standards set out for the task, confirming the accuracy and integrity of the work performed by the nodes.
Recording Verification Results:
Based on the data submitted, the verification client records the results of each node's verification. The system checks whether all nodes have completed their verification without any invalid results.
Confirmation of Verification:
Once all nodes have successfully passed the verification process and there are no invalid verifications, the system updates its status to confirmed, preventing any further verifications from taking place for that specific task.
The following are the primary methods used in the verification client (For Federated Learning):
hlrInstance.verify(taskId, verifierInstance.address, proof, pubSignal, 0, samples[i], { from: node })
: Used by a node to submit information required for verification.
hlrInstance.getVerifierState.call(taskId)
: Retrieves the verification status for a task, including lists of unfinished and invalid clients, validity status, and confirmation status.
hlrInstance.confirmVerification(taskId, { from: node })
: Used by the task creator to confirm the verification results and mark the task as verified.