# Quest Token Collection Example

This example demonstrates creating a quest collection.

## Transaction Structure

```json
[
    {
        "creator": "bb18el5ug46umcws58m445ql5scgg2n3tzagfecvl",
        "collectionId": "0",
        "defaultBalances": {
            "balances": [],
            "outgoingApprovals": [],
            "incomingApprovals": [],
            "autoApproveSelfInitiatedOutgoingTransfers": true,
            "autoApproveSelfInitiatedIncomingTransfers": true,
            "autoApproveAllIncomingTransfers": true,
            "userPermissions": {
                "canUpdateOutgoingApprovals": [],
                "canUpdateIncomingApprovals": [],
                "canUpdateAutoApproveSelfInitiatedOutgoingTransfers": [],
                "canUpdateAutoApproveSelfInitiatedIncomingTransfers": [],
                "canUpdateAutoApproveAllIncomingTransfers": []
            }
        },
        "validTokenIds": [
            {
                "start": "1",
                "end": "1"
            }
        ],
        "collectionPermissions": {
            "canDeleteCollection": [],
            "canArchiveCollection": [],
            "canUpdateStandards": [],
            "canUpdateCustomData": [],
            "canUpdateManager": [],
            "canUpdateCollectionMetadata": [],
            "canUpdateValidTokenIds": [],
            "canUpdateTokenMetadata": [],
            "canUpdateCollectionApprovals": [],
            "canAddMoreAliasPaths": [],
            "canAddMoreCosmosCoinWrapperPaths": []
        },
        "manager": "bb18el5ug46umcws58m445ql5scgg2n3tzagfecvl",
        "collectionMetadata": {
            "uri": "ipfs://QmRbRYYyphz73apphqP3QQmkeZxbtMWmAxasGfhcw1RApD",
            "customData": ""
        },
        "tokenMetadata": [
            {
                "uri": "ipfs://QmRbRYYyphz73apphqP3QQmkeZxbtMWmAxasGfhcw1RApD",
                "customData": "",
                "tokenIds": [
                    {
                        "start": "1",
                        "end": "18446744073709551615"
                    }
                ]
            }
        ],
        "customData": "",
        "collectionApprovals": [
            {
                "fromListId": "Mint",
                "toListId": "All",
                "initiatedByListId": "All",
                "transferTimes": [
                    {
                        "start": "1",
                        "end": "18446744073709551615"
                    }
                ],
                "tokenIds": [
                    {
                        "start": "1",
                        "end": "1"
                    }
                ],
                "ownershipTimes": [
                    {
                        "start": "1",
                        "end": "18446744073709551615"
                    }
                ],
                "uri": "ipfs://QmPUAjAPMDQMJZV8mpnaYbhBu2BUS4u449c7KsRNZip9uf",
                "customData": "",
                "approvalId": "quests-approval",
                "approvalCriteria": {
                    "merkleChallenges": [
                        {
                            "root": "5958c51f7c54d8e27ac42a9a2f03069c1412071abb87bf0e7be0dde790a82dbb",
                            "expectedProofLength": "0",
                            "useCreatorAddressAsLeaf": false,
                            "maxUsesPerLeaf": "1",
                            "uri": "ipfs://QmRsSK3Fw63bcJPuiYutNfBK3TYdnB8X5QG8W6ksVMuNcH",
                            "customData": "",
                            "challengeTrackerId": "1c5b9f3c390d26981996a6b593fe42300023b0e43534954a73075b912d9ca2e6",
                            "leafSigner": "0xa612B14Ff99DAe9FBC9613bF4553781086c5F887"
                        }
                    ],
                    "ethSignatureChallenges": [],
                    "predeterminedBalances": {
                        "manualBalances": [],
                        "incrementedBalances": {
                            "startBalances": [
                                {
                                    "amount": "1",
                                    "ownershipTimes": [
                                        {
                                            "start": "1",
                                            "end": "18446744073709551615"
                                        }
                                    ],
                                    "tokenIds": [
                                        {
                                            "start": "1",
                                            "end": "1"
                                        }
                                    ]
                                }
                            ],
                            "incrementTokenIdsBy": "0",
                            "incrementOwnershipTimesBy": "0",
                            "durationFromTimestamp": "0",
                            "allowOverrideTimestamp": false,
                            "recurringOwnershipTimes": {
                                "startTime": "0",
                                "intervalLength": "0",
                                "chargePeriodLength": "0"
                            },
                            "allowOverrideWithAnyValidToken": false
                        },
                        "orderCalculationMethod": {
                            "useOverallNumTransfers": true,
                            "usePerToAddressNumTransfers": false,
                            "usePerFromAddressNumTransfers": false,
                            "usePerInitiatedByAddressNumTransfers": false,
                            "useMerkleChallengeLeafIndex": false,
                            "challengeTrackerId": ""
                        }
                    },
                    "approvalAmounts": {
                        "overallApprovalAmount": "0",
                        "perToAddressApprovalAmount": "0",
                        "perFromAddressApprovalAmount": "0",
                        "perInitiatedByAddressApprovalAmount": "0",
                        "amountTrackerId": "quests-approval",
                        "resetTimeIntervals": {
                            "startTime": "0",
                            "intervalLength": "0"
                        }
                    },
                    "maxNumTransfers": {
                        "overallMaxNumTransfers": "1",
                        "perToAddressMaxNumTransfers": "0",
                        "perFromAddressMaxNumTransfers": "0",
                        "perInitiatedByAddressMaxNumTransfers": "0",
                        "amountTrackerId": "quests-approval",
                        "resetTimeIntervals": {
                            "startTime": "0",
                            "intervalLength": "0"
                        }
                    },
                    "coinTransfers": [
                        {
                            "to": "",
                            "coins": [
                                {
                                    "denom": "ubadge",
                                    "amount": "5000000000"
                                }
                            ],
                            "overrideFromWithApproverAddress": true,
                            "overrideToWithInitiator": true
                        }
                    ],
                    "requireToEqualsInitiatedBy": false,
                    "requireFromEqualsInitiatedBy": false,
                    "requireToDoesNotEqualInitiatedBy": false,
                    "requireFromDoesNotEqualInitiatedBy": false,
                    "overridesFromOutgoingApprovals": true,
                    "overridesToIncomingApprovals": false,
                    "autoDeletionOptions": {
                        "afterOneUse": false,
                        "afterOverallMaxNumTransfers": false
                    },
                    "userRoyalties": {
                        "percentage": "0",
                        "payoutAddress": ""
                    },
                    "mustOwnTokens": [],
                    "dynamicStoreChallenges": [],
                    "votingChallenges": [],
                    "evmQueryChallenges": [],
                    "senderChecks": {
                        "mustBeEvmContract": false,
                        "mustNotBeEvmContract": false,
                        "mustBeLiquidityPool": false,
                        "mustNotBeLiquidityPool": false
                    },
                    "recipientChecks": {
                        "mustBeEvmContract": false,
                        "mustNotBeEvmContract": false,
                        "mustBeLiquidityPool": false,
                        "mustNotBeLiquidityPool": false
                    },
                    "initiatorChecks": {
                        "mustBeEvmContract": false,
                        "mustNotBeEvmContract": false,
                        "mustBeLiquidityPool": false,
                        "mustNotBeLiquidityPool": false
                    },
                    "altTimeChecks": {
                        "offlineHours": [],
                        "offlineDays": []
                    },
                    "mustPrioritize": false
                },
                "version": "0"
            }
        ],
        "standards": ["Quests"],
        "isArchived": false,
        "mintEscrowCoinsToTransfer": [
            {
                "denom": "ubadge",
                "amount": "5000000000"
            }
        ],
        "cosmosCoinWrapperPathsToAdd": [],
        "aliasPathsToAdd": [],
        "invariants": {
            "noCustomOwnershipTimes": false,
            "maxSupplyPerId": "0",
            "cosmosCoinBackedPath": null,
            "noForcefulPostMintTransfers": false,
            "disablePoolCreation": false,
            "evmQueryChallenges": []
        }
    }
]
```

