Poker on Blockchain — Making the Impossible Possible.

Cais Manai
Obscuro Labs
Published in
9 min readJust now

Disclaimer: This article is intended for academic and informational purposes only. Poker on blockchain is a complex example of what was considered impossible in Web3.

This gets asked all the time

This is just one of many X posts beginning with “Why TF hasn’t anyone built Poker in Web3?” The honest answer is that it was impossible—until now.

In this post, we’ll discuss the intricacies of building Poker on-chain, highlight the challenges, and discuss how innovative solutions can solve them.

The use of bots in online Poker tables is a huge problem.

The rise of blockchain technology has paved the way for a new era of decentralized applications, and the gaming industry is no exception. One of the most intriguing applications of this technology is the development of a fully on-chain, decentralized Poker game. In this new paradigm, the game is transparent, secure, and open to anyone who wishes to participate, free from the constraints of censorship.

But first, Why Poker Makes Sense on a Blockchain

It's simple — it comes down to trust, cost and access. Anyone who’s played Poker online will tell you that despite all the promises, it’s difficult to be 100% certain that you’re not being gamed somewhere behind the scenes — this is the trust problem.

Ultimately, even if the venue is 100% legit, it is incredibly costly for them to prove and convince you of that fact. This is typically done through marketing, certificates, audits, etc. This leads to an incredibly high customer acquisition cost, which has to be recouped somewhere—this is the cost problem.

I spent some time travelling in Japan and found the whole Pachinko scene fascinating. For the uninitiated, Pachinko is a game that blends skill and chance, much like a vertical pinball machine. You launch small steel balls into the machine, hoping they land in specific pockets to trigger a payout.

Now, here’s the clever part:

  1. Players accumulate Pachinko balls while playing the machines.
  2. Instead of directly winning money, players exchange their balls for tokens or physical prizes at the Pachinko parlour.
  3. To convert these prizes into cash, players take them to a nearby shop or establishment, often located next door or within close proximity, which buys them for cash.

This multi-step process cleverly circumvents Japan’s strict gambling laws, which prohibit direct cash payouts from gambling activities.

Image showing a Pachinko hall in Japan busy with players
The big business of Japan’s pachinko parlours. Source: https://www.bbc.com/travel/article/20120815-the-big-business-of-japans-pachinko-parlours

So firstly, let’s be honest: everyone knows what’s happening, but a blind eye is turned; that way, those who wish to gamble can do so while the government can still be seen as conservative. This isn’t unique to Japan; there are 10s of millions of players out there in the same boat who wish to gamble but can’t, and not every country has Pachinko parlours.

Secondly, even if you can access gambling services, they will almost certainly require you to KYC or have access to private banking services, which not everyone can do or has. This is a large part of Polymarket’s appeal.

Together — This is the access problem.

Blockchain Pocker solves the trust, cost and access problems. However, it has its challenges.

The Challenges of on-chain Poker

I began this post by stating that nobody has built Poker on blockchain yet with the reason being it was impossible due to unsolved challenges. So let’s talk about some of these challenges.

Challenge one— Encryption

Traditional Poker revolves around players seated around a table, each holding a pair of hidden cards. As the game progresses, several community cards are dealt face-up on the table. The objective is to create the best five-card hand by combining your hidden cards with the community cards. The player with the strongest hand, blending their private cards with those on the table, emerges victorious.

The adjective here is ‘private’. Building anything on-chain today necessarily means building everything out in the open and fully transparent, so the idea of private cards for players is a no-go.

But what if you could build on-chain so that players could keep their hands private? Well, then, the problem would be how to ensure the game remains transparent and fair.

Challenge two — Randomness

Ensuring randomness in card distribution without a trusted third party poses a significant challenge, as it is crucial to prevent cheating or manipulation. To add complexity, any random number must be hidden and known only to the smart contract until the game has successfully concluded, returning to the encryption challenge.

Challenge three— Performance and UX

