On-chain verification of Reclaim Protocol proofs on the Sui blockchain.
This SDK enables developers to verify Reclaim Protocol zero-knowledge proofs directly on the Sui blockchain. It provides smart contracts for managing epochs, witnesses, and cryptographic verification of claims.
- Proof Verification - Verify Reclaim proofs on-chain with ECDSA signature recovery
- Epoch Management - Manage witness sets across different time periods
- Dapp Registration - Register decentralized applications with unique identifiers
- Ethereum Compatibility - Recover Ethereum addresses from secp256k1 signatures
Clone the repository:
git clone https://github.com/reclaimprotocol/move-sdk-onchain-integration.git
cd move-sdk-onchain-integrationsui move buildsui move testFor tests requiring higher gas limits:
sui move test -i 100000000000000000sui client publish --gas-budget 100000000use reclaim::reclaim;
// Create a new Reclaim Manager (one-time setup)
reclaim::create_reclaim_manager(
epoch_duration_s, // Duration of each epoch in seconds
ctx
);// Add a new epoch with witnesses
let witnesses = vector[
x"244897572368eadf65bfbc5aec98d8e5443a9072" // Witness ETH address
];
reclaim::add_new_epoch(
&mut manager,
witnesses,
minimum_witnesses, // Minimum signatures required
ctx
);// Create claim info
let claim_info = reclaim::create_claim_info(
provider, // Provider string (e.g., "http")
parameters, // JSON parameters
context // JSON context with extracted data
);
// Create claim data
let claim_data = reclaim::create_claim_data(
identifier, // Claim identifier (hash)
owner, // Claim owner address
epoch, // Epoch number
timestamp_s // Timestamp
);
// Create signed claim with signatures
let signed_claim = reclaim::create_signed_claim(claim_data, signatures);
// Create proof object
reclaim::create_proof(claim_info, signed_claim, ctx);
// Verify the proof
let signers = reclaim::verify_proof(&manager, &proof, ctx);reclaim::create_dapp(&mut manager, dapp_id, ctx);sources/
├── reclaim.move # Core Reclaim protocol logic
└── ecdsa.move # ECDSA utilities for signature verification
tests/
├── reclaim_tests.move # Reclaim module tests
└── ecdsa_tests.move # ECDSA module tests
| Struct | Description |
|---|---|
ReclaimManager |
Main contract state managing epochs and dapps |
Epoch |
Represents a time period with associated witnesses |
Proof |
A verified proof object containing claim info and signatures |
ClaimInfo |
Provider, parameters, and context for a claim |
SignedClaim |
Claim data with cryptographic signatures |
| Function | Description |
|---|---|
create_reclaim_manager |
Initialize the Reclaim Manager |
add_new_epoch |
Add a new epoch with witnesses (owner only) |
create_proof |
Create a proof object |
verify_proof |
Verify a proof against the current epoch |
create_dapp |
Register a new dapp |
get_provider_from_proof |
Extract provider from a proof |
fetch_epoch |
Get the current epoch |
- Proofs are verified using ECDSA signature recovery (secp256k1)
- Witnesses are selected deterministically based on claim hash
- Duplicate signature detection prevents replay attacks
- Only the owner can add new epochs
Contributions are welcome! Please open an issue or submit a pull request.
MIT License - see LICENSE for details.