Skip to content

GetChallengeTracker returns how many times a Merkle leaf has been used for a Merkle challenge.

Returns the number of times a leaf index has been used to satisfy a Merkle challenge.

Example

bash
# [collectionId] [approvalLevel] [approverAddress] [approvalId] [challengeTrackerId] [leafIndex]
bb query tokenization num-used-for-merkle-challenge 1 collection "" claim claim_demo_01 42
bash
curl "https://lcd.bitbadges.io/bitbadges/bitbadgeschain/tokenization/get_challenge_tracker/1/collection//claim_demo_01/42?approvalId=claim"

The REST path order is {collectionId}/{approvalLevel}/{approverAddress}/{challengeTrackerId}/{leafIndex}. Pass approvalId as a query parameter; it is part of the tracker key even though it is absent from the REST path.

Request

FieldTypeDescription
collectionIdstringCollection ID.
approvalLevelstringcollection, incoming, or outgoing.
approverAddressstringEmpty for collection.
approvalIdstringApproval ID.
challengeTrackerIdstringchallengeTrackerId from the Merkle challenge.
leafIndexstringLeaf index in the Merkle tree.

Response

json
{ "numUsed": "1" }
FieldTypeDescription
numUsedstringUses so far. "0" when never used.

Behavior

  • With maxUsesPerLeaf: 1 (the common claim code pattern), numUsed: "1" means the code is spent.

Edit this page on GitHub