Enterprise Reference Architecture

Technical Architecture

IdentityFlow is architected to enterprise-grade standards — built for Nigerian government-scale identity verification with sub-200ms API response times, 99.95% uptime SLA, zero-trust security, and full NDPR, NIMC, ISO 27001, and SOC 2 Type II alignment.

99.95%

Uptime SLA

≤ 4.38 hrs downtime/yr

<200ms

P95 API Latency

NIMC / NIBSS verification

10M+

Verifications/day

Design capacity

AES-256

Encryption Standard

At rest & in transit

Layer 0 — System Overview

5-Tier Enterprise Architecture

IdentityFlow follows a strict separation of concerns across five horizontal tiers, ensuring scalability, auditability, and security isolation at every boundary.

T1
Client Tier
Next.js 15 SSR/SSG (React 19)
Progressive Web App (PWA)
HTTPS-only · CSP headers · HSTS
WebAuthn / FIDO2 for admin 2FA
NIMC vNIN QR display · USSD fallback
mTLS · Zero-Trust Boundary
T2
API Gateway & Edge
Google Cloud Armor WAF (OWASP ruleset)
Cloud Load Balancer with anycast IP
DDoS mitigation (100Gbps+)
Rate limiting: 1000 req/min per citizen token
JWT RS256 + short-lived (15-min) access tokens
mTLS between all internal services
mTLS · Zero-Trust Boundary
T3
Application Tier
Identity Orchestration Engine (Node.js 22 / TypeScript)
AI Verification Advisor (Google Genkit + Gemini 1.5 Pro)
Consent & Agency Access Manager
vNIN Token Generator (NIMC-spec compliant)
Async Event Bus (Google Pub/Sub)
Horizontal auto-scaling (Cloud Run) · Min 3 replicas
mTLS · Zero-Trust Boundary
T4
Data Tier
Cloud Spanner (global transactions · 99.999% SLA)
Cloud Firestore (real-time session & consent state)
Redis Memorystore (session cache · token store)
Cloud KMS + HSM (key management)
All PII encrypted with per-tenant keys (AES-256-GCM)
Automated daily backups · 30-day retention · PITR
mTLS · Zero-Trust Boundary
T5
External Agency Integrations
NIMC API (NIN verification · vNIN issuance)
NIBSS API (BVN linkage · financial identity)
CAC API (company registry lookup)
FIRS API (TIN & TCC verification)
PENCOM API (RSA pension status)
BPE Agency Gateway (asset pre-qualification)
Layer 1 — Data Flows

Identity Verification Pipeline

End-to-end request lifecycle from citizen device to NIMC/NIBSS and back, with security checkpoints at every boundary.

F1

NIN Verification Flow

1

Citizen submits NIN + OTP

TLS 1.3 · Encrypted payload

2

WAF validates · Rate-check · JWT verify

Cloud Armor · <5ms

3

Orchestration Engine hashes NIN (bcrypt-12)

Never stored raw

4

NIMC API call with vNIN token request

mTLS · Signed request

5

NIMC returns name/DOB/state/LGA

Zero-knowledge selective

6

Response cached 90s · Audit log written

Spanner · tamper-proof

7

Citizen receives verified profile

JWT refresh · <200ms total

F2

BVN Linkage Flow

1

Citizen submits BVN + bank selector

TLS 1.3 · Encrypted payload

2

BVN immediately hashed (SHA-3-256)

Hash stored, not BVN

3

NIBSS API called with hash + bank code

NIBSS OAuth 2.0 client creds

4

NIBSS returns match confidence score

Probabilistic match ≥ 0.97

5

Financial Identity Score calculated

Composite: BVN + NIN + liveness

6

Bank linkage stored encrypted

Per-user KMS key

7

BPE pre-qualification score updated

<180ms end-to-end

F3

Agency Data Share Flow

1

Agency (e.g. BPE) sends data request

Signed API key · IP allowlist

2

Consent Manager checks authorisation

Firestore real-time read

3

ZKP engine generates proof payload

