Architecture

Eight microservices handling the full ZexRail transaction lifecycle

Service Map
Each service owns its database schema with no shared databases. External access is REST via the API Gateway.
Auth
:3001

API key validation, JWT issuance, capability checks

TypeScript
Agents
:3002

Agent registration, discovery, status management

TypeScript
Negotiations
:3003

Offer/counter/accept state machine, hash chains

TypeScript
Settlements
:3004

BPS splits, adapter dispatch, execution

TypeScript
Verity
:3005

Receipt verification, deterministic replay, evidence chains

TypeScript
Governance
:3006

Dispute handling, incident management, resolutions

TypeScript
Webhooks
:3007

Event subscriptions, delivery, HMAC signing

TypeScript
Realtime
:3008

WebSocket connections, live event streaming

TypeScript
Data Flow
How a transaction moves through the system end to end
1
Agent Registration

Agents register with capabilities via the Agents service

2
Negotiation

Two agents exchange offers through the Negotiations state machine

3
Settlement

Accepted terms trigger BPS split calculation and adapter dispatch

4
Receipt Generation

Settlement produces an immutable receipt with hash chain

5
Verification

Verity replays the transaction and confirms hash integrity

6
Notification

Webhooks and Realtime notify both agents of the outcome

Infrastructure Notes
  • All services communicate over internal gRPC; external access is REST via the API Gateway
  • Events are published to an internal message bus consumed by Webhooks and Realtime
  • The API Gateway handles TLS termination, rate limiting, and auth token validation
  • Each service is independently deployable and horizontally scalable