✨Works out of the box guarantee. If you face any issue at all, hit us up on Telegram and we will write the integration for you.
logoReclaim Protocol Docs

Attestor Contracts

An overview of attestor contracts

Reclaim Protocol: Decentralized Architecture and Incentives

The Reclaim protocol's decentralized architecture relies on smart contracts and a network of Attestor nodes to ensure secure and trustless data verification. Contracts are already deployed to Moca chain.

Core Smart Contracts

  • Task Contract:
    • Responsible for creating Claim Tasks and achieving Claim consensus.
  • Governance Contract:
    • Manages Attestor nodes, providing staking, rewards, and penalty mechanisms.
    • Optionally, collects staked $MOCA tokens from Attestors and distributes earnings based on staking ratios and service quality.

Attestor Registration & Staking

  • Attestors must stake a minimum number of $MOCA tokens in the Governance Contract.
  • Rewards are distributed based on the staking ratio.
  • Attestors must maintain online availability.

Decentralized Proof of Possession (PoP)

  1. Claim Task Request:

    • The user submits a "create claim task" request to the Task Contract via the Reclaim SDK.
  2. Attestor Selection:

    • The Task Contract randomly selects Attestors and returns them to the SDK.
  3. zkTLS Protocol Execution:

    • The Reclaim SDK establishes connections with the selected Attestors to execute the zkTLS protocol.
  4. Proof Submission:

    • Each Attestor returns a Proof to the SDK, Proofs then are submitted to the Task Contract.
  5. Proof Consensus:

    • The Task Contract achieves Proof consensus based on the 51% rule.
  6. Proof Verification and Storage:

    • The Task Contract verifies the Proof and stores the result upon successful validation.

Unstaking

  • Upon an unstaking request, the system initiates an undelegation process with a chain-defined unbonding period (e.g., 21 days).
  • After the unbonding period, the remaining $MOCA tokens are calculated and returned to the Attestor’s account, accounting for potential slashing risks.

Try It

Contracts can be found on Github.

Admin setup

If you wish to try things beforehand, try the following upon cloning and installing packages.

  1. Populate your .env:

    • PRIVATE_KEY=0x..
  2. Run the deploy script:

    • npx hardhat deploy --network $YOUR_NETWORK
  3. Create a task request:

    • npx hardhat create-task-request --network $YOUR_NETWORK

Attestor Example

The example showcases the complete proof lifecycle.

  1. Change directory into /examples/attestor and install packages:

    • npm install
  2. Populate your .env, varibales are filled for you, you just need to add you private key (without the 0x prefix):

    • PRIVATE_KEY=
  3. Download zk files:

    • node node_modules/@reclaimprotocol/zk-symmetric-crypto/lib/scripts/download-files
  4. Run the script:

    • node index.js

zkFetch Example - Outdated

Alternatively, you can try out an e2e example. This example echoes a previous deployment, but we kept it still for demonstration purposes.

  1. Change directory into /examples/zkfetch and install packages:

    • npm install
  2. Populate your .env, add you private key (without the 0x prefix):

    • PRIVATE_KEY=
  3. Run the script:

    • node index.js

Register Attestor

If you wish the join the quorum with your attestor, do contact us.

On this page