Only authorised fields

4

Data minimisation filter applied

NDPR Art. 2.1(1)(c)

5

Encrypted payload sent to agency

Agency public key encryption

6

Access event logged to audit chain

Immutable Spanner record

7

Citizen notified via dashboard/SMS

Real-time Pub/Sub event

Layer 2 — Security

Zero-Trust Security Architecture

Every request is authenticated, authorised, and encrypted regardless of network origin. Trust is never assumed — it is always verified.

Identity & Access Management

Token StandardJWT RS256 (2048-bit)
Access Token TTL15 minutes
Refresh Token TTL7 days (rotated)
Admin AuthFIDO2/WebAuthn hardware key
Service-to-ServiceWorkload Identity Federation
Secret ManagementGoogle Secret Manager

Encryption Architecture

In TransitTLS 1.3 (cipher: AES-256-GCM)
At RestAES-256-GCM (per-tenant keys)
Key ManagementCloud KMS + HSM (FIPS 140-2 L3)
NIN Storagebcrypt-12 (one-way hash)
BVN StorageSHA-3-256 (one-way hash)
Biometric DataNever persisted

Zero-Knowledge Proofs

ZKP Protocolzk-SNARK (Groth16 variant)
Proof Generation<50ms on server-side
Verifier CircuitNIN validity, age range, state
Agency receivesProof + public input only
Underlying dataNever leaves IdentityFlow
Audit trailProof hash on-chain (Polygon)

Network Security

WAFGoogle Cloud Armor (OWASP CRS 3.3)
DDoSStandard + Adaptive Protection
Rate Limiting1000 req/min (citizen) · 100 req/min (anon)
Internal NetworkPrivate VPC · No public ingress
Inter-servicemTLS with cert rotation (30d)
Egress controlVPC Service Controls · Allowlist only

Monitoring & Detection

SIEMGoogle Chronicle + Cloud SCC
Anomaly DetectionAI-powered (Gemini) behavioural
Log Retention7 years (NDPR compliant)
Alerting P0 SLA< 5 minutes (PagerDuty)
Pen TestingAnnual (CREST-certified)
Bug BountyContinuous (HackerOne programme)

Compliance Controls

NDPR 2019Full compliance · DPO appointed
ISO 27001:2022Target certification Q3 2026
SOC 2 Type IITarget certification Q4 2026
NIMC Act 2007API licence holder
CBN GuidelinesBVN API compliance
PCIDSS v4.0SAQ-A (no card data stored)
Layer 3 — Infrastructure

Cloud-Native, Africa-Hosted Infrastructure

All citizen data remains within Africa (Google Cloud af-south1, Johannesburg) to satisfy NDPR data residency requirements. Multi-region failover to europe-west1 for DR only — no citizen data persisted outside Africa.

Google Cloud — Primary Region (af-south1 · Johannesburg)

Edge Layer

Cloud Armor WAFGlobal Load BalancerCloud CDN (static assets)

Compute Layer

Cloud Run (auto-scale · min 3 replicas)GKE Autopilot (background jobs)Cloud Batch (async processing)

Data Layer

Cloud Spanner (ACID · multi-region)Cloud Firestore (real-time)Memorystore Redis (cache)

Security Layer

Cloud KMS + HSMSecret ManagerCloud SCC · Audit Logs

Integration Layer

API Gateway (agency connectors)Pub/Sub (event bus)Cloud Scheduler (cert renewal)

DR Region (europe-west1 · Belgium) — Metadata Only

Citizen PII is never replicated outside Africa. DR region holds only anonymised infrastructure state for failover orchestration. RPO: 1 hour. RTO: 4 hours.

Cloud Spanner (schema only)Config MirrorFailover ControllerHealth Check Endpoint

SLA / SLO Targets

Platform Availability

≤ 4.38 hrs downtime/year

99.95%

API P50 Latency

NIN verification end-to-end

<80ms

API P95 Latency

Including NIMC API round-trip

<200ms

API P99 Latency

Cold-start + NIBSS peak load

