Mental card games allow players to engage in peer-to-peer (P2P) gameplay without relying on a Trusted Third Party. These protocols require strict state consensus between players to prevent cheating and ensure game integrity. However, establishing this consensus over optical channels — specifically via Quick Response (QR) code sequences — presents significant challenges due to the lossy and unidirectional nature of the transmission medium. Packet loss due to focus, lighting, or scanning errors can sever synchronization, while the lack of a backchannel prevents standard re- transmission requests. To address this, this thesis proposes and implements a robust communication protocol utilizing Network Coding. By introducing redundancy through coefficients of linear combinations of packets, the receiver can reconstruct the game state even in the presence of frame loss, eliminating the need for bidirectional acknowledgement. The protocol is implemented in Rust to ensure memory safety and high performance on resource-constrained devices. Evaluation results demonstrate that while the Network Coding approach successfully ensures data integrity and synchronization, the overall system throughput is ultimately bottlenecked by the latency of the optical scanning and QR decoding process rather than the transmission protocol itself.
Jan Christian Cichosz (Tue,) studied this question.