Technical Architecture of the EMV Integrated Circuit Card Standard
In global retail payments, the transition from magnetic stripe cards to chip cards was standardized by EMVCo—a consortium founded by Europay, Mastercard, and Visa, later joined by American Express, JCB, Discover, and UnionPay. The core architecture is codified across four foundational technical manuals known throughout the FinTech industry as the EMV Books:
- EMV Book 1: Architecture, Electrical Parameters, and Physical Transport Protocols (ISO/IEC 7816-1, -2, -3, and Application Selection via ISO/IEC 7816-4).
- EMV Book 2: Security and Cryptographic Architecture (RSA Public Key Infrastructure, Static/Dynamic Data Authentication, Symmetric Session Key Derivation, ARQC / ARPC generation).
- EMV Book 3: Application Processing, Transaction Flow, Cardholder Verification Methods (CVM), Terminal Risk Management, and Action Analysis.
- EMV Book 4: Cardholder, Merchant, and Acquirer Terminal Interface Requirements and ISO 8583 Field 55 Data Mapping.
ISO/IEC 8825 BER-TLV Encoding Syntax Demystified
Every data object exchanged between an EMV chip card and a payment terminal is structured according to Basic Encoding Rules (BER) for Type-Length-Value (TLV) elements as specified in ISO/IEC 8825 and ISO/IEC 7816-4.
1. Tag Field Anatomy (1 to 3 Bytes)
The Tag field identifies the specific data element. In binary, the first byte of a tag conveys both structural class and primitive/constructed nature:
| Bit Position | Bit Value | Significance in BER-TLV |
|---|---|---|
| Bits 8 & 7 (Class) | 00 | Universal Class (defined by ISO/IEC 8825) |
| Bits 8 & 7 (Class) | 01 | Application Class (e.g. Tag 4F, Tag 50, Tag 82, Tag 95) |
| Bits 8 & 7 (Class) | 10 | Context-Specific Class (e.g. Tag 9F02, Tag 9F1A, Tag 9F37) |
| Bits 8 & 7 (Class) | 11 | Private Class (e.g. Tag DF8129 Mastercard Kernel 2 tags) |
| Bit 6 (Structure) | 0 | Primitive: Value contains raw data bytes |
| Bit 6 (Structure) | 1 | Constructed: Value contains nested TLV objects |
| Bits 5 through 1 | 11111 (0x1F) | Multi-Byte Tag: Tag extends into subsequent bytes |
2. Length Field Mechanics: Short Form vs Long Form
The Length field indicates the number of bytes that constitute the Value field:
- Definite Short Form: If the value is 127 bytes or fewer, bit 8 is set to
0, and bits 7 through 1 state the integer length (e.g.,0x06indicates 6 bytes;0x20indicates 32 bytes). - Definite Long Form: If the value is 128 bytes or greater, bit 8 is set to
1, and bits 7 through 1 specify how many subsequent bytes represent the length integer. For example,0x81 0x90indicates a 1-byte length field of 144 bytes;0x82 0x01 0x20represents a 2-byte length field of 288 bytes.
Critical EMV Tags in the Transaction Flow
During an EMV transaction, terminal and card execute an interactive dialog governed by APDU (Application Protocol Data Unit) commands. The following tags represent pivotal operational milestones:
| Tag | Name | Length / Format | Role in Transaction Execution |
|---|---|---|---|
4F | Application Identifier (AID) | 5–16 bytes (b) | Identifies the payment brand and product (e.g., A0000000031010 for Visa Credit, A0000000041010 for Mastercard). |
82 | Application Interchange Profile (AIP) | 2 bytes (b) | Returned in response to GET PROCESSING OPTIONS; signals card authentication capabilities (SDA, DDA, CDA). |
9F02 | Amount, Authorized (Numeric) | 6 bytes (n 12) | Primary transaction monetary total expressed in minor currency units (e.g., $25.00 is 000000002500). |
9F37 | Unpredictable Number (UN) | 4 bytes (b) | Random nonce generated by the POS terminal to prevent replay attacks against the card application cryptogram. |
95 | Terminal Verification Results (TVR) | 5 bytes (b) | Cumulative audit log recording all offline auth failures, expired card flags, and CVM results prior to cryptogram creation. |
9F26 | Application Cryptogram (AC) | 8 bytes (b) | The cryptographic proof of card authenticity (ARQC, TC, or AAC) generated via 3DES or AES MAC over CDOL1 data. |
9F36 | Application Transaction Counter (ATC) | 2 bytes (b) | Monotonically increasing integer counter stored in card EEPROM; protects against cloned magnetic-stripe replays. |
Deep Dive: Terminal Verification Results (Tag 95 TVR)
The Terminal Verification Results (TVR) is arguably the most vital diagnostic data element in all of payment terminal debugging. When an EMV chip transaction is declined by an issuer or forced online, the 5-byte TVR bitmask pinpoints the exact technical cause:
Byte 1: Offline Data Authentication
Bit 8: Offline data authentication was not performed
Bit 7: SDA failed
Bit 6: ICC data missing
Bit 5: Card appears on terminal exception file (hotlist)
Bit 4: DDA failed
Bit 3: CDA failed
Byte 2: Cardholder Verification & Application Checks
Bit 8: ICC and terminal have different application versions
Bit 7: Expired application (Transaction Date > Tag 5F24)
Bit 6: Application not yet effective (Transaction Date < Tag 5F25)
Bit 5: Requested service not allowed for card product (AUC Tag 9F07)
Bit 4: New card (first transaction)
Byte 3: Cardholder Verification Method (CVM) Status
Bit 8: Cardholder verification was not successful
Bit 7: Unrecognised CVM
Bit 6: PIN Try Limit exceeded
Bit 5: PIN entry required and PIN pad not present or not working
Bit 4: PIN entry required, PIN pad present, but PIN not entered
Bit 3: Online PIN entered
Byte 4: Terminal Risk Management
Bit 8: Transaction amount exceeds floor limit
Bit 7: Lower consecutive offline limit exceeded
Bit 6: Upper consecutive offline limit exceeded
Bit 5: Transaction selected randomly for online processing
Bit 4: Merchant forced transaction online
Byte 5: Completion & Issuer Scripting
Bit 8: Default TDOL used
Bit 7: Issuer authentication failed (ARPC cryptogram rejected)
Bit 6: Script processing failed before final GENERATE AC
Bit 5: Script processing failed after final GENERATE AC Troubleshooting Tip for Payment Gateway Integrators
If a gateway returns decline reason code 05 (Do Not Honor) on chip transactions, inspect TVR Byte 2 Bit 7 (Expired card) and TVR Byte 3 Bit 6 (PIN Try Limit exceeded). In over 80% of integration defects, the POS terminal operating system clock is set incorrectly in UTC, causing cards expiring at the end of the month to be falsely flagged as expired!
Application Cryptograms: ARQC, TC, and AAC Explained
At the conclusion of terminal action analysis, the POS issues the GENERATE AC command to the smart card chip, providing the concatenated data elements requested in CDOL1 (Tag 8C). The card evaluates the inputs against its internal risk parameters and issues one of three cryptogram types in Tag 9F26:
- Authorization Request Cryptogram (ARQC - Tag 9F27 = 0x80): The card requests online authorization from the issuing bank. The terminal forwards the ARQC, ATC (Tag 9F36), UN (Tag 9F37), and transaction details in ISO 8583 Field 55 to the payment network. The issuer HSM derives the card session key, recalculates the MAC, and returns an Authorization Response Cryptogram (ARPC) in Field 55 with Tag 8A (Response Code).
- Transaction Certificate (TC - Tag 9F27 = 0x40): The card approves the transaction offline without contacting the issuer host. The TC serves as cryptographic proof that the card approved the offline transaction under authorized floor limits.
- Application Authentication Cryptogram (AAC - Tag 9F27 = 0x00): The card refuses to process or authorize the transaction, resulting in immediate offline terminal termination.
Contactless EMV Kernels (Mastercard PayPass, Visa payWave, Amex ExpressPay)
In contactless (NFC) EMV transactions codified under the EMV Contactless Specifications (Books A through D), different payment schemes utilize dedicated Kernels:
- Kernel 1: JCB Contactless Specification.
- Kernel 2: Mastercard PayPass (utilizing proprietary tags like
DF8117Card Data Input Capability andDF8129Outcome Parameter Set). - Kernel 3: Visa payWave (qVSDC / Quick Visa Smart Debit Credit).
- Kernel 4: American Express ExpressPay.
- Kernel 6: Discover DPAS Contactless.
- Kernel 7: UnionPay QuickPass.