## Key Features

### Quest Token Collection

This example creates a quest collection with the following characteristics:

* **Single Token**: Only token ID 1 is valid (`validTokenIds: [{"start": "1", "end": "1"}]`)
* **Quest Standard**: Uses the "Quests" standard for quest-related functionality
* **Merkle Proof Verification**: Requires users to provide valid Merkle proofs (BitBadges claims) to claim tokens
* **Coin Rewards**: Transfers 5000000000 ubadge coins to successful claimants and properly handles the Mint escrow coins

### Approval System

#### Collection Approval (Minting)

* **From/To**: Mint → All users
* **Merkle Challenge**: Root hash `5958c51f7c54d8e27ac42a9a2f03069c1412071abb87bf0e7be0dde790a82dbb`
* **Leaf Signer**: `0xa612B14Ff99DAe9FBC9613bF4553781086c5F887` (Ethereum address)
* **Max Uses**: 1 per leaf, overall max 1 transfer
* **Coin Transfer**: 5000000000 ubadge coins per successful claim

#### Default User Approvals

* **Incoming**: Allows all incoming transfers from any source
* **Auto-approve**: Self-initiated transfers are automatically approved
* **User Permissions**: No user permissions to update approvals (all soft-enabled)

### Manager and Permissions

* **Manager**: `bb18el5ug46umcws58m445ql5scgg2n3tzagfecvl` (one manager)
* **Collection Permissions**: All permissions are empty (all soft-enabled)

### Metadata

* **Collection URI**: `ipfs://QmRbRYYyphz73apphqP3QQmkeZxbtMWmAxasGfhcw1RApD`
* **Token URI**: Same as collection URI for all tokens
* **Approval URI**: `ipfs://QmPUAjAPMDQMJZV8mpnaYbhBu2BUS4u449c7KsRNZip9uf`
* **Challenge URI**: `ipfs://QmRsSK3Fw63bcJPuiYutNfBK3TYdnB8X5QG8W6ksVMuNcH`

### Escrow and Funding

* **Mint Escrow**: 5000000000 ubadge coins are escrowed to fund the coin transfers
* **No Cosmos Coin Wrapper**: Empty `cosmosCoinWrapperPathsToAdd` array. No wrapping allowed.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bitbadges.io/token-standard/examples/txs/msgcreatecollection/quest-badge-collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