Without decent performance, the returns of playing on-chain are quickly diminished. Performance isn’t just limited to the speed of each hand but also how quickly a game can be set up, payouts concluded, and—the big one—not having to sign over every action.

Challenge four— Collusion

Collusion, where two or more players share information about their hands to outplay others, undermines the integrity of the game. Detecting collusion in a decentralized setup is challenging because the interactions are dispersed across the network, and no single entity monitors player actions.

Botting, or the use of automated programs to play the game, poses another significant threat. Bots can be programmed to play optimally, exploiting weaknesses in human players and gaining an unfair edge. Identifying and blocking these bots in a decentralised system is complex due to the lack of a central control mechanism.

How centralized systems overcome these challenges

Some of the challenges in centralized online poker platforms are less challenging because, like all of Web2, they have encryption (or privacy) baked into the application by default.

Challenge oneencryption — Solved by simply encrypting server traffic to and from players while processing is all handled centrally in private. However, it’s imperfect, as you must trust the gaming platform.

Challenge two—randomness—Centralized platforms go to great lengths to ensure randomness in their systems. I’ve seen solutions ranging from leveraging radioactive decay to cosmic rays to the most widely used method, hardware RNG, using TEEs. Once captured, it’s easy to use within games without revealing anything.

Challenge three—performance and UX—Centralized systems have been tuned for years, employing various scaling and performance optimizations. Trust between the local client and server is leveraged to remove the need to confirm every action with an explicit wallet-generated signature.

Challenge four — Collusion — Things get interesting here where several measures are employed to mitigate the risks of collusion and botting:

  1. Behavioral Monitoring: Centralized platforms use sophisticated algorithms to analyze player behavior and detect patterns indicative of collusion or botting. They can identify suspicious activities by monitoring betting patterns, timing, and game outcomes.
  2. IP Tracking and Geolocation: To prevent collusion, centralized systems track players' IP addresses and geolocations. If multiple accounts are detected playing from the same location or showing coordinated behavior, the system can flag these accounts for further investigation.
  3. User Verification: Centralized platforms often require detailed user verification processes, including identity checks and multi-factor authentication. This helps ensure that each account is tied to a real individual, making it more difficult for malicious actors to create multiple accounts for collusion.
  4. Bot Detection Algorithms: Advanced machine learning algorithms are deployed to identify bot-like behavior. These algorithms analyze reaction times, betting consistency, and decision-making processes to differentiate between human players and automated bots.
  5. Manual Reviews and Audits: Centralized platforms employ dedicated teams to review flagged accounts and suspicious activities manually. These teams can conduct in-depth investigations and apply sanctions, such as account suspension or banning, to maintain the integrity of the game.

In theory, these measures collectively help centralized Poker platforms maintain a fair and secure gaming environment. However, we can’t confirm that any of this is happening outside of trust in the system and the service provider's reputation.

Nonetheless, replicating all of these in a decentralized, fully on-chain Poker game requires innovative solutions that can address the inherent challenges of the blockchain ecosystem.

Enter TEE-based Web3 technology

Trusted Execution Environments (TEEs) provide a robust solution to the challenges of building a fully on-chain, decentralized Poker game. a

Challenge One — Encryption

Blockchains such as TEN, which employ TEEs, are encrypted by default, providing a similar environment to Web2 counterparts. Any smart contract can have ‘secrets’ and programmatically reveal data to the relevant party. In the case of Poker, this allows a developer to easily add code to reveal a player's cards only to the appropriate player.

And it doesn’t stop there. The real mindblowing thing is that TEE-based systems not only carry computations in private but also do so with absolute guarantees over what is happening. You don’t have to trust the service provider. As long as the algorithms are published, you can be certain that within the TEE, the code runs exactly as published. This removes the problem of encryption and reduces the cost problem mentioned earlier, as the cost of customer acquisition greatly falls when there is complete trust.

Challenge Two — Randomness

