Learn

Use

Build

Participate

Learn

Use

Build

Participate

Jun 23, 2025

5 min

How to Build an X2Earn dApp with VeBetter

VeChain Official

Integrate your dApp into the VeBetter ecosystem
Integrate your dApp into the VeBetter ecosystem
Integrate your dApp into the VeBetter ecosystem

Building a dApp that rewards users for real-world sustainable actions like walking, recycling, or using public transport? You’ll want to integrate with VeBetter—a protocol on VeChain that enables the distribution of B3TR tokens for verified positive behavior.

Here’s how to get started.

 🔗 docs.vebetterdao.org

What You’ll Need

To participate in VeBetter and enable your dApp to distribute B3TR rewards, your application needs two key capabilities:

  • Ability to distribute B3TR tokens

  • A verifiable proof submission system in JSON format

Let’s break those down.

B3TR Token Distribution

Your smart contract must be able to send B3TR tokens when a user completes an eligible action. This reward logic must be on-chain, using VeChain-compatible contracts.

🧑‍💻 Example: Automatically distribute B3TR tokens when a “walk” action is verified by your backend.

Set Up on Testnet

To start building, use the official VeBetter testnet dashboard:

🔗 dev.testnet.governance.vebetterdao.org

Steps:

  • Add your app to the dashboard

  • Claim testnet B3TR tokens from the Faucet

  • Deposit tokens into your app balance (via the Deposit button)

This balance funds B3TR distributions to your users.

Authorize Your Contract

Before your smart contract or backend can distribute rewards, it must be authorized:

  • Go to your app’s Settings

  • Click the ⚙️ icon

  • Add the contract address that will call distributeReward

  • Mark it as a Reward Distributor

Once approved, your dApp can trigger B3TR payouts on-chain.

📹 For a full walkthrough and contract addresses, visit:

 🔗 Test Environment Docs

Create a Proof Submission System

Each reward must be supported by a verifiable JSON payload that outlines the user’s activity.

Example:

json

{

"account": "0xUserAddress",

"action": "walk",

"amount": 2000,

"timestamp": "2025-05-13T12:00:00Z",

"metadata": {

"location": "Ljubljana, SI",

"device": "FitApp"

}

}

This structure ensures the reward is based on a real, provable action.

Dev Tools & Resources

VeBetter provides tools and environments to support your build process:

✅ Simulate proofs

 ✅ Deploy and test smart contracts

 ✅ Claim testnet B3TR tokens

🔗 Test Environment Guide

🔗 Token Faucet

Use the X2Earn App Template

To save time, start with the official boilerplate:

🔗 VeChain X2Earn App Template (GitHub)

It includes:

  • A basic smart contract

  • Frontend scaffolding

  • Utilities for reward logic and proof handling

Why B3TR?

B3TR makes sustainability programmable.

Your app can reward walking, cycling, learning, volunteering - any verifiable action that creates real-world impact.

By building with VeBetter, you join a growing ecosystem of purpose-driven applications on VeChain.

🔗 Start here: docs.vebetterdao.org

Building a dApp that rewards users for real-world sustainable actions like walking, recycling, or using public transport? You’ll want to integrate with VeBetter—a protocol on VeChain that enables the distribution of B3TR tokens for verified positive behavior.

Here’s how to get started.

 🔗 docs.vebetterdao.org

What You’ll Need

To participate in VeBetter and enable your dApp to distribute B3TR rewards, your application needs two key capabilities:

  • Ability to distribute B3TR tokens

  • A verifiable proof submission system in JSON format

Let’s break those down.

B3TR Token Distribution

Your smart contract must be able to send B3TR tokens when a user completes an eligible action. This reward logic must be on-chain, using VeChain-compatible contracts.

🧑‍💻 Example: Automatically distribute B3TR tokens when a “walk” action is verified by your backend.

Set Up on Testnet

To start building, use the official VeBetter testnet dashboard:

🔗 dev.testnet.governance.vebetterdao.org

Steps:

  • Add your app to the dashboard

  • Claim testnet B3TR tokens from the Faucet

  • Deposit tokens into your app balance (via the Deposit button)

This balance funds B3TR distributions to your users.

Authorize Your Contract

Before your smart contract or backend can distribute rewards, it must be authorized:

  • Go to your app’s Settings

  • Click the ⚙️ icon

  • Add the contract address that will call distributeReward

  • Mark it as a Reward Distributor

Once approved, your dApp can trigger B3TR payouts on-chain.

📹 For a full walkthrough and contract addresses, visit:

 🔗 Test Environment Docs

Create a Proof Submission System

Each reward must be supported by a verifiable JSON payload that outlines the user’s activity.

Example:

json

{

"account": "0xUserAddress",

"action": "walk",

"amount": 2000,

"timestamp": "2025-05-13T12:00:00Z",

"metadata": {

"location": "Ljubljana, SI",

"device": "FitApp"

}

}

This structure ensures the reward is based on a real, provable action.

Dev Tools & Resources

VeBetter provides tools and environments to support your build process:

✅ Simulate proofs

 ✅ Deploy and test smart contracts

 ✅ Claim testnet B3TR tokens

🔗 Test Environment Guide

🔗 Token Faucet

Use the X2Earn App Template

To save time, start with the official boilerplate:

🔗 VeChain X2Earn App Template (GitHub)

It includes:

  • A basic smart contract

  • Frontend scaffolding

  • Utilities for reward logic and proof handling

Why B3TR?

B3TR makes sustainability programmable.

Your app can reward walking, cycling, learning, volunteering - any verifiable action that creates real-world impact.

By building with VeBetter, you join a growing ecosystem of purpose-driven applications on VeChain.

🔗 Start here: docs.vebetterdao.org