A P2P Mental Poker Nostr Implementation Possibility

Juice
8 min readApr 3, 2023

This is very simple. Why hasn’t anyone done it before?”

“I don’t know, but I imagine it has to do with the fact that people making social networks are either companies wanting to make money or P2P activists who want to make a thing completely without servers. They both fail to see the specific mix of both worlds that Nostr uses.”~https://github.com/nostr-protocol/nostr

A Brief and Relevant History of Online Poker

The history of online poker involves a battle with state controls over the payment processing. Player to player transfers of money, whether through poker accounts or via chips on poker tables, created money laundering and (non-zero) capital flight issues for states-especially ones that didn’t themselves offer or profit off of such gaming services via taxation.

In 2011 the US government effectively shut down global online poker for the general player pool by charging the top three operators:

United States v. Scheinberg, №1:10-cr-00336 (2011), is a United States federal criminal case against the founders of the three largest online poker companies, PokerStars, Full Tilt Poker and Cereus (Absolute Poker/Ultimatebet), and a handful of their associates,[1] which alleges that the defendants violated the Unlawful Internet Gambling Enforcement Act (UIGEA) and engaged in bank fraud and money laundering to process transfers to and from their customers.[1]~https://en.wikipedia.org/wiki/United_States_v._Scheinberg

The ulimate outcome of this event was a government born monopoly on the global poker economy with the stipulation that Poker Stars would no longer serve the American economy:

On July 31, 2012, US government dismissed “with prejudice” all civil complaints against all PokerStars and Full Tilt Poker companies after coming to a settlement with PokerStars which includes PokerStars purchasing Full Tilt.[10] PokerStars and Full Tilt admitted no wrongdoing as part of the settlement, which ends all litigation between the government and the poker companies.[11]

Bitcoin and crypto-currency based poker sites eventually arose in response to the restricted player pools however any ties to a central gaming provider’s server are subject to the scrutiny of at least the US justice system.

This proposal means to address the EFFECTS of the NATURAL limitations state enforces on centralized gaming services in a way that complies with such limitations.

The Problem to Be Addressed

In regard to alleviating the effects of the natural state driven limitations on poker services it is initially taken as an axiom that trusted third parties are security holes. Centralized gaming services then, regardless of state regulatory oversite, are seen as a security hole from the players perspective. This fact is evidence by the Ultimate Bet scandal in which an employee was using a developer tool for god mode (shown below is their win-rate which allowed the players to mathematically prove behind reasonable doubt that there was certain cheating involved.):

Today on the whole players as market participants observably do NOT distrust centralized gaming services as generally such services are highly regulated. This proposal means to reduce the cost and need for regulation in order to take advantage of the available efficiency difference. This means to replace the centralized operator with a protocol paradigm where superior cost and security efficiency from the player perspective.

The Problem of Mental Poker aka Decentralized Shuffling and Dealing

We can view encryption as a equivalent to placing a padlock on a box containing the card. Bob initially locks all the card in individual undistinguishable boxes with padlocks all of which have key B. Alice selects fives boxes to return to him for his hand, and then send him back five more boxes to which she has also added her own padlock with key A to the clasp ring. Bob removes his padlock from all ten boxes and return to Alice those still lock with her padlock, for her hand, Notice the implicit use of the commutativity in the order in which the padlocks are lock and unlocked. Should either players desire additional cards during the game, the above procedure can be repeated for each card.

At the end of the game both players reveal their secret keys.~Mental Poker Adi Shamir, Ronald L. Rivest And Leonard M. Adleman~

The problem of decentralized secure shuffling and dealing protocols has its own history which has evolved in relation to our mathematical knowledge and our technological advancements. However the remaining problem of implementation, which MUST imply secure shuffling and dealing (because of the TTP principle), has never been properly addressed. The basic problem is that any player, at any point that is convenient for themselves, can refuse to participate fairly with their game validation keys.

Any implementation must address this problem.

The Problem of Jury Pools and the Comparison to Proof of Stake

Since the inception of Bitcoin, which solved the problem of payment processors and jurisdictionally valid choke points on viable mental poker implementations, many projects have arisen with the promise of serving the players goals for cost efficient security. However all such project have either themselves disguised their centralized nature as decentralized, outsourcing solutions to themselves as ‘trusted third parties’ or used a proof of stake type method often hybridized with some form of randomization of such a ‘jury pool’. We see proof of stake as possibly interesting but unproven.

We CAN note however, that any outsourced validation pool must be itself sufficiently Sybil resistant, incentivized to exist and validate, and have incompatible motives with nefarious protocol participants.

Escrow As a Solution to the Cost of Key Compulsion

In specific regard to poker we can pose the problem like this, which the most malicious case a single player might face:

