Use cases

  1. Language Learning Apps: Reward users with XP and badges for completing levels or reaching streak milestones, granting them access to exclusive levels.
  2. Corporate Training: Automatically reward employees with certificates or badges after completing required training modules, aiding in progress tracking and compliance.
  3. Music Learning Platforms: Reward students with badges for completing lessons or practice hours, granting them access to feedback sessions with professional musicians or exclusive performance opportunities.
  4. Gaming Platforms: Reward players with XP or unlockable content for completing in-game missions or challenges, recognizing achievements and encouraging continued gameplay.
  5. Educational Institutions & Digital CVs: Reward students for completing both in-person and online education, providing badges that verify their micro-learning achievements.

Video Setup

Prerequisites

  1. Setup OPENFORMAT

    Before you can continue, please complete the following steps to obtain the necessary credentials:

    1. Go to the OPENFORMAT Dashboard
    2. Register for an account
    3. Generate an API Key
    4. Create a dApp
    5. Create a Badge (only if required)

Get Started

A step-by-step breakdown of how this template works.

1

Remix this template

Clone this template in BuildShip.

2

OPENFORMAT Node Inputs

Add your OPENFORMAT API Key and Private Key into the Check missions, Reward XP and Reward Badge node inputs.

3

Test Integration

To test the integration, click on Test and add the dAppId and userId of your user to the body of the request. e.g.

{
  "dappId": "0x707ff576432e6d7a438b1beab763d6c41be27207",
  "userId": "0x67c7d1b286926642a91d38265bc2a25ea0045726"
}

Node Inputs

Check Missions

KeyDescription
API KeyYour OPENFORMAT API Key. which can be created in the Dashboard.
dApp IDThe ID for your OPENFORMAT dApp, you can create a dApp in the OPENFORMAT Dashboard.
User IDThe address of the user, which will be their existing web3 account address.
MissionsThe list of missions to check for.

Missions Example

My example app is designed to help users run their first 10km by completing 1km runs. Each time a user completes a 1km run, we use the Reward XP node to complete the complete_run action. Once they complete the complete_run action a specific amount of times, they will complete a mission. We use the following mission configuration:

[
  {
    "name": "Complete First Run",
    "requirements": [{ "action_name": "complete_run", "count": 1 }],
    "xp_reward_amount": 100,
    "badge_reward_id": "INSERT_COMPLETE_FIRST_RUN_BADGE_ID"
  },
  {
    "name": "Run 5k",
    "requirements": [{ "action_name": "complete_run", "count": 5 }],
    "xp_reward_amount": 200,
    "badge_reward_id": "INSERT_COMPLETE_5K_RUN_BADGE_ID"
  },
  {
    "name": "Run 10k",
    "requirements": [{ "action_name": "complete_run", "count": 10 }],
    "xp_reward_amount": 1000,
    "badge_reward_id": "INSERT_COMPLETE_10K_RUN_BADGE_ID"
  }
]

In this configuration:

  • First Mission: complete_first_run

    • Requirements: The user must complete their first run (complete_run action) once.
    • Rewards: Upon completion, the user earns 100 XP and receives a badge identified by BADGE_ID_FIRST_RUN.
  • Second Mission: run_5k

    • Requirements: The user must complete five runs (complete_run action) in total.
    • Rewards: Upon completion, the user earns 200 XP and receives a badge identified by BADGE_ID_RUN_5K.
  • Third Mission: run_10k

    • Requirements: The user must complete ten runs (complete_run action) in total.
    • Rewards: Upon completion, the user earns 1000 XP and receives a badge identified by BADGE_ID_RUN_10K.

Reward XP

KeyDescription
API KeyYour OPENFORMAT API Key. You can find this in the Settings page of the Dashboard (String)
dApp IDThe ID of your OPENFORMAT dApp. You can get this in the Dashboard (String, max 32 characters)
Private KeyThe Private Key of your web3 account. You can find this in the Settings page of the Dashboard.
Action IDA random identifier for the action that has been completed, e.g., completed_workout, completed_lesson. (String, max 32 characters)
Amount of XPThe amount of XP to be rewarded. (Number, whole number only)
ReceiverThe address of the receiver, which will be the existing web3 account or the newly generated account.
AwaitWait for the transaction to be confirmed on the blockchain. (Boolean, default: true)

Reward Badge

KeyDescription
API KeyYour OPENFORMAT API Key. You can find this in the Settings page of the Dashboard (String)
dApp IDThe ID of your OPENFORMAT dApp. You can get this in the Dashboard (String, max 32 characters)
Private KeyThe Private Key of your web3 account. You can find this in the Settings page of the Dashboard.
Badge NameThe name of the badge that you are awarding, this must exactly match the name of the badge created. You can create a badge in the Dashboard. (string)
ReceiverThe address of the receiver, which will be the existing web3 account or the newly generated account.
AwaitWait for the transaction to be confirmed on the blockchain. (Boolean, default: true)

Gotchas and Troubleshooting

  • If you encounter issues, ensure all required fields are correctly filled and check your API and Private Key configurations in the Dashboard settings.
  • For custom name and image configurations for anonymous users, edit the Improve Leaderboard node with your preferred text and URLs.