Secret Codes Validator
The Secret Codes Validator allows you to reward customers who receive a special code—whether it’s after winning a competition, making a purchase, or attending an exclusive event. This validator drives engagement and ensures that rewards go directly to your most valued participants, creating memorable and secure brand experiences.
This mechanism uses Zero-Knowledge Proofs (ZKP) to let users prove they possess a valid code without ever revealing the code on the blockchain. This ensures both privacy and security for your organization and your users.
How to Configure the Secret Codes Validator
- Set the number of codes:
Choose how many unique secret codes you want to generate (for example,N
codes). - Automatic code generation:
The platform will generateN
pseudo-random secret codes for your campaign or event. - Hash calculation:
Each code is hashed using the Poseidon cryptographic hash function. - Store hashes on-chain:
Only the hashes (never the codes themselves) are stored in the smart contract, keeping your codes secure.
How Users Claim Rewards
- User receives a secret code:
After winning or participating in an event, the user receives a unique code from your organization. - User enters their code:
To claim their reward, the user enters the code into the platform’s interface. - Local hash calculation:
The code is hashed locally (on the user’s device), ensuring the secret code is never sent over the internet or stored on-chain. - Hash verification:
The platform checks if the hash matches one of the valid hashes stored in the smart contract. - Zero-Knowledge Proof generation:
The user’s device generates a Zero-Knowledge Proof (ZKP) to prove that they know a valid code, without revealing the code itself. - Submit claim:
The user submits the generated proof by calling theclaimReward
method on the smart contract. - Reward distribution:
- If the proof is valid, the contract records that the code was used and distributes the reward tokens to the user.
- Each code can only be used once, preventing double-claims.
💡 Tip:
The Secret Codes Validator is ideal for exclusive promotions, event-based campaigns, and any scenario where you want to reward users with a high level of security and privacy.