We might assume that the table is full of malicious players except the hero. The worst scenario would be: all players are all-in, hero wins the hand, but 1 malicious player refuses to hand in a key in order to verify the game.
Hero could have potentially won his initial chipstack times the number of other players. The malicious group must not have anything to gain from colluding in this fashion: 1) they must not have any monetary gain 2) The honest player therefore must get back at least what he was supposed to win.~https://thewealthofchips.wordpress.com/2016/04/02/an-escrow-conjecture/

There is a ceiling to the necessary cost/penalty of a nefarious player that might wish to withhold their validation keys from the table. Although the escrow requirement is comparatively unreasonably high from the players’ perspective it is interesting to consider that it is never lost by the honest player and the nature of the escrow is such that its almost never paid out since the nefarious player can never successfully cheat (thus reducing their negative effects to the problem of encumbrance only).

This suggests the expectation provides arbitrage opportunity for 3rd party reputation and insurance services.

The Problem of Bots

Poker is an unsolved but solvable game. Over time strategy has developed along side poker software which today can offer real-time gaming assistance and game play. We see this arising of bots and bot rings in online gaming as inevitable and thus take their existence as an axiom in our design approach:

In the above diagram the economic observation is ‘poker based’ in that the general player pool, now given the ability to create and maintain their own games and lobbies, COULD pay the bot layer to validate their game flow. The observation here is that with private game creation available players could easily verify the validity of the humanness of their players allowed in the private rooms. If bots ARE a problem then they exist in a decentralized equilibrium (ie optimal poker player) and thus can be incentivized to make computation efforts for game validation that they can’t otherwise participate in.

This environment which we call Ideal Poker was as an extrapolation of John Nash’s Ideal Money and is meant without loss of generality.

Nostr as a Validation Layer for Poker Services

The existence of nostr offers the possibility of alignment of incentives between the poker economy and nostr relay’s and here we offer the necessary protocol specifications to facilitate this relationship.

Smart implementation of Smart Contracts

Here we mean to implement the concept of a smart contract as defined by Nick Szabo:

A smart contract is a computerized transaction protocol that executes the terms of a contract. The general objectives of smart contract design are to satisfy common contractual conditions (such as payment terms, liens, confidentiality, and even enforcement), minimize exceptions both malicious and accidental, and minimize the need for trusted intermediaries. Related economic goals include lowering fraud loss, arbitration and enforcement costs, and other transaction costs[1].~https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html

We extend the meaning of ‘smart’ in smart contract to refer to a protocol design which illuminates a contract class which is computationally verifiable.

Protocol Requirements From the Players

In any contested event in a game every previous action in the hand are implicitly cryptographically verifiably previously mutually agreed on. The only events in question are when:

1) a player refuses to hand in their game verification associated private keys

2) a player won’t validate another players action

3) a player tries to force and invalid action.

To secure the game from these problems players needs trustworthy attestation:

1) a player has in fact refused to give their validation keys.

2) a player HAS immutably propagated an action to the other player

As well as:

3) ability to validate and settle game flow and outcomes

Proxy Smart Contracts

a written authorization empowering another person to vote or act for the signer, as at a meeting of stockholders.~https://www.dictionary.com/browse/proxy

The players will create contracts between themselves which are multisig escrows, that involve updated history of agreed upon game PLAY. These contracts need to be pre-registered with pre-agreed upon third party game flow validators.

These contracts will be machine readable and will be cryptographically paired with publicly available game RULES. These pairs will ALWAYS allow computational based verifiability of the game flow in relation to the proxy smart contract escrow.

Any nostr relay’s can facilitate game play but only pre-registered relays can validate and adjudicate proxy smart contracts. Ironically the former will be quite useful and the latter almost never used (there is a parallel to a bitcoin lightning transaction here).

Principles

This proposal is based on the following principles:

Sufficient decentralization is sufficient.

The protocol and implementation are meant to serve the players by fostering a legal and open poker services market.

Translating iterated human agreements into a computationally verifiable form as a means for convenience for validators rather than as a means for trustless validation.

Relying on the pre-existence and orthogonal motives of the nostr network as a reasonable trustworthy third party.

The separation of duties as a means to unlimited and fair game services.

This protocol cannot be done by either companies wanting to make money or P2P activists who want to make a thing completely without servers.

Loose Goal

To establish a game protocol that fosters a free and competitive environment for offering and playing poker without loss of generality to as many other types of games as possible. This in exchange for a cost that would ultimately be a reduction in rake fee rates currently paid by players to centralized state regulated services.

Mental poker and god protocols

This proposal is an implementation of what Nick Szabo called God Protocols.

Benefits and Other Possible Features

Based on the observation that all poker service offerings effectively need the same base layer solutions this protocol implementation reduces the need for distinct private based poker engines. This creates a dramatic and harnessable efficiency which can be shared between the players and the Nostr network.

If the poker industry migrated to the Nostr network there would be other useful protocol features similar to profile features that already exist but also specific to poker.

--

--