NuloPay

NuloPay is a system where advertisers fund tasks and users are paid for completing verifiable actions. Payouts are executed only after verification and are settled on-chain.

Concept

Tasks are defined by a type and payload. Users claim tasks, submit evidence, and verifiers decide whether the evidence is valid. Payment is gated and only occurs after verification.

Architecture

This is a unified Next.js application with API routes handling all backend logic:

  1. API routes for task assignment and proof submission.
  2. Verification endpoints for evidence checks and approval decisions.
  3. Payout routes for invoice creation and on-chain transfers.
User -> /api/tasks/claim -> /api/proofs
         |
         v
/api/verifications -> /api/payouts/requests
         |               |
         +--402 invoice--+
         |   receipt     |
         +-> on-chain USDC transfer

Execution model (HTTP 402)

The payout endpoint returns HTTP 402 when a verifier requests execution. The verifier pays the invoice on-chain, then retries with the receipt attached. The payout service validates the receipt and proceeds.

Payout flow

  1. Verifier approves a proof.
  2. Verifier requests payout.
  3. Payout endpoint returns 402 invoice.
  4. Verifier pays invoice on-chain.
  5. Verifier retries with receipt.
  6. Payout endpoint validates and transfers funds.

Task model

Tasks have a task_type string and a JSON payload. Evidence is submitted as JSON and can include one or more links or fields. The system supports generic types such as manual_link_check and can be extended.

Limits and abuse prevention

Controls are applied before payout:

  1. Per-wallet daily payout cap.
  2. Per-wallet submissions per hour.
  3. Duplicate evidence detection by hash.
  4. Risk score threshold blocks verification.

API surface

  1. POST /api/campaigns
  2. POST /api/tasks/claim
  3. POST /api/proofs
  4. POST /api/verifications
  5. POST /api/admin/proofs/:id/approve
  6. POST /api/admin/proofs/:id/reject
  7. GET /api/admin/proofs
  8. GET /api/users/:id/dashboard
  9. POST /api/payouts/requests
  10. GET /api/health