Back to selected work
01Fintech EngineeringLead Developer
Library

Turning raw EMV protocol payloads into readable engineering insights.

A TypeScript-based toolkit designed to parse, validate, and structure complex EMV/TLV payloads. The project combines a protocol parsing library, a CLI debugging interface, and automated specification extraction to reduce the operational friction of working with payment protocol data.

TypeScriptNode.jsCLICheerioEMV / TLVHex Parsing

Raw APDU Stream

6FFCI Template
Reading tag…
84DF Name
A0 00 00 00 03 10 10
9F 26Application Cryptogram
3C A1 F2 B4 D0 11 22 33
9F 36ATC
00 4F

Parsing Pipeline

TokenizeDecodeRecurseValidateEnrich

Structured TLV Tree

6F — File Control Information

Validation Output

Current tag6F
Decoded length--
Spec matchChecking
Node stateParsing

Context

Payment protocol integration often happens at the byte level. Engineers frequently inspect raw APDU exchanges containing deeply nested TLV structures encoded as hexadecimal data. Understanding these payloads requires both protocol expertise and time-consuming manual decoding. During debugging and integration work, teams were repeatedly isolating tags, calculating lengths, and cross-referencing EMV specifications just to understand what the payload actually represented.

Challenge

The core problem was not only decoding TLV structures, but making protocol data operationally understandable. Manual inspection of hex payloads slowed down debugging workflows and increased the risk of interpretation errors. Engineers needed a reliable way to parse nested TLV data, validate malformed payloads, and surface meaningful information without repeatedly consulting fragmented specification documents.

Constraints

  • Support deeply nested TLV structures and constructed tags.
  • Handle malformed or incomplete payloads without crashing.
  • Expose both a reusable TypeScript library and a CLI debugging tool.
  • Reduce dependency on manual EMV specification lookup.
  • Remain fast enough for day-to-day engineering debugging workflows.

Approach

How the system was designed

A structured overview of the implementation strategy, from architecture decisions to developer-facing tooling.

Modular TLV Parsing Engine

The core of the toolkit is a TypeScript parsing engine responsible for decoding tag, length, and value segments from raw hexadecimal payloads. The parser supports recursive decoding for constructed tags, allowing nested TLV structures to be reconstructed into a structured tree representation.

Developer-Focused CLI Interface

A CLI layer was built on top of the parsing engine to allow engineers to quickly inspect payloads from the terminal. This made the tool directly usable during debugging sessions without requiring a graphical interface or additional tooling.

Automated EMV Metadata Extraction

To eliminate repeated specification lookups, a Cheerio-based scraper was implemented to extract EMV tag definitions and normalize them into machine-readable metadata. This metadata enriches the parsed output with semantic context such as tag names and descriptions.

Engineering Decisions

Trade-offs, structure, and technical intent

The goal was not just to ship a feature, but to build something maintainable, legible, and credible in a high-constraint environment.

TypeScript for Protocol Safety

Strong TypeScript typings allowed the parser output to be modeled explicitly, ensuring consistent structures when dealing with nested TLV nodes. This improved reliability for both library consumers and CLI outputs.

Composable Parsing Architecture

The parsing pipeline separates tokenization, decoding, metadata enrichment, and validation. This modular approach simplified testing and made the system easier to extend as new protocol behaviors or specifications emerged.

CLI + Library Dual Interface

Providing both a reusable library and a CLI ensured the toolkit could be integrated into codebases while also serving as a standalone debugging tool for engineers analyzing protocol traffic.

Outcomes

  • Reduced debugging time during payment integration by roughly 50%.
  • Provided engineers with structured insights instead of raw hexadecimal payloads.
  • Centralized EMV tag metadata into a reusable internal resource.
  • Improved reliability when analyzing malformed or partially valid protocol data.

Metrics

Debugging Time Reduction

50%

Protocol Tags Parsed

100+

Core Utility Adoption

Internal Engineering Tool

Next case study

Fintech Design System

Enterprise-grade component library and design token system built for a major national payment network to unify web and terminal interfaces.