Layer3 quest platform integration

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1 servicesAll 1306 services
Layer3 quest platform integration
Simple
~1 business day
FAQ
Blockchain Development Services
Blockchain Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1214
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823

Layer3 Integration (Quest Platform)

Layer3 is one of the leading Web3 quest platforms that allows projects to set up on-chain and off-chain tasks for users with verification of completion and rewards in tokens or NFT. Integration is needed by projects that want to host quests on Layer3 and verify their completion via custom API or smart contract.

Quest Verification Models

Layer3 supports two verification mechanisms:

On-chain verification: Layer3 looks at blockchain state — did user complete a transaction with specified parameters (swap on specific DEX, mint NFT, add liquidity). Configured via Layer3 interface without your API. Suitable for standard on-chain actions.

API verification: Layer3 sends POST request to your endpoint with user's wallet address. Your server checks if this address completed the needed action, returns { "result": true/false }. Needed for off-chain activities: Discord subscription, action within your dApp, promo code entry.

Implementing API Verification

Endpoint must be accessible via HTTPS. Layer3 sends user address in request body:

// POST /api/layer3/verify-quest
import { Request, Response } from "express"
import crypto from "crypto"

interface Layer3VerifyRequest {
  address: string
  questId?: string
}

export async function verifyLayer3Quest(req: Request, res: Response) {
  // Verify webhook signature (if Layer3 provides secret)
  const signature = req.headers["x-layer3-signature"] as string
  const isValid = verifySignature(req.body, signature, process.env.LAYER3_WEBHOOK_SECRET!)

  if (!isValid) {
    return res.status(401).json({ error: "Invalid signature" })
  }

  const { address } = req.body as Layer3VerifyRequest

  // Your business logic for verification
  const completed = await checkUserCompletedTask(address)

  return res.json({ result: completed })
}

function verifySignature(body: object, signature: string, secret: string): boolean {
  const hmac = crypto.createHmac("sha256", secret)
  hmac.update(JSON.stringify(body))
  const expected = hmac.digest("hex")
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
}

Endpoint must respond quickly — Layer3 has timeout around 10 seconds. Cache heavy checks (on-chain requests) in Redis.

Setting Up Quest in Layer3 Dashboard

After deploying API:

  1. Create quest in Layer3 Dashboard → Add Task → API Verification
  2. Specify URL of your endpoint
  3. Optionally: secret for HMAC signature
  4. Set reward: XP, tokens (ERC-20 via your treasury), NFT

For token rewards Layer3 provides smart contract managing distribution. Project fills treasury, Layer3 automatically claims rewards for quest completers.

On-Chain Quests Without API

For standard on-chain actions Layer3 tracks events independently:

  • Transfer event with specific contract — mint NFT or receive token
  • Specific function call on contract (by selector)
  • Token balance above threshold
  • Snapshot voting

Configuration via Layer3 UI: specify contract address, event signature or function selector, condition. Verification happens on Layer3 side via their indexer — nothing additional to implement.

Timeline

Setting up Layer3 quest with on-chain verification without custom API — several hours. Development and deployment of API verification for off-chain quests — 1 business day including webhook testing.