BIP-777 (GPR) The Great Poker Restoration: Add the poker client back to bitcoin #32181

pull stutxo wants to merge 2 commits into bitcoin:master from stutxo:master changing 11 files +888 βˆ’0
  1. stutxo commented at 6:13 am on April 1, 2025: none

    This introduces a local poker client that allows you to play poker against your own node!

    Satoshi envisioned bitcoin as peer-to-peer digital cash but he also added the only other known use case for cryptocurrency in bitcoin’s original implementation: gambling.

    This remains the sole significant innovation across all other cryptocurrency projects. Therefore, I believe it’s time to reconnect this concept with bitcoin and initiate The Great Poker Restoration.

    Original bitcoin poker code can be found here:

    Next steps

    • Add multiplayer lobbies
    • Add OP_SECURETHEPOT
  2. BIP-777 add local poker client to begin the great poker restoration d4a6c4065a
  3. DrahtBot commented at 6:13 am on April 1, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32181.

    Reviews

    See the guideline for information on the review process.

    If your review is incorrectly listed, please react with πŸ‘Ž to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #31664 (Fees: add Fee rate Forecaster Manager by ismaelsadeeq)
    • #29415 (Broadcast own transactions only via short-lived Tor or I2P connections by vasild)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  4. laanwj added the label Feature on Apr 1, 2025
  5. DrahtBot added the label CI failed on Apr 1, 2025
  6. DrahtBot commented at 7:16 am on April 1, 2025: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/39748147405

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  7. fanquake marked this as a draft on Apr 1, 2025
  8. hebasto commented at 8:18 am on April 1, 2025: member
    Where is the best place to learn poker?
  9. l0rinc commented at 10:01 am on April 1, 2025: contributor
  10. Sjors commented at 10:49 am on April 1, 2025: member
    I think we should prioritise Cashu integration, cc @callebtc IMG_8889
  11. sipa commented at 10:53 am on April 1, 2025: member
    If the goal is gambling, I see no better way than reintroducing the CPU mining feature in Bitcoin Core.
  12. instagibbs commented at 10:54 am on April 1, 2025: member
    lack of QT support kills it
  13. polespinasa commented at 11:14 am on April 1, 2025: contributor

    lack of QT support kills it @jarolrod maybe we can do something for the new GUI…

  14. jarolrod commented at 11:30 am on April 1, 2025: member
    @polespinasa maybe. But, only if there’s consensus to do an nft for each card.
  15. 1440000bytes commented at 12:35 pm on April 1, 2025: none

    I think we should prioritise Cashu integration, cc @callebtc IMG_8889

    It can be done along with poker. Degens would like the idea of losing money even if they win a poker round.

    We will need whitepaper version 2 that supports trusted third parties.

    20250401_180148

    Mints: https://rugmedaddy.info

  16. Prabhat1308 commented at 12:48 pm on April 1, 2025: contributor
    Concept ACK 😈
  17. ajtowns commented at 1:22 pm on April 1, 2025: contributor

    I believe this provides a single player texas-holdem style poker game, with an RPC interface, and rng based on block hash and the user’s wallet, against an AI player who never folds. I don’t think any funds are put at risk.

    There are no new consensus features, and there’s no p2p protocol added; so I don’t think there’s any cross-implementation compatibility to worry about, so a BIP makes sense here, let alone one with a self-assigned number.

    (People interested in the topic might find https://bramcohen.com/p/the-chia-gaming-platform interesting)

  18. Rob1Ham commented at 1:32 pm on April 1, 2025: none
    Concept ACK - lets get it passing CI and then LGTM!
  19. luisschwab commented at 1:37 pm on April 1, 2025: contributor
    tACK, multiplayer support would be huge!
  20. delta1 commented at 1:37 pm on April 1, 2025: none
    Concept ACK I lolled
  21. jlopp commented at 1:51 pm on April 1, 2025: contributor

    Concept ACK; the market demand for this will be huge.

    Crypto casinos have proven product market fit; if we can bring the casino to Bitcoin then we’ll be able to subsume much of the demand for altcoins.

  22. pinheadmz commented at 1:58 pm on April 1, 2025: member

    tested ACK

     0--> bccli -regtest poker play
     1[Poker]
     2[Block: 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206]
     3
     4Your Hand: Two Pair, Js and 7s (Kicker: T)
     5β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     6β”‚ 9       β”‚β”‚ 10      β”‚
     7β”‚         β”‚β”‚         β”‚
     8β”‚    β™     β”‚β”‚    β™     β”‚
     9β”‚         β”‚β”‚         β”‚
    10β”‚       9 β”‚β”‚      10 β”‚
    11β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    12The Showdown: Satoshi wins! Wait for the next block to play again.
    13β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    14β”‚ J       β”‚β”‚ 7       β”‚β”‚ J       β”‚β”‚ 7       β”‚β”‚ 2       β”‚
    15β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚
    16β”‚    β™₯    β”‚β”‚    ♦    β”‚β”‚    ♦    β”‚β”‚    β™     β”‚β”‚    ♦    β”‚
    17β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚
    18β”‚       J β”‚β”‚       7 β”‚β”‚       J β”‚β”‚       7 β”‚β”‚       2 β”‚
    19β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    20Satoshi's Hand: Two Pair, Js and 7s (Kicker: Q)
    21β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    22β”‚ Q       β”‚β”‚ 6       β”‚
    23β”‚         β”‚β”‚         β”‚
    24β”‚    ♦    β”‚β”‚    β™₯    β”‚
    25β”‚         β”‚β”‚         β”‚
    26β”‚       Q β”‚β”‚       6 β”‚
    27β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
  23. in src/rpc/poker_rpc.cpp:70 in d4a6c4065a outdated
    65+
    66+static UniValue handlePlay(NodeContext &node) {
    67+    auto& poker_worker = node.poker_worker;
    68+
    69+    if (poker_worker->gameState.gameHash == uint256::ZERO) {
    70+        throw JSONRPCError(RPC_MISC_ERROR, "Load a wallet to play!");
    


    pinheadmz commented at 1:59 pm on April 1, 2025:
    Why? there’s no betting

    stutxo commented at 2:57 pm on April 1, 2025:
    We use a bitcoin address plus the current block hash for the rng to shuffle the deck!

    stutxo commented at 3:20 pm on April 1, 2025:
    does look a bit sus tho
  24. jaonoctus commented at 2:03 pm on April 1, 2025: none

    Concept All-inCK

    17435166053146023141750574334791

  25. cbspears commented at 2:10 pm on April 1, 2025: none
    LGTM!
  26. glozow added the label Good First Review on Apr 1, 2025
  27. glozow added the label good first issue on Apr 1, 2025
  28. furszy commented at 2:21 pm on April 1, 2025: member
    Cannot take it seriously, lint job fails.
  29. mattmcegg commented at 2:23 pm on April 1, 2025: none
    lets see a flop!
  30. rsafier commented at 2:29 pm on April 1, 2025: none

    Tested MacOS 15.4 M4:

     0./build/bin/bitcoin-cli -regtest poker play
     1[Poker]
     2[Block: 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206]
     3
     4Your Hand: One Pair, 6s (Kickers: A, 9, 7)
     5β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     6β”‚ 9       β”‚β”‚ 4       β”‚
     7β”‚         β”‚β”‚         β”‚
     8β”‚    ♦    β”‚β”‚    β™₯    β”‚
     9β”‚         β”‚β”‚         β”‚
    10β”‚       9 β”‚β”‚       4 β”‚
    11β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    12The Showdown: Satoshi wins! Wait for the next block to play again.
    13β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    14β”‚ 6       β”‚β”‚ 6       β”‚β”‚ A       β”‚β”‚ 3       β”‚β”‚ 7       β”‚
    15β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚
    16β”‚    β™₯    β”‚β”‚    ♦    β”‚β”‚    β™₯    β”‚β”‚    β™     β”‚β”‚    β™₯    β”‚
    17β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚β”‚         β”‚
    18β”‚       6 β”‚β”‚       6 β”‚β”‚       A β”‚β”‚       3 β”‚β”‚       7 β”‚
    19β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    20Satoshi's Hand: One Pair, 6s (Kickers: A, K, 7)
    21β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    22β”‚ 4       β”‚β”‚ K       β”‚
    23β”‚         β”‚β”‚         β”‚
    24β”‚    β™     β”‚β”‚    β™₯    β”‚
    25β”‚         β”‚β”‚         β”‚
    26β”‚       4 β”‚β”‚       K β”‚
    27β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    
  31. arejula27 commented at 2:41 pm on April 1, 2025: none
    Concept ACK What about adding Balatro support, it’s time to explore fresher, more engaging gameplay that aligns with modern player expectations.
  32. sr-gi commented at 2:42 pm on April 1, 2025: member
    Approach NACK, I lost two hands :cryinghard:
  33. glozow removed the label good first issue on Apr 1, 2025
  34. glozow removed the label Good First Review on Apr 1, 2025
  35. sipa commented at 2:58 pm on April 1, 2025: member

    lack of QT support kills it @instagibbs The TUI introduced here seems awesome though. Could we have a TUI-over-RPC-over-HTTP-over-UNIXsockets for everything?

  36. stutxo commented at 3:15 pm on April 1, 2025: none

    Approach NACK, I lost two hands :cryinghard:

    skill issue

  37. sr-gi commented at 4:26 pm on April 1, 2025: member

    Approach NACK, I lost two hands :cryinghard:

    skill issue

    I’m pretty sure the game is rigged

  38. allenpiscitello commented at 4:36 pm on April 1, 2025: none
    Concept ACK
  39. add an extra line to make it 888 a2b00e009b
  40. ecurrencyhodler commented at 8:59 pm on April 1, 2025: none

    This aligns with satoshi’s original vision for coupling an app with a bitcoin implementation. Concept ACK.

    https://sourceforge.net/p/bitcoin/code/1/tree//trunk/uibase.cpp

  41. TheMhv commented at 10:24 pm on April 1, 2025: none
    Concept ACK
  42. fanquake commented at 5:21 am on April 2, 2025: member
    Good stuff.
  43. fanquake closed this on Apr 2, 2025

  44. GaloisField2718 commented at 1:12 pm on April 2, 2025: none
    Lol good April fool!

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-04-16 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me