Merkle Challenges
Overview
Interface Definition
export interface MerkleChallenge<T extends NumberType> {
root: string; // SHA256 Merkle tree root hash
expectedProofLength: T; // Required proof length (security)
useCreatorAddressAsLeaf: boolean; // Use initiator address as leaf?
maxUsesPerLeaf: T; // Maximum uses per leaf
uri: string; // Metadata URI
customData: string; // Custom data field
challengeTrackerId: string; // Unique tracker identifier
leafSigner: string; // Optional leaf signature authority
}Basic Example
Challenge Types
1. Claim Code Challenges
2. Whitelist Challenges
Understanding useCreatorAddressAsLeaf
Whitelist Trees (useCreatorAddressAsLeaf: true)
useCreatorAddressAsLeaf: true)Claim Code Trees (useCreatorAddressAsLeaf: false)
useCreatorAddressAsLeaf: false)Security Features
Expected Proof Length
Max Uses Per Leaf
Setting
Behavior
Use Case
Replay Attack Protection
Challenge Tracking
Tracker System
Tracker Examples
Tracker Management
Leaf Signatures
Protection Against Front-Running
Implementation
Merkle Tree Construction
Standard Configuration
Critical Requirements
Transfer Integration
Providing Proofs
Proof Generation
Comparison with ETH Signature Challenges
Best Practices
Design Considerations
Performance Optimization
Last updated