VeBetter: Build X2Earn Apps

Creating & Submitting Proofs

Learn how to structure and submit JSON-based proofs that verify user actions and support transparent, onchain reward distribution.

What Are Proofs?

In this lesson, you’ll learn how to structure and submit proofs, JSON objects that verify user actions, and use the VeBetter SDK to send B3TR rewards on the testnet.

A proof is a structured JSON payload that documents a real-world action.

It typically includes:

  • What the user did

  • Where/when it happened

  • The device/app that recorded it

  • Media or data to support it

This acts like a digital “receipt” for positive behavior, ensuring rewards are verifiable and auditable.

Example Proof Payload

{
  "version": 2,
  "description": "User walked 5,000 steps",
  "proof": {
    "image": "https://example.com/photo.jpg",
    "location": "Ljubljana, SI"
  },
  "impact": {
    "steps": 5000
  }
}
  • description: A human-readable summary

  • proof: Supporting media or metadata (image, GPS, etc.)

  • impact: The quantified result of the action (e.g., 5000 steps)

This JSON is recorded onchain in event logs.

Submit Rewards with the SDK

VeBetter provides a JavaScript SDK to make reward distribution simple.

Here’s how to submit a proof and send B3TR:

await x2EarnRewardsPoolContract.transact.distributeRewardWithProof(
  APP_ID,
  amount,       // e.g., "10"
  recipient,    // user's wallet address
  ["image", "location"],  // Proof keys
  ["https://example.com/photo.jpg", "Ljubljana, SI"], // Proof values
  ["steps"],    // Impact keys
  ["5000"],     // Impact values
  "Walked 5k steps during lunch break", // Description);

This function:

  • Records the proof + metadata onchain

  • Sends B3TR to the user

  • Works on the testnet once your app and reward distributor are registered

Optional: Contract-Based Distribution

If you're building a backend service or writing a smart contract, you can call the reward distribution function using its ABI.

Smart contracts must be whitelisted under your app in the dashboard to execute this method.

VeBetter Docs