Building the Ecosystem

From RGS to HTML5 Frontend and Compliance Infrastructure

Shifting to a Vertically Integrated Business

Though the conventional Provider – Platform – Casino distribution model remains a foundational structure of the industry, over the past few years there have been increasing signals of a strategic shift among iGaming market players toward building their own vertically integrated ecosystems.

More reasonable CAPEX requirements for building proprietary platforms, combined with faster and more affordable game production, are becoming key enablers of this shift. Starting some scale point, the benefits include drastically improved profitability, greater control over marketing and distribution decisions, and the ability to scale hard-earned, business-specific know-how and approaches – unique insights and operational practices developed over time to survive and outperform the competition.

One of our customers approached CGS with the objective of building such an ecosystem.

The task involved designing and implementing a production-grade platform covering:

  • Remote Gaming Server (RGS)
  • HTML5 game frontend infrastructure
  • Deterministic game engine and math execution
  • Wallet and operator integrations
  • Audit and compliance tooling
  • Back-office operations
  • Multi-currency and localization support
  • Security infrastructure

From Testing the Waters to an Ambitious Product Development

The customer’s existing business and technology landscape had evolved over time through several breakthrough decisions across both mainstream and niche iGaming markets. The customer established solid distribution and promotional channels and continued building and expanding operations. At the same time, it became clear that this approach was associated with significant OPEX and royalty payments to third parties, while operating on only a fraction of the GGR.

Recognizing the opportunities ahead, the customer nevertheless moved cautiously. By the time critical strategic decisions had to be made, the customer had already tested the waters in proprietary game production by creating a compact in-house creative studio, while outsourcing a major portion of game development services to CGS. The broader landscape consisted of fragmented, experiment-driven solutions, including a zoo of third-party integrations, RGS-less setups, and revenue-sharing partnerships with several technology providers supplying more or less ready-to-use components.

While these experiments and the conservative approach produced promising results, several operational and technical challenges gradually began affecting both content delivery and system maintainability:

  • Tight coupling between games and backend services
  • Inconsistent wallet and payment integrations
  • Lack of unified audit and compliance flows
  • Difficulties supporting multiple currencies and localization requirements
  • Repeated implementation of common mechanics on the game engine side
  • Growing complexity around security, auditing, and compliance

The customer needed a platform capable of supporting long-term expansion — one that would:

  • Resolve key bottlenecks and put regular content releases on rails
  • Turn routine operations into streamlined, standardized processes
  • Absorb, integrate with, or seamlessly replace existing components
  • Enable rapid introduction of new game categories, such as Crash games and various card games and a variety of instant-win games
  • Provide open architecture ready to adapt sweepstake ingestion in the nearest future (and, potentially, plug in any innovative ideas that may emerge)

In other words, the customer began transitioning toward its own RGS with a broad set of accompanying platform components and solutions.

Designing the Platform Around Separation of Responsibilities

Following the context, the architecture developed by CGS was designed around several foundational principles

  • Server-authoritative gameplay
  • RGS as the sole trust boundary
  • Stateless services with externalized state
  • Deterministic outcome generation
  • Immutable and versioned math packages
  • Pluggable wallet and RNG providers
  • Hash-chained audit logging
  • Cloud-agnostic Kubernetes deployment
  • Idempotent transaction processing at every entry point

The realization followed a modular architecture where gameplay rendering, transaction orchestration, outcome calculation, RNG provisioning, auditability, and integrations were separated into dedicated layers.

All core services were designed as containerized workloads deployable across Kubernetes clusters with regional scalability and “operator”-level logical isolation.

  • RGS is the sole public entry point for player-affecting state changes; engine and wallet are never reached from the client.
  • The audit log is an event stream, not a database — all round events land there first; relational and analyticsstores are read-models built from it.
  • External providers (client, RNG, wallet/PAM) are pluggable behind stable interfaces; reference implementationsor schematic contracts ship, customer implementations substitute without engine or RGS changes.

Components

  • The client sends a signed and idempotent gameplay request
  • The RGS validates the session and orchestrates wallet operations.
  • The game engine requests entropy from the RNG provider.
  • The engine computes deterministic outcomes.
  • Wallet credit operations are executed.
  • Audit events are committed into the event stream.
  • The client receives a signed outcome envelope.

This architecture ensured that gameplay outcomes, transaction consistency, and replayability remained centrally controlled and independently auditable. Instead of creating another monolithic backend, CGS proposed a modular architecture separating gameplay presentation, outcome generation, integrations, compliance, and operational tooling.

Remote Gaming Server (RGS)

The RGS was implemented as the sole public trust boundary of the platform.

Every player-affecting operation — including gameplay actions, wallet communication, configuration delivery, and audit logging — passed through the RGS layer. The game engine and wallet systems were never exposed directly to the client.

