Inspiration In the modern digital era, most applications hide their logic and potential weaknesses behind beautiful, bloated Graphical User Interfaces (GUIs). We wanted to go back to the roots of hacking and computer science. Our inspiration was the philosophy of Web3 and cryptography — where transparency, mathematical truth, and minimalism triumph over "black-box" systems. We decided to build a game where trust is not required because fairness is mathematically guaranteed. What it does Midnight Web3 Secure Node is a raw, secure, terminal-based Rock-Paper-Scissors game designed for two players on a trusted machine. Instead of relying on a server to hide the players' choices, it uses a cryptographic commit-reveal scheme. It allows players to authenticate securely, play rounds of Rock-Paper-Scissors where cheating is mathematically impossible, and tracks their scores in fully transparent, auditable plaintext databases (.txt files), rejecting the obscurity of traditional SQL/NoSQL databases. How we built it We built the project entirely in Python, deliberately rejecting external graphic libraries to minimize the attack surface and prevent Zero-Day vulnerabilities.
- Authentication & Data: We used standard Python cryptographic libraries to hash passwords before saving them. Data management is handled via clean .txt files (users.txt, ranking.txt) so any user can audit the system.
- Game Engine: The core mechanic relies on the hashlib library to generate SHA-256 hashes for the commit-reveal protocol.
- Distribution: We used PyInstaller (via the .spec file) to compile the Python scripts into a standalone MidnightSecureRPS.exe executable, allowing anyone to run the node without installing a Python environment. Challenges we ran into Our biggest challenge was solving the "who goes first" problem in a local, hot-seat terminal environment. If Player 1 types their move, Player 2 can simply look at the screen and counter it. To solve this without a central server hiding the state, we had to implement a Commit-Reveal Mechanism. Mathematically, Player 1 creates a commitment (C) of their move (m) using a secret salt (s) and a cryptographic hash function (H, in our case SHA-256): C = H(m + s) Player 2 only sees the hash C, giving them zero knowledge about the move. Player 2 then submits their move. Finally, Player 1 reveals their move and salt. The game engine verifies the proof by checking if H(m + s) equals C. If the verification is true, the winner is calculated using the standard rules. Dealing with the edge cases of this input flow in a single CLI was a tricky but rewarding UX challenge. Accomplishments that we're proud of
- Zero-Trust Architecture: We successfully implemented a system where players don't have to trust each other or the visual interface — they only have to trust the SHA-256 algorithm.
- Cinematic CLI: We created a highly immersive, hacker-style terminal interface that feels like operating a secure node in a cyberpunk movie.
- True Transparency: Proving that you don't need a complex tech stack to build a secure, verifiable application. What we learned We learned the practical implementation and UX challenges of cryptographic commitments. We also discovered the beauty of minimal dependencies — by writing raw Python and avoiding heavy frameworks, we realized how much control and security you gain over your own codebase. What's next for Rock-Paper-Scissors Currently, the node operates locally (hot-seat). The next logical step is to introduce a P2P (Peer-to-Peer) networking layer using WebSockets or raw TCP/IP sockets. This will allow two remote nodes to connect directly and play against each other using the exact same commit-reveal protocol, effectively turning it into a decentralized, zero-knowledge game on the internet!
Log in or sign up for Devpost to join the conversation.