Project Info
This project did not submit a demo video on Devpost.
Just because relationships are built on trust, doesn't mean matchmaking has to be! 1. Create your personality embedding! 2. Cast your beacon and find your match! 3. Start chatting! Problem: Privacy Matchmaking services that rely on referrals, your friends creating and sharing your profile; Subtle Asian dating, the Aphrodite Project, and more recently, the Resonant have had more successes since they rely on a referral that vouch for your compatibility and social validation to ease the pressure of online dating. However, relying solely on these referrals raises privacy concerns. Value Prop: Escape Big Dating Online dating is dominated by a small number of major companies, often owned by a single corporation. In this environment, users may find themselves trapped in a cycle of perpetual swiping and shallow interactions, leading to frustration and disillusionment with the online dating experience. The overarching goal for these companies becomes maximizing user activity and retention, rather than facilitating meaningful connections or prioritizing user well-being. Solution: Dating x Cryptography x ML LoveBeacon emerges as a beacon of hope in this landscape, offering a fresh approach to online matchmaking that prioritizes user empowerment, security, and genuine connections over short-term metrics like churn rate. By challenging the status quo and placing the interests of its users front and center, LoveBeacon represents a paradigm shift in the world of online dating.
LoveBeacon
https://github.com/curtischong/love-beacon/assets/10677873/5a4e6303-77fc-4385-9e19-8460bdfac9f0
Love Beacon is a MatchMaking app. After filling out your profile, a language model converts it into an embedding. A match occurs if you have a high cosine similarity with others. At no point does your embedding leave your device or is shared with other people.
So how are we able to calculate cosine similarity? Don't the two vectors need to be on the same computer to do the multiply and add operations?
Well... Two Party Computation (2PC) solves this problem! (computing on multiple private inputs)

This is an implementation of Yao's Garbled Circuits (a 2PC protocol). The main code was based on https://github.com/tdjsnelling/garbled-circuits/tree/master. It was very helpful because they figured out how to use Verilog to define the circuits.
However, I modified it for optimization reasons AND to make the 2PC happen between different browser clients (rather than in just one nodeJS process)
Why 2PC?
- Cause the tech is cool
- Note: I don't believe that 2PC is that useful because we can have privacy-preserving computing using a Trusted Execution Environment (TEE). But I did have a REALLY fun time writing and debugging this over TreeHacks.
- I listened to Barry Whitehat's talk on 2PC is for Lovers and have wanted to implement it ever since.
Why a Matchmaking app?
- We were inspired by our friends at Resonant for hosting a matchmaking round last week (during Valentine's!)
- We wanted to pressure ourselves to deploy on mobile so it doesn't take too much compute
- We wanted to deploy this during Treehacks and see people use it! (ran out of time)
Optimizations Used
- 4-bit quantization
- "Chunking" the dot product calculation 10 dimensions at a time. We first calculate the similarity for the first 10 dimensions, then the next 10, etc. until we've calculated similarity for all dimensions of both vectors.
- At the end, we do a sum of these dot product chunks. It DOES leak info (you know the dot product of every 10 dimensions of the embedding), but this makes the circuit much smaller
- Reducing the number of back-and-forth calls during the Oblivious Transfer (there's still room for improvement)
- Using only the first 50 dimensions of the dimension vector (ikik. This loses a lot of info)
- Fast modular exponentiation
Getting Started
In 3 diff terminals, run:
cd webrtc/client_server
python3 -m venv venv
pip install -r requirements.txt
uvicorn api:app --host 0.0.0.0 --port 8000
cd webrtc/user_server
npm i
npm run dev
cd webrtc/websocket_server
npm i
npm start
Now open http://localhost:3000/ in two tabs: one normally and one in Incognito mode
Now fill out "Find Your Match" in both pages
Now click Activate Beacon in both windows.
Finally, click on "Check compatibility with Bob/Alice" on one of the windows
-
This will trigger the 2PC protocol. The person that triggers the protocol is Alice (in the code).
-
Note: I suggest opening the console to see the logs!
Analysis
View
Metric
- 66
- 21
- 9
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- HTMLIn code
- Hugging FaceIn code
- JavaScriptIn code
- Next.jsIn code
- PythonIn code
- PyTorchIn code
- ReactIn code
- Tailwind CSSIn code
- TypeScriptIn code
11 of 11 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
164 KB
Source files
39
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
curtischong/love-beacon
77 files · 7.9 MB · @ 5fbe9af
Structure
Interface
14 files · 18%Screens, components and styles rendered to the user.
Application logic
30 files · 39%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript89%
- JavaScript4%
- Python3%
- Markdown3%
- HTML0%
- CSS0%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
webrtc/client_server/requirements.txt
pypi · 35- annotated-types
- anyio
- certifi
- charset-normalizer
- click
- exceptiongroup
- fastapi
- filelock
- fsspec
- h11
- huggingface-hub
- idna
- Jinja2
- MarkupSafe
- mpmath
- networkx
- numpy
- packaging
- +17 more
webrtc/user_server/package.json
npm · 21- canvas-confetti
- crypto-browserify
- next
- react
- react-dom
- react-icons
- react-spring
- react-use-gesture
- react-use-websocket
- uuid
- ws
- +10 more
webrtc/user_server/2pc/package.json
npm · 11- crypto-browserify
- +10 more
webrtc/websocket_server/package.json
npm · 2- ws
- +1 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.