The RGS became the orchestration layer responsible for coordinating gameplay sessions, wallets, transactions, configuration, monitoring, and compliance-related operations.

  • Session lifecycle management
  • Wallet coordination between client, game engine, and external operators
  • Support for debit, credit, rollback, and idempotent wallet operations
  • Multi-currency handling for fiat and crypto flows
  • Monitoring and alerting systems
  • Immutable audit logs and round references
  • Back-office administration tooling
  • API layer for frontend, wallet adapters, and operational systems

The architecture was designed to support both direct integrations and adapter-based integrations with third-party operators and wallet providers.

The architecture was daSpecial attention was given to transaction consistency and operational transparency. Every gameplay round, financial operation, and critical state transition could be traced and audited.esigned to support both direct integrations and adapter-based integrations with third-party operators and wallet providers.

The architecture was daSpecial attention was given to transaction consistency and operational transparency. Every gameplay round, financial operation, and critical state transition could be traced and audited.esigned to support both direct integrations and adapter-based integrations with third-party operators and wallet providers.

The RGS state model supported forward recovery through all gameplay phases:

Requested → Validated → BetDebited → EngineCalled → WinCredited → AuditCommitted → Returned

Each transition was persisted into the event stream, allowing deterministic replay, operational investigations, and reconciliation workflows.

Game Engine (Math / Logic)

The engine layer included:

  • Deterministic gameplay execution
  • Replay-capable round processing
  • Stateful bonus and free-spin orchestration
  • Multi-currency handling for fiat and crypto flows
  • Content-addressed math package registry
  • Configurable game logic execution
  • Logging pipelines
  • Anti-duplicate and anti-replay protection

The separation between presentation and outcome generation significantly simplified maintenance and future extensibility.

Math models could evolve independently from frontend implementations, while gameplay balancing and RTP adjustments could be controlled through configuration and versioning workflows.

Each math package was versioned, signature-verified, and content-addressed using immutable package hashes. RTP variants were pre-validated and selected per operator configuration rather than adjusted dynamically at runtime.

This architecture also improved testing and certification processes by isolating critical gameplay calculations into deterministic backend services.

RNG Sidecar (pluggable provider)

The RNG is pluggable, not a fixed platform component. The engine speaks to it via a narrow interface: round context + byte count in, bytes + stable seedReference out. The sidecar runs alongside the engine for low-latency calls and can be developed, audited, or replaced without modifying engine code.

Deterministic PRNG

Unit tests, replay verification, demos. Bit-exact reproducible from a seed.

Reference DRBG

Production starting point. Cryptographically strong; entropy from kernel and (where available) hardware sources.


Any implementation honouring the RNG interface plugs in — internally developed, third-party licensed, or hardware-backed. Replacement is a deployment-config change.

The seedReference is recorded in the audit row; replay re-issues the same request and asserts the same seedReference resolves to the same bytes.

Wallet & PAM (pluggable provider)

The Wallet/PAM tier is pluggable. Two deployment modes, one canonical contract:

External PAM (default)

Operator already has a Player Account Management system and wallet.

A thin wallet adapter translates between the canonical contract and the operator's dialect(envelope, signing, transport). One adapter per PAM.

Platform-provided PAM (optional)

Slots delivery plus account & wallet setup; no existing PAM.

Reference implementation covering what a slots-only deployment needs: player accounts and authentication, real-money and bonus wallets (multi-currency), deposit/withdrawal ledger with pluggable payment connectors, transaction history, and player-limit enforcement at the wallet boundary. Same canonical contract toward the RGS as any external PAM. Opt-in; deployments using an external PAM do not deploy it.


Both modes expose debit / credit / rollback / getRoundStatus to the RGS — idempotent on transaction id, integer minor units, currency-aware. The RGS does not know which mode is wired in.

Compliance, Auditability, and Operational Visibility

Compliance and replayability were treated as first-class architectural concerns rather than secondary operational features.

One of the most important business requirements was ensuring operational transparency.

The customer required infrastructure capable of supporting internal investigations, regulatory audits, dispute resolution, and gameplay verification.

To address these needs, CGS implemented:

  • Immutable audit logging
  • Round history archive
  • Transaction logging
  • Spin history storage
  • Export pipelines for CSV and JSON reports
  • RNG reference hash exports
  • Administrative tooling for operational teams
  • Monitoring and alerting infrastructure

The audit architecture relied on append-only event streams and hash-chained audit records where every row referenced the previous audit hash. Chain heads could be externally timestamped, making tampering detectable and improving regulatory confidence.

Audit & Replay Service сonsumes the round-event stream. Writes an append-only audit table with row-level immutability and per-row hashchaining (H(n) = SHA-256(H(n-1) ‖ row)), and a cold archive in object storage with write-once-read-many guarantees. Retention configurable per operator. The replay endpoint reconstructs any historical round from its audit row plus the pinned math package version.

The resulting ecosystem enabled support and compliance teams to trace gameplay flows, validate transactions, and investigate anomalies without engineering intervention.

Backoffice

The back-office layer was implemented as an internal operational access point focused on compliance, support workflows, and operational visibility across the gaming ecosystem.

Access to the system was protected through SSO integration, MFA, and IP allow-list restrictions, while role-based access control separated responsibilities between operator administrators, compliance teams, support agents, and read-only audit users.

