This project allows users to find friends on a platform without exposing their contact list.
Instead of uploading raw contacts, the system uses privacy-preserving matching so that:
- Only matches are revealed
- Non-matching contacts remain completely private
Most apps like WhatsApp, Telegram, etc. require users to upload their entire contact list on their platform.
This leads to:
- Privacy leaks
- Centralized data collection
- Risk of misuse
This project implements Private Set Intersection (PSI) logic:
- Contacts are hashed and encoded
- Matching is done on encrypted values
- Only common contacts are returned
In a production setup:
- Contacts are encrypted client-side
- Arcium performs computation using MPC (Multi-Party Computation)
- No party (server or nodes) can see raw data
- Only matches are revealed
Current implementation simulates PSI logic, but backend is designed to integrate Arcium directly.
- Node.js
- Express
- JWT Authentication
- Crypto (SHA256 hashing)
- Solana (devnet ready)
- Arcium (conceptual integration)
arcium_private_contact/ │ ├── src/
│ ├── routes/
│ │ └── contacts.js
│ ├── services/
│ │ ├── hashService.js
│ │ ├── authService.js
│ │ └── arciumClient.js
│ ├── data/
│ │ └── users.js
│ └── index.js │ ├── .env
├── package.json
└── README.md
Follow these steps to run the backend locally.
Update System (Optional)
sudo apt update && sudo apt upgrade -y
1. Install Node.js (if not installed)
Check if Node.js exists:
node -v
If not installed:
sudo apt install nodejs npm -y
2. Clone the Repository:
git clone https://github.com/salauayo/arcium_private_contact.git
cd arcium_private_contact
3. Install Dependencies
npm install
4. Create Environment Variables:
Create a .env file:
nano .env
Paste:
RPC_URL=https://api.devnet.solana.com
ARCIUM_CLUSTER_OFFSET=1
KEYPAIR_PATH=/home/salauayo/.config/solana/id.json
MXE_PROGRAM_ID=placeholder
⚠️(Replace SALAUAYO with your system username)
5. (Optional) Install Solana CLI;
Only needed if you want blockchain interaction:
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
solana --version
6. Start the Backend Server
npm start
You should see:
Server running on port 3000
Testing the API
1. Login:
curl -X POST http://localhost:3000/api/login \
-H "Content-Type: application/json" \
-d '{"username":"alice","password":"password123"}'
2. Find Friends (Private Matching)
curl -X POST http://localhost:3000/api/find-friends \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"contacts":["elon@yahoo.com","friend@gmail.com"]}'
- User logs in
- Sends contact list
- Contacts are hashed + encoded
- System compares encrypted values
- Only matches are returned
- Prevents contact data leaks
- Enables privacy-first onboarding
_ Can be used in:
- Messaging apps
- Social networks
- Fintech platforms
- Full Arcium MPC integration
- Frontend UI
- Wallet-based authentication
- Real encrypted computation
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
export PATH="$HOME/.local/share/solana/install/active_release/bin:$PATH"
solana --version
solana-keygen new
~/.config/solana/id.json
solana config set --url devnet solana airdrop 2
solana balance
RPC_URL=https://api.devnet.solana.com ARCIUM_CLUSTER_OFFSET=1 KEYPAIR_PATH=/home/salauayo/.config/solana/id.json MXE_PROGRAM_ID=placeholder
node testSolana.js
Connected to Solana! Current slot: XXXXX
-
Current implementation uses simulated Private Set Intersection (PSI)
-
Backend structure supports encrypted computation flow
-
In full Arcium setup: contacts are encrypted before submission, MPC nodes compute matches, only matches are revealed
-
Full Arcium MPC integration
-
Frontend UI
-
Wallet-based authentication
-
Real encrypted computation