Hi, I’m looking into generating a shuffled deck of cards onchain for use in trustless, provably fair multiplayer card games. This is currently possible on Zama but is extremely gas expensive. I’m looking for ways to reduce gas costs. Has the team Zama team previously looked into this problem or anything similar?
1 Like
Hello!
Good question
I experimented with bit permutation using delta swaps in the past, but as you pointed out, it’s not very effective.
The tfhe-rs library will include new features for randomness, including the ability to generate randomness within a fixed range. I’m not sure how it would be implemented, but it could help with dealing cards.
2 Likes
Thanks for the reply. I think I have a workable solution. It meets HCU requirements and while expensive in terms of gas, it should be fine on cheaper EVMs. I have some follow up questions, I sent you a message on X. Please take a look.
1 Like