The tooling exposed operational capabilities such as:

  • Round and transaction investigation
  • Wallet and gameplay log inspection
  • Configuration and RTP visibility
  • Operator-specific overrides
  • Alert and incident management
  • Role and permission administration
  • CSV and JSON export workflows

Administrative operations were treated with the same auditability standards as gameplay actions (the admin user is the actor). Every change, override, export, or operational intervention was recorded in the immutable audit stream with full actor attribution and traceability.

Frontend Layer

The frontend layer was developed as a lightweight yet highly configurable HTML5 application framework capable of supporting multiple casino game categories.

The realization covered:

  • Reel rendering and animation systems
  • Configurable spin bar and gameplay settings UI
  • Asset optimization pipelines
  • State machines for slots, free spins, bonus rounds, and anticipation sequences
  • Event analytics
  • Localization and multi-currency support
  • Network communication layers

One of the key architectural principles was minimizing trust on the client side. The frontend contract was designed around signed outcome envelopes, signature verification, idempotent action calls, and HTTPS communication. No RNG logic, payout calculations, reel strips, or probabilistic systems were exposed to the client layer.

Determinism and Replay

Every round is reconstructable from stored inputs alone — never from stored outcomes. This is what makes disputesresolvable and the engine auditable end-to-end.

  • Deterministic engine: same gameId, mathVersion, rngSeedReference, inputs always produces the same outcome.
  • Pluggable RNG committed to a stable seedReference — the platform does not mandate the underlying RNG algorithm.
  • Immutable math packages: signature-verified at load; a round always replays against the exact package hash recorded in audit.
  • Hash-chained audit log: per-row chain scoped per operator; chain head published periodically to an externaltimestamping authority. Tampering is detectable.

Per-round flow: RGS allocates roundId. Engine requests an RNG block keyed on (operatorId, roundId, gameId, mathVersion); sidecar returns bytes + seedReference. Engine computes the outcome. The audit row records roundId, rngProvider, seedReference, mathPkgHash, inputs[], outcomeHash, prevAuditHash, signature — the hash of the outcome, never the outcome itself.

Replay: Look up the audit row → pull the math package by hash → re-issue the RNG request and assert the stored seedReference resolves to the same bytes → run the engine with the stored inputs → compare the produced outcome hash against the stored value. A mismatch indicates either tampered audit data or engine non-determinism; both are surfaced by the same procedure.

Wallet / PAM Integration

The Wallet/PAM tier is pluggable. The same canonical contract applies whether the platform is calling an external operator PAM or the platform-provided PAM — the RGS, engine, and audit pipelines do not know which side of the boundary the wallet lives on.

Canonical contract: debit, credit, rollback, getRoundStatus. All idempotent on a stable transaction id. All amounts integer minor units. Currency code on every call.

Round flow: Never blindly retry on timeout — always getRoundStatus first. A credit succeeding after believed failure is a real failure mode; a reconciler runs periodically and heals discrepancies. The adapter handles per-PAM dialects; the core RGS speaks only the canonical contract. Operator clocks can drift; the platform sends its own timestamp with an accepted tolerance window.

Reconciliation: A periodic file (format per operator) produced from the transaction event stream. SLA-breachingdiscrepancies open a support ticket and an auditable incident with operator notification.

Deployment, Scaling, Operations

The platform was designed as a cloud-agnostic, Kubernetes-native ecosystem capable of running consistently across regional deployments, private infrastructure, and multi-tenant operator environments.

Regional deployments supported data residency requirements and low-latency gameplay delivery, while maintaining a unified deployment model where infrastructure differences were configuration-driven rather than architecture-specific.

The infrastructure layer was separated into workload-oriented node pools optimized for different operational characteristics:

  • Low-jitter execution environments for game engine workloads
  • General-purpose orchestration nodes for RGS services
  • Dedicated data-plane infrastructure for stateful services and storage workloads

Autoscaling strategies were driven by request latency and operational SLOs instead of raw CPU utilization, improving platform stability during gameplay spikes and traffic bursts.

Slot spin: engine compute
(Pure math + RNG)

P95 < 30 ms

Slot spin: full round-trip
(Including wallet and network)

P95 < 150 ms

Slot spin: P99 tail
(Including occasional pauses, retries, jitter)

< 250 ms

Wallet round-trip
(Provider-dependent)

P95 < 100 ms

Operator identifiers acted as partitioning keys throughout the platform data model, allowing infrastructure reuse without sacrificing operational separation, reporting boundaries, or audit traceability.

Physical isolation was supported for deployments with stricter contractual or regulatory requirements, but the default operational model prioritized efficient multi-tenant scalability.

Operational observability was implemented across the entire gameplay flow — from client requests and RGS orchestration to engine execution and wallet processing.

Let’s Collaborate

The gaming industry thrives on innovation and partnerships. Whether you’re interested in our services, exploring new game concepts, or discussing other business opportunities, we’re always open to conversations. Drop us a line!