Skip to content

reclaimprotocol/gear-sdk-onchain-integration

Reclaim Protocol - Gear Integration

A smart contract implementation of the Reclaim Protocol for the Gear blockchain. This contract enables on-chain verification of zero-knowledge proofs generated by the Reclaim Protocol.

Overview

Reclaim Protocol allows users to prove claims about their data from any website without revealing the underlying data. This Gear smart contract verifies these proofs on-chain, enabling trustless verification of web2 data in web3 applications.

Features

  • Epoch-based witness management
  • ECDSA signature verification using secp256k1
  • Keccak256 hashing for claim verification
  • On-chain proof validation

Deployments

Chain Address Explorer
Vara Testnet 0x383951634434f94d4bf23ab1d7825bff90fe6a00ec2c3f389e7b8d771b053af8 View

Project Structure

├── src/
│   ├── lib.rs          # Main contract logic
│   ├── claims.rs       # Claim verification and signature recovery
│   ├── state.rs        # State definitions (Epoch, etc.)
│   └── error.rs        # Custom error types
├── io/
│   └── src/lib.rs      # Contract metadata and type definitions
├── tests/
│   └── tests.rs        # Integration tests
└── js/                 # JavaScript client

Prerequisites

  • Rust 1.81+ (stable)
  • wasm32-unknown-unknown target: rustup target add wasm32-unknown-unknown

Building

cargo b --workspace

The compiled WASM binary will be available at:

target/wasm32-unknown-unknown/debug/reclaim_gear.opt.wasm

Testing

Run unit and integration tests (excluding on-chain tests):

cargo t --workspace -- --skip gclient

Run all tests including on-chain tests with a local node:

# Download the Gear node binary
cargo xtask node

# Run all tests
cargo t --workspace

Contract API

Actions

The contract accepts the following actions via ReAction enum:

Action Description
Init {} Initialize the contract (sets caller as owner)
AddEpoch { witness, minimum_witness } Add a new epoch with witnesses (owner only)
VerifyProof(Proof) Verify a Reclaim proof on-chain

Types

// Witness configuration for an epoch
struct Witness {
    address: String,  // Witness address (hex)
    host: String,     // Witness host identifier
}

// Proof structure for verification
struct Proof {
    claimInfo: ClaimInfo,
    signedClaim: SignedClaim,
}

JavaScript Client

cd js
npm install
cp .env.example .env  # Configure your environment
npm run start

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •