Building a Secure, CSP-Compliant Web Casino with Hive Keychain and PEK

Tonight, we made major strides in the development of PeakeCoin’sino, a decentralized, static-hostable web casino powered by Hive Keychain and the PEK token. Here’s a recap of what we accomplished and why it matters for both users and developers.
1. Secure Login and Balance Checks
We started by ensuring that all users log in via Hive Keychain, the most secure and user-friendly way to interact with the Hive blockchain. The main lobby (index.html
) now features a clean login form that only allows access to the games after a successful Keychain signature.
Once logged in, the user’s PEK balance is fetched live from Hive Engine and displayed, ensuring transparency and trust.
2. Modular Game Navigation
To keep the experience smooth and scalable, we refactored the casino to use multi-page navigation. Each game (like Teen Patti, Blackjack, Poker, etc.) now lives in its own directory with its own index.html
and logic files.
This makes it easy to add, update, or maintain games without affecting the rest of the platform.
3. Standardized, Trustless Betting
A key focus was to standardize how bets are placed across all games. We created a single betting_logic.js
file that handles all PEK transfers via Hive Keychain.
- Every bet is trustless, on-chain, and consistent—no matter which game you play.
- Custom or ad-hoc bet logic has been replaced with one unified system.
4. Automated, Auditable Payouts
On the backend, we built a payout processor (peakecoin_payout.py
) using Flask and the hive-nectar
library.
- When a player wins, the front end enqueues a payout request via API.
- The backend bot sends PEK payouts securely, logging any failed attempts for retry.
This means the front end never handles sensitive keys—and all payouts are transparent and auditable.
5. Security and Maintainability
We followed best practices throughout:
- Sensitive operations (betting and payouts) are handled by Hive Keychain or the backend—never exposed in-browser.
- Logic is standardized and modular, easing future game development.
- The UI is clean, modern, and CSP-compliant, ready for static hosting.
6. Next Steps
With the foundation in place, our next development goals are:
- UI/UX improvements
- Optional bet logging for provable fairness
- More games and community features
In Summary
PeakeCoin’sino is now a secure, modular, and trustless web casino, ready for players and developers alike.
- All gameplay is on-chain
- All bets use Hive Keychain
- All payouts are automated and auditable
This is what decentralized gaming should look like.
Not sure if this is appropriate in this community.
It's a game for Hive on Hive Blockchain
Casino's aren't games.
Card games aren't games?
Isn't that what this group is?