This is the public API/SDK guide for integrators. For internal implementation detail (Orchestrator state machine, signer roles), see docs/deployment/security-hardening.md in the repo.
Concrete guidance for platform integrators on API key management, real-time event security, wallet security, escrow verification, and blockchain-specific attack mitigations.
This is the public API/SDK guide for integrators. For internal implementation detail (Orchestrator state machine, signer roles), see docs/deployment/security-hardening.md in the repo.
Integrating OFFER-HUB into your marketplace means handling real USDC transactions on a public blockchain. A misconfiguration can expose user funds or allow spoofed payment events to reach your system. This guide gives you concrete, OFFER-HUB-specific security practices — not generic web security advice.
This guide focuses on threats specific to payment orchestration and blockchain escrow. Read it before going to production.
OFFER-HUB API keys follow the format ohk_live_xxx (production) and ohk_test_xxx (sandbox). A leaked live key gives full control over all payment operations — including releasing escrow funds and initiating withdrawals.
API keys must never appear in source code, client-side bundles, or version control. Use environment variables, and load them server-side only.
API keys must only travel server-to-server. Your marketplace backend calls OFFER-HUB; your frontend never does.
Rotate your API key:
Use the minimum scope each service needs:
| Service | Required Scope |
|---|---|
| Read-only dashboard | read |
| Order creation service | write |
| Dispute resolution admin | support |
OFFER-HUB does not send outbound webhooks, so there is no webhook signature for you to verify and no X-OfferHub-Signature header. Real-time events arrive over the SSE stream (GET /api/v1/events), which is authenticated with your API key over HTTPS.
Authorization header. Never expose the stream unauthenticated.Last-Event-ID — Replay missed events after a dropped connection instead of polling; a gap could hide a critical settlement event.AIRTM_WEBHOOK_SECRET and TRUSTLESS_WEBHOOK_SECRET environment variables protect the Orchestrator's inbound provider webhook receivers. They belong in your Orchestrator's environment, never in client code.An attacker cannot forge events from your Orchestrator: the SSE stream requires your API key and travels over TLS. The risk is trusting an event without confirming state — always cross-check with the API before acting on it.
If you process events from the stream (for example, to trigger downstream effects), make them idempotent. Track processed eventId values so a replayed event after reconnection can't cause duplicate processing:
OFFER-HUB manages Stellar invisible wallets for your users. Private keys are encrypted with AES-256-GCM at rest. As an integrator, you call the Orchestrator API — you should never handle raw private keys directly.
The encryption key protecting all wallet private keys must be treated as your most sensitive secret:
.env files in version control, or databaseThe platform wallet (used to sign dispute resolutions) is the most sensitive key in the system. Consider an HSM like AWS CloudHSM or Azure Dedicated HSM for production deployments.
The escrow flow is the highest-risk operation in OFFER-HUB. A bug here can result in funds being released to the wrong party or funds being permanently locked.
Always verify order and escrow state from the API before triggering a resolution. Never rely solely on an event pushed over the SSE stream.
Before calling POST /orders/:id/resolution/release:
| Check | Why |
|---|---|
Order status is IN_PROGRESS | Prevents double-release |
| Requester is the buyer | Only the buyer approves delivery |
Escrow status is FUNDED | Prevents acting on unfunded escrow |
| Work delivery evidence exists | App-level check: ensure work was submitted |
| No open dispute exists | Cannot release during active dispute |
Protect against double-releases caused by network retries:
Configure HTTP security headers to protect your users from XSS attacks that could intercept payment flows.
A strict CSP prevents injected scripts from stealing session tokens or intercepting payment data:
Never use script-src 'unsafe-inline' or connect-src * in a payment context. Restrict connect-src to your Orchestrator's exact domain only.
Risk: A signed Stellar transaction is resubmitted to process the same payment twice.
Mitigation by OFFER-HUB: Stellar transactions include a sequence number — each transaction can only be processed once. Replaying it returns tx_bad_seq.
Your responsibility: Use idempotency keys on all API calls. If a release succeeds but the network drops before you receive the response, retry with the same idempotency key to get the cached result instead of a second release.
Risk: An attacker submits a competing transaction before yours to manipulate fund flow.
Relevance: Stellar uses a FIFO queue within each ledger cycle, not fee-priority auctions like Ethereum. Traditional front-running does not apply.
Residual risk: Enforce strict RBAC on your Orchestrator deployment and enable database audit logging to prevent internal actors from triggering unauthorized releases.
Risk: OFFER-HUB's off-chain balance (PostgreSQL) diverges from the on-chain USDC balance (Stellar ledger).
How to detect it:
Risk: An attacker substitutes a legitimate deposit address with their own Stellar address.