Replies: 2 comments
-
Thanks @nlok5923 ! For more context: On a M3 Pro (18gb RAM) calling the However, this is definitively worse UX than player online poker on PokerStars. Potential alternative: Encrypting outside the VMAn alternative approach could be not to encrypt or decrypt inside the VM. In theory, this can happen outside the VM. Shuffling:
Dealing:
Betting:
Revealing:
Potential Attack Vector:
Potential alternative: Using precompiles / chiptlesWe could try to speed up el gamal or any other scheme by building a specialized chiplet for the Miden VM. https://0xpolygonmiden.github.io/miden-vm/design/chiplets/main.html . This might take longer than the 4 weeks we have, but if you wanna give it a try. |
Beta Was this translation helpful? Give feedback.
-
An alternative to solve the problem with expensive encryption is to work with a mock encryption scheme. The ElGamal scheme requires a cyclic group (usually of prime order in order to avoid some attacks). What we can do is use the multiplicative sub-group of the field as our cyclic group. This way all operations become just an exponentiation or a multiplication in our base field. |
Beta Was this translation helpful? Give feedback.
-
Hey Team!
At RizeLabs we have been designing the encryption architecture for Aze Poker which we are building on top of Polygon Miden. We are implementing
barnett smart protocol
for fair gameplay by enabling every player to fairly participate in maintaining privacy of the Poker Cards.In barnett smart protocol the encryption function is defined as
M: Is the point on curve (in case of miden
ecgFp5
curve) (We are maintaing a public one to one mappingf(C) -> M
where C is plaintext card and M is point on curve)r: Is the masking factor private to player
G: Generator point (generate point of
ecgFp5
in case of Miden VM)H: aggregated public key
The encryption requires mainly
Further, the protocol defines an operation remasking (to remask the card before shuffling) to make sure player can't maintain mapping of cards and deduce the original order
The remasking function is defined as
The remasking function requires
As, per the game design we are planning to implement procedures
encrypt_and_shuffle
andremask_and_shuffle
in player accounts. To enable players to encrypt/remask and shuffle the cards.But since the deck contains a total of 52 cards and encrypting/remasking cards would require a total atleast 104 scalar multiplication and atleast 104 additions. Which should be done at each player.
This much amount of computation on user device could affect the UX quite a bit.
Is there any possibility of having some sort precompiles in miden vm so that we can limit the cycle count and make these as native vm operations ?
More details around encryption design is available here
Barnet smart protocol (Mental poker)
cc @Dominik1999 @gubloon
Beta Was this translation helpful? Give feedback.
All reactions