Deep Transaction Simulator is a production-quality educational system designed to simulate the complete lifecycle of a credit card transaction β from card input to issuer decision β with full transparency into data structures, message formats, and transformation layers.
Unlike typical demos, this system prioritizes:
- Conceptual correctness over superficial visuals
- Deterministic execution over randomness
- Inspectability at every stage of the transaction
This is not a mock UI β it is a transaction debugger for payment systems.
To build a system that explains, step-by-step, what actually happens during a credit card transaction, including:
- Data structuring (PAN, EMV)
- Message construction (ISO 8583)
- Encryption transformations
- Network routing simulation
- Issuer-side decision logic
- Depth over scale β Simulate one transaction extremely well
- Deterministic and reproducible β Same input β same output
- No external APIs β Fully self-contained system
- Explainability-first design β Every step is inspectable
- Separation of computation and visualization
This project uses a unified TypeScript fullstack architecture, meaning:
- No backend/frontend separation
- No network calls between layers
- Entire simulation runs in-memory
- UI directly interacts with the simulation engine
React UI
β
Simulation Engine (Pure Functions)
β
State + Event Logs
- Visualization of transaction flow
- Inspectors for ISO fields, TLV data, encryption
- Playback controls (step, play, reset)
- State machine (transaction lifecycle)
- ISO 8583 message builder
- EMV TLV generator/parser
- Encryption simulator
- Network routing simulation
- Issuer decision engine
-
Strongly typed structures for:
- ISO messages
- TLV data
- Transaction state
- Event logs
- TypeScript β unified language across system
- React (Vite) β fast frontend runtime
- Zustand β lightweight state management
- React Flow β network graph simulation
- Custom components / D3 (optional) β data visualizations
- Fully client-side (can be deployed as static app)
- Optional: Node runtime (for CLI simulation)
Card Input
β Data Structuring
β ISO Message Construction
β Encryption Layer
β Network Routing (Terminal β Acquirer β Network β Issuer)
β Issuer Decision
β Response Propagation
Simulates realistic card input:
- PAN (generated using Luhn algorithm)
- Expiry date
- CVV
- Optional cardholder data
Implements Tag-Length-Value (TLV) format used in chip transactions.
Tag: 9F26
Length: 08
Value: A1B2C3D4E5F6A7B8
Supports:
- Nested TLV structures
- Decoding and visualization
- Field-level inspection
Constructs structured transaction messages.
- MTI:
0100(Authorization Request) - Field 2: PAN
- Field 4: Amount
- Field 7: Transmission Time
- Field 11: STAN
- Field 41: Terminal ID
- Field 55: EMV TLV data
ISO messages are stored as:
- Structured objects (not raw strings)
- Serialized only when needed
The goal is to teach encryption, not implement production-grade cryptography.
Raw Data β Pseudo Encryption β Transport Wrapping
-
Lightweight deterministic transformation (XOR-based + encoding)
-
Visual representation of:
- Data obfuscation
- Block transformations
-
Optional advanced view:
- AES concepts (SubBytes, ShiftRows, etc.)
pseudoEncrypt(data) β encoded stringEncryption is shown as:
- A data transformation step
- Not a security system
Models the payment ecosystem:
- Terminal
- Acquirer
- Network
- Issuer
-
Each node:
- Receives message
- Logs state
- Forwards message
-
Full routing path is tracked
Network latency is simulated in UI β not in computation
A rule-based system that evaluates transactions.
- Balance validation
- CVV match
- Basic fraud detection
APPROVED
or
DECLINED (with reasons)
- Fully deterministic
- Explainable decision output
- Rule-level visibility
The system is driven by an explicit state machine.
INIT
β CARD_CAPTURED
β DATA_STRUCTURED
β ISO_BUILT
β ENCRYPTED
β ROUTED
β AUTHORIZED
β COMPLETED
- Pure function transitions
- No hidden side effects
- Fully replayable
nextState = transition(currentState)
type ISOMessage = {
mti: string;
bitmap: string;
fields: {
2?: string;
4?: number;
7?: string;
11?: string;
41?: string;
55?: TLVData;
};
};type TLV = {
tag: string;
length: number;
value: string | TLV[];
};type TransactionState = {
id: string;
currentStep: Step;
history: StepLog[];
rawCardData: CardData;
isoMessage?: ISOMessage;
encryptedPayload?: string;
routingPath: Node[];
decision?: IssuerDecision;
};type StepLog = {
step: string;
timestamp: number;
input: any;
output: any;
explanation: string;
};- Playback Controls (Play / Step / Reset)
- Network Flow Visualization
- Step Timeline
- Data Inspector Panel
- Animated movement across nodes
- Real-time state updates
- Expandable fields
- Human-readable formatting
- Nested structure visualization
- Tag-level inspection
- Raw vs encrypted comparison
- Step-by-step transformation
All operations are in-memory.
Simulation logic is synchronous and deterministic.
- No delays in engine
- Animations handled by UI layer
- Zustand store slices
- Avoid deep re-renders
- Web Workers for heavy computation (if needed)
- No real card data
- No payment gateway integration
- No real encryption protocols
- Fully simulated environment
Users will understand:
-
Structure of ISO 8583 messages
-
EMV TLV data encoding
-
Where encryption occurs in payment flows
-
Roles of:
- Terminal
- Acquirer
- Network
- Issuer
-
Decision-making logic in transaction authorization
- Do not treat ISO as raw strings
- Do not hide intermediate states
- Do not mix UI with business logic
- Do not simulate unnecessary real-world complexity
- Always log transformations
This system is not just a simulator.
It is:
A deterministic, inspectable transaction engine that makes invisible payment flows visible.
If built correctly, it becomes:
- A teaching tool
- A debugging framework
- A conceptual reference for fintech systems
- Transaction replay system
- Side-by-side comparison
- Fraud scenario simulations
- Latency toggles
- Multi-transaction batching
Deep Transaction Simulator is designed to bridge the gap between:
βI know payments existβ and βI understand exactly how they work internally.β