/mental-poker

A library for mental poker (and other card games). Based on the Barnett-Smart protocol and the Bayer-Groth argument of correct shuffle

Primary LanguageRustOtherNOASSERTION

Mental Poker

Introduction

The library implements the mental poker protocol described in Mental Poker Revisited.

The protocol depends on an elliptic curve, without further requirements such as high 2-adicity of its scalar field or being pairing-friendly. This allows it to run in diverse environments, such as L2s and SNARKs.

A series of posts explaining the protocol and our approach to implementing it are available in the Geometry Notebook. Part 1 covers the protocol and primitives from a high level, Part 2 goes into some of the math.

Matchbox collaboration

This library is developed as part of the collaboration between Geometry and Matchbox, and is designated as Geometry - MatchBox Proof 1.

Running the example

An example showing how to encode, hide, shuffle and distribute cards is provided under mental-poker/barnett-smart-card-protocol/examples/round.rs. Run the example by running:

cargo run --example round

License

© 2022 Geometry.

This project is licensed under either of

at your option.

The SPDX license identifier for this project is MIT OR Apache-2.0.