Context:

We are using barnett smart card protocol for encryption/decryption/shuffling of cards which is based on Elgamal encryption. And we represent every card as an elliptic curve point M upon a curve defined by some generator G.

more info here: https://geometry.xyz/notebook/mental-poker-in-the-age-of-snarks-part-1

Curve: ecgfp5

https://github.com/pornin/ecgfp5

Staking

Since the cooperation and participation of the player would ensure fair game play. All the players would be required to stake some tokens in the game, Which they can claim back once the game ends. The staking is to make sure no one is acting unfairly, for example, not willing to decrypt the cards and hanging out the game play, etc.

Key generation

Description

Whenever a user registers for the game we will generate a public and private key for the user. In context of Barnett smart card protocol

Private values are

Public key = (g * x_i)

Since the player accounts are local accounts, we will be running the key generation function in the player account itself. For this, the player has to consume his own note for key generation. If self-consumption is not possible, then gamacount should create a note for the key generation note for the player account, which the player account will con sume.

Once the keys are generated, we will save them in some slots of the player account.

Implementation

We will implement a keygen procedure in player account for this.

Workflow