Challenges define a rule for the approval in the form of a Merkle challenge.

A Merkle challenge is a challenge where the user must provide a Merkle proof to a Merkle tree. If they provide a valid proof, then the challenge is met. All challenges must be met with valid solutions for the transfer to be approved.

IMPORTANT: Merkle challenges currently are limited to SHA256 hashes. See documentation for MerkleChallenge for more details and tutorials.

IMPORTANT: We track the number of uses per leaf according to the challengeTrackerId specified by the parent approval of this challenge. If you update the challenge ID, then the used leaves tracker will reset and start a new tally. We recommend using a unique challenge ID for each challenge to prevent overlap and unexpected behavior.

from message badges.MerkleChallenge

Hierarchy

Constructors

Properties

challengeTrackerId: string = ""

The ID of this Merkle challenge for tracking the number of uses per leaf.

from field: string challengeTrackerId = 7;

customData: string = ""

Arbitrary custom data associated with this Merkle challenge.

from field: string customData = 6;

expectedProofLength: string = ""

The expected length of the Merkle path for verification. Used to prevent Merkle path truncation attacks.

from field: string expectedProofLength = 2;

maxUsesPerLeaf: string = ""

The maximum number of times each leaf can be used. Must be 1 if useCreatorAddressAsLeaf is false to prevent replay attacks.

from field: string maxUsesPerLeaf = 4;

root: string = ""

The root hash of the Merkle tree to which the Merkle path must lead for verification.

from field: string root = 1;

uri: string = ""

The URI associated with this Merkle challenge, optionally providing metadata about the challenge.

from field: string uri = 5;

useCreatorAddressAsLeaf: boolean = false

If true, we will override the user's leaf for their proof with their creator address. Used for whitelist trees where all leaves are valid Cosmos addresses.

from field: bool useCreatorAddressAsLeaf = 3;

fields: FieldList = ...
runtime: ProtoRuntime = proto3
typeName: "badges.MerkleChallenge" = "badges.MerkleChallenge"

Methods