This repository hosts the Oracle responsible for validating Solana <-> Qubic bridge transactions.
This project is open source and maintained by Avicenne as part of the Qubic incubation program.
CONTRIBUTING.mddescribes the contribution process and requirements.SECURITY.mdexplains how to report vulnerabilities.AGENT.mdcontains the Oracle architecture notes and Solana client reference for AI agents.
Using Docker is the default way to run the Oracle.
If you prefer running it directly on your machine (optional), you need:
- Node.js 24+
Copy .env.example to .env:
cp .env.example .envSet SQLITE_DB_FILE to the database path.
- Docker (default):
/data/oracle.sqlite3(stored in a persistent Docker volume) - Local Node.js (optional):
./data/oracle.sqlite3inside the repository
The Oracle creates the SQLite database automatically on first launch.
Oracles only trust Hub-signed requests using pinned Ed25519 public keys stored on disk (HUB_KEYS_FILE).
The Hub exposes GET /api/keys for operators to retrieve current/next public keys
(qs-bridge-hub).
Oracles should not auto-fetch keys to avoid trusting the network path at runtime
and to keep key changes as an explicit, audited operator action.
Rotation flow: update HUB_KEYS_FILE with the Hub's current and next keys before a rotation.
Requests include X-Key-Id; the oracle accepts either current or next for the given hub ID.
It is the oracle operator's responsibility to keep the pinned keys file updated.
You also need to run the hub.
Run:
docker compose up --buildAccess the API at:
http://localhost:3000
Use the production-optimized multi-stage image with the dedicated compose file:
docker compose -f docker-compose.prod.yml up --build -dStop the production service:
docker compose -f docker-compose.prod.yml downInstall dependencies:
npm installThen run the script that pre-built for better-sqlite3:
npx allow-scripts runMore info about
allow-scripts: https://lavamoat.github.io/guides/allow-scripts/
This project uses better-sqlite3, which includes a native module that must be compiled during installation:
npm rebuild better-sqlite3 --ignore-scripts=falseBuild TypeScript sources:
npm run buildRun with hot reload:
npm run devRun the production server:
npm startRun a local network of Oracles:
npm run simulationYou also need to run the hub simulation launching two hubs is available in the hub repository.
Run the full test suite:
npm run testGenerate a new Solana CLI-style keypair file (64-byte JSON array) and print a
SOLANA_KEYS JSON payload (you must provide OUT):
OUT=.temp/solana-id.json npm run generate-solana-keypairCheck lint rules:
npm run lintAutofix:
npm run lint:fixPlease read CONTRIBUTING.md before opening a pull request.
Report vulnerabilities privately using GitHub’s security reporting flow. See SECURITY.md.
MIT, see LICENSE.