QuestN Integration: API Verifier and Reward Distribution

Note: when a project launches a quest campaign on QuestN, standard verifiers are often insufficient. For example, you need to verify that a user staked tokens in a pool, not just sent a transaction. Without custom integration, such tasks remain unsolved. Statistics: 95% of DeFi projects require at l

Blockchain Development Services

Frequently Asked Questions

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1441
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1301
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    998
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1267
  • image_logo-advance_0.webp
    B2B Advance company logo design
    713
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    1003

Note: when a project launches a quest campaign on QuestN, standard verifiers are often insufficient. For example, you need to verify that a user staked tokens in a pool, not just sent a transaction. Without custom integration, such tasks remain unsolved. Statistics: 95% of DeFi projects require at least one non-standard check, and 70% face fraud when using built-in tools. We help set up integration with QuestN turnkey: from a simple campaign to a custom API verifier and smart contracts for rewards. In 5 years, we've implemented 30+ integrations for DeFi and NFT projects, saving clients up to $5,000 in gas.

How Custom Integration Saves Gas

Standard verifiers do not optimize on-chain calls — each request to the contract burns gas. A custom API verifier can cache results or check conditions in batches. We implement batch checks via multicall (e.g., via ethers.js): in one request, we check balances for hundreds of addresses. Gas savings up to 60% — up to $5,000 for a campaign with 10,000 participants. A custom API verifier is 3 times more gas-efficient than sequential on-chain requests. Development cost of such a verifier starts from $1,500, which pays off within 1-2 campaigns.

Types of Integration

Built-in QuestN verifiers cover standard cases: hold ERC-20/NFT, execute a transaction to an address, interact with a specific contract. If your task fits these templates, custom development is not needed; configuration in the UI is sufficient.

Custom API verifier is required when the condition is specific to your logic: "user staked more than 100 tokens", "has an active position in a pool", "passed KYC in our system". QuestN calls your endpoint with the wallet address, you return {"result": true/false}.

// Express/Next.js API route app.get('/api/questn/verify', async (req, res) => { const { address } = req.query; // Check condition: e.g., staking balance > threshold const stakedBalance = await stakingContract.read.balanceOf([address]); const qualified = stakedBalance >= parseEther('100'); res.json({ result: qualified }); }); 

QuestN signs requests to your endpoint with an HMAC signature — verify it to accept requests only from QuestN. We implement HMAC verification on the server side using the secret key from the QuestN panel. According to QuestN documentation, the signing algorithm is HMAC-SHA256.

Why Custom Integration Is More Reliable

Standard verifiers are vulnerable to fraud: a user could borrow tokens at the time of verification or use a flash loan. A custom API verifier checks historical data (e.g., minimum balance over the last 30 days) or composite conditions: "hold more than 100 tokens AND be a DAO member". This reduces fraud risk by 80%. Additionally, you can add captcha or rate-limiting to your endpoint — QuestN supports retries.

Example: Staking Pool Integration

One of our clients is a DeFi protocol with a staking pool on Polygon. Task: reward users who staked ≥500 MATIC and did not withdraw for 7 days. The built-in verifier could not check the time condition. We developed an API endpoint that called the staking contract via viem, checked the balance and the timestamp of the last deposit. Result: 1200 participants in 2 days of campaign, zero fraud. Gas savings amounted to 55% compared to on-chain verification of each wallet.

Reward Distribution via Smart Contracts

For NFT rewards through QuestN: provide a contract with a claim() function and whitelist logic, or use a merkle-proof mechanism. QuestN generates a list of winners — you upload the merkle root, users claim themselves. For token rewards: QuestN can distribute through its own mechanism (you top up their escrow), or you integrate your own distributor contract and give QuestN a whitelist of addresses. We implement both approaches — the choice depends on your security and gas requirements. If you want to minimize gas, use merkle-tree — claim cost is about $0.1 on Polygon.

Comparison of Approaches

Parameter Built-in Verifier Custom API Verifier
Flexibility Only standard conditions Any on-chain/off-chain checks
Setup time A few hours 1-3 days
Development needed No Yes (server code)
Security Managed by QuestN You are responsible for HMAC verification and error handling
Cost Free (within campaign) from $1,500

Custom approach is more accurate and reduces fraud risk, especially for complex logics. You get full control over conditions and can extend functionality without platform limitations.

How to Set Up a Custom API Verifier in 3 Steps

  1. Deploy an endpoint. Create an HTTPS route that accepts GET/POST with parameters address and taskId. Use Express, Next.js, or any framework.
  2. Verify the signature. Obtain the secret key from the QuestN panel. Check the HMAC-SHA256 of the x-questn-signature header before processing.
  3. Perform on-chain verification. Use viem or ethers.js to call the contract. Return {"result": true/false}. Handle errors (timeout 5 sec).

After setup, test on testnet. We assist with debugging and gas optimization — for example, replacing individual requests with multicall to save gas. Get a consultation on your task right now.

Process of Work

Stage Duration Result
Analytics 1 day Understanding tasks, choosing approach, prototype
Design 1 day API specification, contract architecture
Development 1-3 days API code, smart contracts, tests
Testing 1 day Integration tests, QA
Deployment 1 day Deployment, documentation

What's Included

  • Audit of current architecture and problem definition
  • Configuration of built-in verifiers or development of custom API
  • Development of smart contracts for rewards (NFT claim, token distribution, merkle-tree)
  • Testing on testnet and deployment to mainnet
  • Documentation for operating the endpoint and contracts
  • Team training (1 hour) and access transfer
  • Support for 30 days after launch

We are responsible for the integration's functionality and guarantee correct verification. Get a consultation on your task — we'll evaluate your project for free in 1 day. Order campaign setup or custom integration with QuestN.

Timeline Estimates

Campaign setup with built-in verifiers: a few hours. Custom API verifier + deployment: 1-3 days. Timelines are refined after analysis — for complex scenarios, up to 5 days may be required.