quali.chat is a chat app that extends the decentralised Matrix communication protocol with blockchain-based authentication and token-gated access control based on on-chain balances, enabling secure and permissioned communication across multiple blockchain networks.
- quali-chat-core: Core logic for token-gated access, room management, and bot orchestration.
- quali-chat-synapse-patch: Custom Synapse server configuration and modules.
- quali-chat-web: Web client.
- quali-chat-android: Native iOS client.
- quali-chat-ios: Native Android client.
Installation and configuration of:
- Synapse: Matrix homeserver (element-hq/synapse)
- quali-chat/synapse-homeserver-patch contains configurations, custom modules, and pre-registered bot accounts needed for quali.chat.
- SIWE: Sign in with Ethereum OIDC server (spruceid/siwe-oidc)
- Set
CLIENT_ID
andCLIENT_SECRET
as defined in the homeserver setup, and setREDIRECT_URI
tohttps://MATRIX_HOMESERVER_URL/_synapse/client/oidc/callback
.
- Set
Both SIWE-OIDC and Matrix homeserver require secure (HTTPS) connections. You must use TLS keys to ensure encrypted communication.
Once you have your Matrix homeserver and SIWE OIDC provider running, you can immediately set up and use the quali.chat components. Prerequisites:
- Node.js (latest LTS)
- Docker & Docker Compose
- Alchemy API key (get one)
- Redis (for caching/session management)
In a new terminal, clone and set up the core:
git clone https://github.com/quali-chat/quali-chat-core.git
cd quali-chat-core
npm install
cp .env.example .env
# Edit .env with your API keys and configuration
docker run --name redis -p 6379:6379 -d redis
npm run start
In a new terminal, clone and set up the web client:
git clone https://github.com/quali-chat/quali-chat-web.git
cd quali-chat-web
yarn install
cp config.sample.json config.json # edit the Matrix homeserver URL
yarn start
Setup custom Android and iOS client as per the README.
The following guide helps you set up a local development environment running all components.
-
Clone the official SIWE OIDC provider:
git clone https://github.com/spruceid/siwe-oidc.git cd siwe-oidc
-
Follow the instructions in the README.
-
Install dependencies and configure your
PROJECT_ID
environment variable with your WalletConnect(reown now) project ID. -
Follow the Development section of the spruceid/siwe-oidc README to set up a local development environment.
-
Check environment variables:
CLIENT_ID
,CLIENT_SECRET
,REDIRECT_URI
. -
If using the docker-compose file:
- In
test/docker-compose.yml
, add your Matrix homeserver callback URLs (https://MATRIX_HOMESERVER_URL/_synapse/client/oidc/callback
) toredirect_uris
underSIWEOIDC_DEFAULT_CLIENTS
.
- In
-
Important: Both the OIDC and Matrix servers require secure (HTTPS) connections. You must use TLS keys to ensure encrypted communication.
-
Ensure the OIDC provider is running and accessible.
-
Clone the Synapse patch repository:
git clone https://github.com/quali-chat/synapse-homeserver-patch.git cd synapse-homeserver-patch
-
Create and activate a Python virtual environment:
make venv && . ./env/bin/activate
-
Reset and set up the Matrix server:
make reset
-
Start the server in development mode:
make dev
-
Ensure the Synapse server is running and configured for OIDC.
Refer to the earlier section Setup
- Invalid access token: Clear the
data
directory in quali-chat-core. - Password login disabled: Ensure
password_config
is set toenabled: true
in your Matrix server config. - Redis/Database issues: Ensure Redis is running and accessible.
- SIWE OIDC build errors: Uncomment the
RUN apk add --no-cache python3 make g++
line in the Dockerfile.