System Terms & Security Architecture

This chapter defines the system architecture, entity identifiers, security tiers, and role permissions governing the BiiTrust core banking platform.


1. Hexadecimal Entity Identifiers

Every record created across BiiTrust is assigned an immutable, collision-resistant 15-character uppercase hexadecimal identifier. The first three letters denote the operational domain, followed by 12 pseudo-random uppercase hex characters:

Hex PrefixDomain NameDatabase TablePurpose & Description
CLX…Clientsorg.clientsIndividual or business borrower records and profiles.
LOX…Loansloan.loansActive, closed, or written-off credit facilities.
APX…Applicationsloan.applicationsCredit origination requests undergoing underwriting.
PMX…Paymentsloan.paymentsInbound cash, bank, or M-Pesa repayment transactions.
BRX…Branchesorg.branchesPhysical branch offices and regional hubs.
STF…Stafforg.staffEmployee identity records, system users, and officers.
ACX…Accountsgl.accountsGeneral Ledger chart of accounts and sub-accounts.
COL…Collateralloan.collateralsPhysical pledged assets, logbooks, and chattel liens.
DOC…Documentsorg.documentsUploaded KYC files, National ID scans, and contracts.
MAN…Mandatesloan.mandatesStanding orders, direct debit mandates, and group guarantees.
PRD…Productsloan.productsLoan product configurations, rates, tenors, and calculation rules.
AUD…Auditssys.auditsImmutable security audit logs recording every action, IP, and payload.
CMS…Commssys.commsOutbound SMS notifications, email statements, and delivery states.

Hex Resolution Rules

  • Case Insensitive in Search: Searching clx936 or CLX936 immediately resolves to the target client.
  • Universal Links: Typing or clicking any hex code across the UI navigates directly to that entity’s profile page (e.g., clicking LOX44A1B903 opens the loan ledger).

2. Client Onboarding Tiers

To comply with statutory Anti-Money Laundering (AML) and Proceeds of Crime regulations while ensuring financial inclusion, BiiTrust structures customer profiles into three progressive tiers:

TierRequired CredentialsMaximum Credit CeilingVerification Level
basicMobile phone number, self-declared name, National ID number.KES 25,000Automated SMS OTP verification. Prospect status.
standardVerified original National ID card scan, passport portrait, physical residence details, next of kin.KES 250,000Reviewed and approved by Compliance Officer.
enhancedKRA Tax PIN Certificate, 6 months bank/M-Pesa statements, utility bill, business registration / permit.Unlimited (Up to product maximum)Full Enhanced Due Diligence (EDD), field visit verification, and Credit Committee clearance.

3. Entity Lifecycle States

Client States

  • prospect: Registered prospect; KYC incomplete; cannot borrow.
  • active: Fully verified KYC; eligible for loan origination.
  • dormant: No transactions or active credit facilities in 180+ days.
  • blacklisted: Barred from future lending due to fraud, forgery, or malicious default.
  • exited: Formally closed membership; all liabilities discharged.

Application Stages

  • draft: Created by Loan Officer; pending document attachment or guarantor assignment.
  • submitted: Forwarded to Branch Manager or Credit Committee queue for review.
  • appraised: Credit evaluation, affordability scoring, and field visit report completed.
  • approved: Formally authorized for funding; awaiting borrower acceptance and disbursement.
  • rejected: Application denied; reason documented and archived in audit trail.
  • disbursed: Funds released to borrower’s account/phone; converted into active LOX loan.

Loan States

  • pending: Approved but funds not yet transferred.
  • active: Disbursed and currently amortizing according to schedule.
  • closed: Outstanding balance reaches exactly KES 0.00; collateral released.
  • rescheduled: Original facility superseded by restructured terms.
  • written_off: Uncollectible debt removed from balance sheet; recovery ongoing.

4. Cryptographic Scoped Search Keys

BiiTrust uses an enterprise search security model powered by Typesense Scoped Search Keys. Rather than relying on client-side filtering or slow SQL database scans, the system validates user permissions cryptographically:

  1. Session-Driven Identity: When an employee signs into the web application, their JWT session establishes their Role, Staff Identity (identity), and Assigned Branch (branch).
  2. Cryptographic Signing (HMAC-SHA256): The backend generates an ephemeral, short-lived search key embedded with non-negotiable security filters:
    • For an Officer: branch:=[BRX1001] && officer:=805303613
    • For a Branch Manager: branch:=[BRX1001]
    • For an Executive Director / Admin: branch:=* (no isolation)
  3. Hardware-Enforced Isolation: The search engine validates the HMAC signature before executing any query. Even if a user attempts to manually forge a search query, Typesense physically restricts the search results to records matching their signed token.
  4. Sensitive Field Masking: Scoped keys automatically strip protected fields (password, pin, risk_score, national_id_raw) from search results before network transmission.

5. Role Hierarchy & Operational Privileges

System RoleScope of AccessCore ResponsibilitiesGated Actions
owner / adminOrganization-wideSystem health, staff onboarding, branch creation, product setup, database sync.Can manage all configurations, credentials, and settings.
directorOrganization-wideHigh-value loan approvals ($\ge \text{KES } 500,000$), write-offs, financial statements.Cannot disburse cash directly across a branch counter.
managerSingle BranchOperational oversight, staff management, loan approvals ($< \text{KES } 500,000$), rescheduling.Confined strictly to branch loans, clients, and cash drawers.
officerOwn Portfolio BookClient prospecting, loan application origination, group collection sheets.Confined strictly to assigned clients; cannot approve loans.
tellerBranch Cash CounterCash receipts, manual M-Pesa entry, STK pushes, cash drawer balancing.Cannot originate loans or alter repayment schedules.
accountantGeneral LedgerChart of accounts, journal entries, bank reconciliations, fiscal closures.Cannot approve credit or originate borrower files.
complianceRisk & LegalKYC document verification, sanction checks, CRB reporting, AML audit.Independent oversight; cannot handle cash or approve loans.
auditorRead-only Org-wideInspection of audit trails (AUD), general ledger balances, and portfolio health.Read-only across all modules; cannot perform updates.