<500ms

Throughput (normal)

Horizontal Cloud Run scaling

5,000 req/s

Throughput (burst)

Auto-scale + Cloud Armor burst

50,000 req/s

Data RPO

Continuous Spanner replication

1 hour

Data RTO

Documented runbook · tested quarterly

4 hours

Incident P0 SLA

Alert → Acknowledge → Response

< 15 min

Capacity Model

Citizen records

Nigeria total population

200M+

Active sessions

Cloud Spanner horizontal scale

5M concurrent

Agency API calls

Government MDA combined

100M/day

Audit log storage

Compressed · 7-year NDPR retention

50TB/year

vNIN generation

NIMC API quota based

10M/day
Layer 4 — Integrations

Government API Integration Matrix

Each agency integration is independently managed with dedicated credentials, retry logic, circuit breakers, and compliance-aligned data handling.

AgencyAPI EndpointAuth MethodData SentData ReceivedTimeoutRetryCircuit Breaker
NIMCapi.nimc.gov.ng/v2OAuth 2.0 + mTLSNIN hash, OTPName, DOB, State, LGA, Photo hash3s3× exp. backoff50% error/10s
NIBSSapi.nibss-plc.com.ng/bvnAPI Key + IP allowlistBVN hash, Bank codeMatch score, linked name2s2× exp. backoff30% error/5s
CACservices.cac.gov.ng/apiAPI Key + JWTRC Number, Company nameRegistration status, Directors5s3× exp. backoff40% error/10s
FIRSapi.firs.gov.ng/tinOAuth 2.0 + HMAC-256TIN, NIN hashTCC validity, expiry date4s2× exp. backoff35% error/10s
PENCOMapi.pencom.gov.ng/rsamTLS + OAuth 2.0NIN hash, BVN hashRSA status, PFA name4s3× exp. backoff40% error/10s
BPEapi.bpe.gov.ng/gatewayAPI Key + signed requestIdentity proof bundlePre-qualification status6s2× exp. backoff30% error/15s
Layer 5 — Compliance

Enterprise Compliance Matrix

IdentityFlow maps every architectural component to its applicable compliance standard. Green = compliant. Amber = in progress. Grey = not applicable.

🇳🇬

NDPR 2019 (Nigeria)

Compliant
Lawful basis documented
DPO appointed
Privacy by design
Data minimisation (ZKP)
Consent management
Data subject rights (7)
NDPC registration✅ (pending)
Annual audit✅ (scheduled)
🏛️

NIMC Act 2007 (Nigeria)

Compliant
NIMC API licence✅ (applied)
NIN not stored raw
vNIN per NIMC spec
Audit trail 90 days
Authorised verifier
No NIN commercial use
NIMC data sharing agreement
Biometric deletion policy
🌐

ISO/IEC 27001:2022

In Progress (Q3 2026)
Information Security Policy
Risk Assessment & Treatment
Access Control (A.5)
Cryptography (A.8.24)
Physical Security✅ (Cloud)
Incident Management
Business Continuity (A.5.30)
Certification audit🔄 Q3 2026
📋

SOC 2 Type II (AICPA)

In Progress (Q4 2026)
Security (CC criterion)
Availability (A criterion)
Confidentiality (C criterion)
Processing Integrity (PI)
Privacy (P criterion)
Change management controls
Vendor management programme
Type II observation period🔄 Q4 2026
🏦

CBN Guidelines (BVN Framework)

Compliant
Licensed NIBSS API consumer
BVN not stored in plaintext
Authorised purpose only
Audit log per CBN mandate
No BVN re-sale/sharing
Financial data separation
CBN data agreement
Annual CBN review✅ (scheduled)
⚖️

Cybercrimes Act 2015 (Nigeria)

Compliant
Identity fraud prevention
Unauthorised access controls
Incident reporting to NPF✅ (policy)
Employee security training
Cybercrime detection (SIEM)
Whistleblower channel
No deepfake/synthetic bypass
Data breach notification plan
Layer 6 — Technology Stack

