From concept to reality in two weeks: Our final #BuildOnWax challenge entry.

pink.network
Jul 30 · 4 min read

A little over 15 days ago, we at pink.network announced entering the #BuildOnWax challenge hosted by WAX io. We set out to build a fully decentralized bankroll contract on the WAX blockchain, as well as an easy to use, public API to make it easier for developers all around the world to build their gambling apps. You can learn more here.

Now that the challenge is coming to an end, we want to take a moment to look at what we achieved.

Smart Contracts

The bankroll contract deployed on the blockchain is the very core of our system. It is where the bets are placed and resolved, and it is where anyone can invest. To make it work, we also created a RNG oracle contract that provides the bankroll contract with provably fair random numbers. This however is only temporary, as we will switch to using the official WAX RNG oracle as soon as it becomes available. On top of those contracts, we also built what we call the gambling contract. It allows for a smoother experience for both developers and players.

You can learn more about how the contract work in the article we recently published, “A technical look at the pink.network smart contracts”.

All of our contracts are fully deployed on the WAX mainnet, and are 100% functional. They also are completely open source and available on our Github.

Public API

Interacting with any blockchain directly can be a challenge. We wanted to enable developers to spend less time figuring out the quirks of the eosio protocol, and more time building awesome applications. That’s why we built a publicly available API that acts as a gateway to the WAX blockchain. In fact, it allows devs to built fully functional frontend-only sites, receiving all relevant information from our REST and websocket endpoints. Even having chat rooms that users can log in to with their WAX blockchain accounts is possible.

You can check out the API documentation at pink.network/documentation.

NPM module

Especially for websites, javascript is often the language of choice to implement the non-static functionality. With our npm module pinknetworkjs, using the API becomes even simpler. Examples are already provided, and allow you to get going within minutes. This combines the security and fairness of the blockchain, with the usability of a simple javascript module.

An example site

We wanted to showcase what our API was able to do. That’s why we built and launched betpink.gg, a gambling site without any backend of its own, relying only on the pinknetworkjs npm module and the underlying REST/ websocket API to provide the interactivity.

The wheel spins utilize the gambling contract’s cycle functionality, which automatically creates a new result every 40 seconds. During that time, players can bet on any of the 4 different outcomes, which all have different multipliers and odds. The page also shows a history of the last outcomes, as well as a leaderboard for the biggest bettors. And on top of that, a chat window is available for the players to communicate.

To reiterate: All of this is done utilizing only the public API, and without any backend of its own. Any developer that has previously worked with a blockchain running the eosio protocol (like WAX does) will understand how much time and effort this saves.

At the time of publishing this article, the 4,000 WAX launch promotion on betpink.gg is still going on and available for anyone to enter. If you want to learn more about that and also about the site itself, make sure to read our article “betpink.gg — The first gambling app built fully on the pink.network bankroll”.


What’s next for pink.network?

The #BuildOnWax challenge is coming to an end, but we’re not nearly done yet. In the near future, we will continue to improve the quality of the available resources on our bankroll project and provide real world examples of how to implement our API. We are also working with an independent auditor to review the bankroll smart contract, to ensure maximum security for both players and investors.

We already have new projects in the back of our minds that we are extremely excited to start working on soon. The future is looking bright for the WAX ecosystem, and we want to take an active role in shaping it!

If you share our vision and want to keep up to date with what we’re working on, follow us on Twitter @pinknetworkx.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade