Stateless orchestrator for the Hydex Zcash-Solana bridge per Hydex Spec Section 5.6.
+------------------+
| Frontend |
+--------+---------+
|
REST API (public endpoints)
|
+--------v---------+
| Bridge API | <-- This service
| (port 3001) |
+--------+---------+
|
+--------------+--------------+
| | |
+--------v---+ +-----v------+ +----v-----+
| Enclave | | Solana | | MPC |
| (port 8089)| | (devnet) | | Nodes |
+------------+ +------------+ +----------+
- Attestations encrypted via Arcium (x25519 + RescueCipher) before Solana submission
- Zcash withdrawal addresses encrypted before Solana submission
- No plaintext sensitive data appears on the Solana blockchain
# Install dependencies
yarn install
# Build
yarn build
# Run
PORT=3001 node dist/index.js
# Test
./test-api.sh# Build image
docker build -t hydex-bridge-api:latest .
# Run container
docker run -d -p 3001:3001 \
-e PORT=3001 \
-e SOLANA_RPC_URL=https://api.devnet.solana.com \
hydex-bridge-api:latest| Method | Path | Description |
|---|---|---|
| GET | /health | Health check |
| POST | /v1/auth/challenge | Get auth challenge for wallet |
| POST | /v1/auth/verify-wallet | Verify signature, get JWT |
| POST | /v1/deposit-intents | Create deposit intent |
| GET | /v1/deposit-intents/:id | Get deposit status |
| GET | /v1/deposit-intents | List user deposits |
| POST | /v1/burn-intents | Create withdrawal request |
| GET | /v1/burn-intents/:id | Get withdrawal status |
| GET | /v1/burn-intents | List user withdrawals |
Requires X-API-Key header.
| Method | Path | Description |
|---|---|---|
| POST | /v1/internal/attestations | Submit deposit attestation |
| POST | /v1/internal/burn-intents/:id/finalize | Finalize withdrawal |
| GET | /v1/internal/deposits | List all deposits (monitoring) |
| GET | /v1/internal/burns | List all burns (monitoring) |
| POST | /v1/internal/deposits | Create test deposit |
| POST | /v1/internal/deposits/:id/set-ua | Set unified address |
| Method | Path | Description |
|---|---|---|
| POST | /v1/zec/emit_orchard | Forward Orchard data to enclave |
Copy config.example.json to config.json:
{
"server": { "port": 3001 },
"solana": {
"network": "devnet",
"rpc_url": "https://api.devnet.solana.com",
"program_id": "5PLQ9ZSbYq4qfYic3dCwyr1BR8GMVfCKWsbTan2VWE45"
},
"arcium": {
"enabled": true,
"program_id": "Bv3Fb9VjzjWGfX18QTUcVycAfeLoQ5zZN6vv2g3cTZxp"
},
"security": {
"jwt_secret": "change-this-in-production",
"internal_api_key": "hydex-internal-key"
}
}- User calls
POST /v1/deposit-intents(with JWT) - Bridge API creates deposit on Solana
- Bridge API calls enclave for UA generation
- User sends ZEC to unified address
- Enclave detects deposit, calls
POST /v1/internal/attestations - Bridge API encrypts attestation via Arcium
- Bridge API submits encrypted TX to Solana
- Arcium MPC decrypts, verifies, mints sZEC
- User calls
POST /v1/burn-intents(with JWT + Zcash address) - Bridge API encrypts Zcash address via Arcium
- Bridge API submits encrypted burn to Solana
- Solana burns sZEC, creates encrypted burn intent
- MPC nodes coordinate FROST signature
- MPC nodes call
POST /v1/internal/burn-intents/:id/finalize - ZEC sent to user's private Zcash address