Full Technology Stack

Frontend
TechnologyPurposeWhy Chosen
Next.js 15React framework (SSR/SSG/App Router)SEO, performance, server components
React 19UI component libraryServer actions, concurrent features
TypeScript 5Static typingType safety, DX, runtime confidence
Tailwind CSS 3Utility-first stylingDesign system consistency
shadcn/uiAccessible component primitivesWAI-ARIA compliance, Radix UI base
Lucide ReactIcon systemConsistent, tree-shakeable SVGs
Backend / AI
TechnologyPurposeWhy Chosen
Node.js 22 LTSRuntimeLong-term support, V8 performance
Google Genkit 1.xAI orchestration frameworkFlow-based AI pipelines, observability
Gemini 1.5 ProAI model (alternative suggestions, guidance)Grounded in Nigerian identity context
Zod 3Schema validation (API + AI)Runtime type safety for external data
Google Pub/SubAsync event busDecoupled agency notifications
Cloud RunServerless container runtimeAuto-scale to zero, no idle cost
Data
TechnologyPurposeWhy Chosen
Cloud SpannerPrimary relational databaseGlobal ACID transactions, 99.999% SLA
Cloud FirestoreReal-time session & consent stateSub-10ms read latency, offline sync
Redis MemorystoreSession cache, token storeSub-1ms cache reads, token revocation
Cloud KMS + HSMKey managementFIPS 140-2 Level 3, hardware key isolation
BigQueryAnalytics & compliance reportingPetabyte-scale audit log analysis
Cloud StorageDocument uploads (encrypted)Client-side encryption, per-object keys
Security & Ops
TechnologyPurposeWhy Chosen
Cloud ArmorWAF + DDoS mitigationOWASP CRS 3.3, adaptive protection
Google ChronicleSIEM / threat intelligencePlanet-scale log analysis, IoC matching
Cloud SCCSecurity posture managementContinuous misconfiguration detection
Workload Identity FederationService-to-service authNo static keys in codebase or env
PagerDutyOn-call alertingP0 < 5 min escalation SLA
TerraformInfrastructure as CodeReproducible, auditable infra changes
Layer 7 — Operations

Operational Excellence & DevSecOps

CI/CD Pipeline

  • GitHub Actions — automated on every PR
  • Unit tests (Jest) + Integration tests (Supertest)
  • SAST scanning (CodeQL) on every push
  • DAST scanning (OWASP ZAP) nightly
  • Container image scanning (Trivy)
  • IaC security scan (tfsec)
  • Blue/green deployments via Cloud Deploy
  • Automated rollback on P0 alert

Observability

  • Structured JSON logging (all services)
  • Cloud Trace — distributed request tracing
  • Cloud Monitoring — SLO dashboards
  • Custom metrics: NIN verify latency, BVN match rate
  • Error budget alerts (99.95% target)
  • Real User Monitoring (Web Vitals LCP/INP/CLS)
  • Uptime checks every 60s (multi-region)
  • Incident post-mortems (blameless · 48hr)

Business Continuity

  • RPO: 1 hour (Cloud Spanner continuous backup)
  • RTO: 4 hours (documented failover runbook)
  • DR test: quarterly full failover drill
  • Chaos engineering: monthly fault injection
  • BCP reviewed annually by exec committee
  • Vendor risk register: NIMC API SLA monitoring
  • Degraded-mode: USSD fallback for NIN lookup
  • Manual override: human review SLA 2 business days
Layer 8 — FAQs

Architect & CTO Questions

Common technical due diligence questions from enterprise clients and government agencies.

NINs are hashed with bcrypt-12 immediately on receipt and the plaintext is discarded. The hash alone is useless without the original — it cannot be reversed. Additionally, Zero-Knowledge Proofs mean NINs are verified without ever transmitting them to agencies. In the event of a database breach, no usable NINs can be extracted.

Ready to Integrate?

Request a technical integration package, API sandbox credentials, or a live architecture walkthrough with the IdentityFlow engineering team.