Reward Unit

In the ZBD Rewards SDK, rewards are sent as units. A unit is a configurable value determined by your ZBD Customer Success Manager and can represent different amounts, such as 1 satoshi or $0.10.

For example, if the game is configured so that 1 unit = 1 satoshi, sending 1 reward will send 1 satoshi. Conversely, if the game is set up so that 1 unit = $0.10, sending 1 reward will send the equivalent of $0.10 in satoshis.

Sending Rewards

To send a reward to a user you can call:

ZBDController.Instance.SendReward(1, callback =>
{
  if (callback.success)
  { 
    // reward sent
  }
  else
  {
    Debug.LogError("send reward error " + callback.message);
  }
});

However, for improved security it is recommended (almost required!) that you call the SendReward API from your app’s/game’s server after validating actual gameplay.

This can be done using the users ZBD SDK ID which you can obtain after initialization has completed.

ZBDController.Instance.Init("customUserId", completion => {
  if (completion.success) {
    string sdkUserId = completion.userId;
  }
});
curl --location 'https://api.zebedee.io/api/v1/rewards/limited-achievement/reward' \
--header 'Content-Type: application/json' \
--data '{"rewardsUserId":"USER ZBD SDK ID","amount": 1}'

Without calling SendReward from your backend server the security model downgrades to only relying on device attestation and the withdrawal limit based on time the device is active. More information on this can be found in the Security section.