TEE-based systems can leverage the same Secure Hardware that centralized systems leverage, except in a decentralized way. This is already available in many of the Web3 oracles available today. However, things get complex when the random numbers must be kept private for some duration. Here, a blockchain system built on a TEE architecture, such that random numbers can be generated on-chain while remaining encrypted, is key. TEN does this.

Challenge Three — Performance and UX

TEEs add a very small performance hit when compared to other encryption (or privacy) technologies, allowing them to scale to the levels of the fastest blockchains. Finality becomes immediate when combined with an L2 architecture, and full access to the EVM allows for solutions like Account Abstraction, which can be employed to remove the need for signing over each action.

Challenge Four — Collusion

It is no surprise that, just like their Web2 counterparts, this is the most challenging. Here, I will reveal some of the TEN roadmap and how it can uniquely solve one of the biggest challenges in Web3.

As a starting point, everyone in Web3 is ‘anonymous’. I add that in quotes. We’re all pseudo-anonymous to certain degrees, depending on our chain history and entry points into the ecosystem.

Now, this doesn’t lend itself well to preventing collusion — If you don’t know who anyone is, how do you ever separate the player-controlled bots from the actual players or even real players colluding with other real players?

We can’t insist on Web3 as this would negate some of the earlier ideas discussed and would be at odds with the ethos and origins of blockchain technology.

Introducing the Confidential Proof of Humanity Service

One of the key innovations that TEEs on TEN enable is the Confidential Proof of Humanity (CoH) service, which can significantly mitigate the risks of collusion and botting.

  • Anonymous Verification: The CoH service leverages TEEs to verify that each player is a real human without revealing their identity. This involves securely validating user credentials through KYC processes and issuing anonymous attestations that allow players to join the game. Through transparent computation over encrypted data, the system guarantees that all uploaded documents are immediately deleted after verification.
  • Soulbound NFT: Players are issued a confidential Soulbound NFT after completing the KYC process. This NFT serves as proof that the player has passed the verification process. The NFT is non-transferable, ensuring only verified individuals can use it.
  • Geographical Filtering: The confidential Soulbound NFT can include metadata about the player’s country or city. This information can be used to restrict players from the same location from joining the same table, reducing the likelihood of collusion.

By integrating a Confidential Proof of Humanity service, the Ten blockchain can ensure that only genuine, verified players participate in the Poker game. This approach not only prevents bots and collusion but also maintains player privacy and trust, showcasing the potential of TEEs in creating secure, decentralized gaming environments.

And it doesn’t stop there:

  • Reputation System and Renewal: Players accumulate a reputation score over time based on their gameplay. Periodically, they must renew their Soulbound NFT. At this point, AI analysis can be conducted to assess their behaviour. Again, all through confidential computing provided by TEEs, the system can flag suspicious activities without exposing individual player data, thus preserving privacy while enhancing security. The player may be banned from receiving a new NFT if cheating is suspected.
  • Randomized and Anonymous Tables: Players can be assigned to tables randomly and anonymously, making it difficult for colluding parties to coordinate their actions. Each game session can generate a new, temporary player identifier, further obscuring their identities and mingling random start times for each player. This approach helps to ensure that players do not know who they are playing against, reducing the chances of pre-arranged collusion.

By stacking these solutions, TEN can effectively address the challenges of building a decentralized Poker game. This multi-faceted approach ensures a secure, private, and fair gaming environment, showcasing the potential of TEEs in creating innovative, decentralized applications.

The vision for TEN is ambitious. By encrypting Ethereum, TEN massively opens up the Web3 design space. Applications thought impossible are becoming possible by addressing trust, cost, and access issues and overcoming encryption, randomness, performance, and collusion challenges through innovative use of Trusted Execution Environments. Potentially, the future of all online games and more lies in this transformative technology.

Find out more

By checking out the TEN developer docs, joining the Discord or Telegram communities and following TEN on Twitter.

--

--

Cais Manai
Obscuro Labs

Hi, I’m Cais. You’ll find me writing on blockchain topics. By day, I’m a Product Manager for Ten.