Quickstart
Learn how to publish and verify proofs on-chain using the Reclaim contract on Aleph Zero
Overview
This guide walks you through deploying a Reclaim contract on Aleph Zero and building a frontend interface to interact with it. You'll learn how to generate and verify proofs using the Reclaim protocol.
Prerequisites
Before starting, ensure you have:
- Completed the setup steps from the ReactJs guide
- Installed the Polkadot.js extension wallet
- Funded your wallet with test tokens
- Basic familiarity with React and smart contracts
Reference implementations are available on GitLab:
Contract Deployment
Note: If you don't need custom contract logic, you can skip this section and use our pre-deployed testnet contract.
Deploy the Reclaim Contract
Clone and build the contract:
This contract:
- Acts as a client for the Reclaim protocol
- Manages proof instantiation and verification
- Supports custom validation logic (optional)
Deploy to Network
- Visit the Contract UI
- Connect your wallet
- Upload the generated
.contract
file - Deploy using your account
Initialize Epoch
Configure the contract's epoch through the Contract UI:
Required parameters:
minimum_witness_for_claim_creation
: Set to 1witnesses
: Use the following array:
Frontend Implementation
Setup Frontend Environment
Clone and install dependencies:
Configure Components
GenerateProofPage.tsx
This component handles proof generation and storage:
- Implements the
onSuccessCallback
to save proofs - Requires your Reclaim credentials (look for
//TODO
comments) - Enables navigation to the proof verification page
Contract Configuration
If using a custom contract deployment:
-
Update
src/metadata/addresses.json
:- Add your contract's address
-
Update
src/metadata/reclaim.json
:- Include your contract's ABI
Proof Verification (src/utils/verifyProof.ts)
Customize this file if you:
- Modified the
verify_proof
function - Added custom verification logic
- Need to call different contract functions
Launch and Test
Start the development server:
Workflow:
- Connect your wallet to the application
- Generate a proof using the Reclaim interface
- Navigate to the "Verify Proof" page
- Submit the proof for on-chain verification
Next Steps
- Explore adding custom verification logic to the contract
- Implement additional frontend features
- Test with different proof types
- Review the Reclaim Protocol documentation for advanced features