https://github.com/antonis19/peer-flip
Flip a coin with your friends without the need for a trusted third party.
https://github.com/antonis19/peer-flip
coin flip p2p
Last synced: about 1 month ago
JSON representation
Flip a coin with your friends without the need for a trusted third party.
- Host: GitHub
- URL: https://github.com/antonis19/peer-flip
- Owner: antonis19
- Created: 2023-05-27T13:18:14.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-18T18:18:49.000Z (about 2 years ago)
- Last Synced: 2025-03-29T18:35:01.371Z (6 months ago)
- Topics: coin, flip, p2p
- Language: TypeScript
- Homepage: https://peerflip.io
- Size: 1.1 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PeerFlip
### PeerFlip protocol
PeerFlip is a decentralized method to simulate a coin toss among \(N\) participants. Except for the room server which participants use to join the same room and the STUN server that is needed for the participants to establish the initial P2P connections to each other, the protocol does not rely on any centralized party to calculate the coin flip outcome.
### How to run
To run the frontend :
```bash
cd peer-flip-frontend
npm install
npm start
```If you want to run the backend locally (for room management) :
Set `REACT_APP_SERVER_URL` to `'wss://localhost:9090'` in the `.env` file inside `peer-flip-frontend` .
Then run:
```bash
cd peer-flip-backend
npm install
npx tsc *.ts
node server.js
```
### [Read how it works](./docs/how-it-works.md)