Developer Documentation

Introduction To Betpalz Challenges

The betpalz system provides you with 2 main challenge types. Application Challenges and Freeform Challenges.

Freeform Challenges have 2 subtypes. The first is an unmoderated freeform challenge, where 2 users in the betpalz system would create a challenge and specify wagers for the challenge. The challenge is completely unstructured and thus the user creating the challenge would provide a description of the challenge, "Jack challenges Bill that he can jump farther than Bill" for example. Jack and Bill would then decide who is the better jumper and then complete the challenge in the betpalz system using either the Betpalz iOS application or through the SDK. Once the challenge is completed virtual assets will be transfered from the loser of the challenge to the winner and the challenge will be closed. In this unmoderated mode, both participants would have to agree on the outcome of the challenge, so of course there is an element of personal honour involved here. Jack and Bill could have decided to designate a moderator for this challenge who would "score" the challenge and ultimately decide who the winner of the challenge is. The moderator would have the final say in this situation.

Application Challenges are a more structured challenge type in that a betpalz devloper would create an application using the betpalz SDK in order to provide built-in challenging functionality giving users of his application the ability to create challenges against other betpalz users within the context of his application. For example, if Justin was a developer, he could create a Tic-Tac-Toe application, include the Betpalz SDK and provide a mode where users of his tic-tac-toe game could challenge each other on the outcome of tic-tac-toe matches. Bill and Jack could create a challenge on a game of tic-tac-toe, launch their tic-tac-toe applications and play head to head. The tic-tac-toe app written by justin would then decide on the winner, and make appropriate calls to the betpalz system to award the winner his bounty.

Anatomy of a Challenge

Here we will describe the key features and properties of a challenge that a betpalz developer should be aware of. For a more detailed view of the challenge structure, be sure to take a look at the SDK.

Unique Id - Every Challenge is unique and thus has it's own identifier.
Creation Date - The date a challenge was created.
Expiry Date - (optional) Challenges may have an expiry date. If a challenge isn't completed before expiry, it will be closed with no effect.
Status - the current status of the challenge. Valid statuses are: active, cancelled, activation-pending, closed-pending, closed, expired
Challenge Type -- this is either application or freeform and represents 1 of 2 types of available challenges.
Application Id -- the identifier of the application that the application challenge is associated to. This is only valid obviously, for application challenges.
Moderator Id -- optional for freeform challenge types. if a user id is specified for the moderator, this user will be responsible for determining the outcome of the freeform challenge.
Description -- a textual description of what this challenge is all about.

Challenge Lifecycle

State

Throughout it's lifecycle, a challenge will transition through a number of states that are indicated by the status property of a challenge described above. Again, the set of valid states that a challenge can be in is: active, cancelled, activation-pending, closed-pending, closed, expired. A challenge can only be in a single state at any given time.

Creating a challenge

When a challenge is created it will immediately enter the activation-pending state. In order for the challenge to become active both wagerers must accept the challenge.

Scoring a Challenge

If a challenge is in an active state, it is ready to be scored. This can be done in a number of ways through the SDK. Once scores for both participants have been provided to the betpalz system through the SDK a challenge will either become closed (if scored by a moderator) or will enter a closed-pending state in the case that the challenge is an application challenge or is a freeform challenge that is being manually scored by both wagerers. If the challenge transitions immediately to a closed state, the winner will be rewarded and the challenge will reach the end of its lifecycle. If the challenge moves to a closed-pending state, then both users must accept the results of the challenge before assets are awarded to the winner.

Expiry

In some cases, it may make sense to provide an expiry date for a challenge. Challenges that have an expiry date are constantly monitored by the betpalz system and are set to the expired state if they are not completed before the designated expirty date. Challenges in the expired state have reached the end of their lifecycle and are available only for historical reasons.

Cancelling a challenge

At any point during the challenge lifecycle, the participants of a challenge, i.e. those who are wagering on the outcome, can cancel a challenge. When a challenge is cancelled it is essentially, dead and only exists for historical reasons. Any wagered items or coins that were on hold are immediately freed up and are once again available for creating new wagers or purchasing virtual items.

Virtual Assets

Wagerers can decide what exactly they wish to wager when partaking in the challenge. They have 2 choices. They may either wager a number of coins or a virtual item that they are in possession of. Coins are the virtual currency available to users within the system and virtual items represent virtual chattle owned by a user in the system which can be wagered as well. All virtual items have a value that can be expressed in coins.

Users can decide exactly what they wish to wager giving them the ability to mix and match wagered items. For example, Jack could decide that he wishes to challenge Bill 1 coin in exchange for Bills Sports Car in the event that Jack beats bill in a drinking competition. Bill is so confident in his ability to outdrink Jack that he agrees to the challenge even though the value of his Sports Car virtual item far exceeds 1 coin.

Bringing it all together

Jack and Bill, betpalz users can use the Betpalz Companion Application to create challenges or they can use Justin's tic-tac-toe application to create challenges as long as the tic-tac-toe application is properly using the betpalz SDK. After Jack and Bill are finished playing, they can use the Companion Application to view their asset holdings and have a look at where they stand on the betpalz leaderboard relative to other players. Justin can decide to write as many applications as he wishes that uses the betpalz SDK and will be compensated based on the total coin value flow of challenges through his application.