RF Wireless World

Browse articles, tutorials, tools, and vendors.

Matter QR Code: Base-38 Encoding Language

By RF Wireless Expert Team

Introduction : Unlike a typical restaurant menu QR code that simply sends your phone to a website, a Matter QR code is designed to work entirely offline. It contains a dense, highly structured “Onboarding Payload” that gives your smartphone (the Commissioner) the exact blueprint it needs to discover, securely authenticate and configure the device without ever pinging a cloud server. Let us explore anatomy of a Matter QR code and what is actually hidden inside that little square of pixels.

1. The Prefix: “MT:”

If you were to scan a Matter QR code with a generic barcode scanner, the text output would always start with “MT:”. This simple 3-character prefix acts as a universal flag. It tells your smartphone’s operating system (like iOS or Android), “Stop! This isn’t a website; this is a Matter smart home device.”

2. The Language: Base-38 Encoding

After the MT: prefix, the rest of the string looks like absolute gibberish. Matter doesn’t use standard text or even standard Base-64 encoding. Instead, it uses a highly specialized format called Base-38.

Why Base-38? QR codes come in different “Versions” and error correction levels. If you use a specific subset of alphanumeric characters, the physical printed size of the QR code can be kept incredibly small while still being easy for cheap cameras to read. The Base-38 alphabet strips out confusing characters and symbols, allowing Matter to compress all the necessary setup data into an alphanumeric string that fits easily on a tiny smart plug or light bulb base.

3. Unpacking the Payload: The Core Ingredients

When your phone decodes that Base-38 string, it unlocks a “Packed Binary Data Structure.” Every single bit of data is meticulously arranged. Here is exactly what is inside:

  • Version (3 bits): A tiny marker indicating the version of the QR code payload. Currently set to 000 for Matter 1.0 through 1.6.1, this ensures future versions of Matter can change the payload structure without breaking older devices.

  • Vendor ID & Product ID (16 bits each): This tells your phone exactly who made the device and what it is. Your phone uses this to pull up the correct product name, icon, and setup instructions from the global Distributed Compliance Ledger (DCL).

  • Custom Flow Flags (2 bits): Does the device need you to press a physical button before it pairs? Does it require you to download a manufacturer’s app for a custom calibration? These two bits warn the setup app if the user needs to take extra steps (“User-Intent” or “Custom Commissioning”) before the device will accept a connection.

  • Discovery Capabilities Bitmask (8 bits): Your phone needs to know how to find the device. This bitmask acts as a checklist. It tells the phone: “Look for me on Bluetooth (BLE),” or “I’m already plugged into Ethernet (IP network),” or “I’m using the new Wi-Fi Public Action Frame technology.”

  • The Discriminator (12 bits): Imagine buying a 4-pack of identical smart bulbs and plugging them all in at once. If your phone searches for “Bluetooth Bulb,” all four will answer. The Discriminator is a unique, randomized 12-bit number (from 0 to 4095) assigned to that specific bulb. The QR code tells your phone, “Ignore the others, only connect to the bulb shouting discriminator number 3402.”

  • The Setup Passcode (27 bits): This is the crown jewel of the payload. It represents an 8-digit decimal number (from 00000001 to 99999998). This is the highly secure cryptographic secret used to create the initial PASE (Passcode-Authenticated Session Establishment) tunnel. Because it is embedded in the QR code, your phone and the device can establish military-grade encryption without you having to type the number manually.

4. The Extras: Padding and TLV Data

After the core ingredients, the payload is padded with zeros to ensure it aligns perfectly with computer byte boundaries. However, manufacturers can also append optional data to the end of the QR code using a format called TLV (Tag Length Value).

Manufacturers might use this extra space to embed the device’s exact Serial Number or even a custom URL. This allows customer support teams to help users troubleshoot simply by having them read off the manual pairing code or scan the QR code.

5. Multi-Device Codes (Concatenation)

Matter 1.6.1 specification includes clever feature for multi-packs of devices (like a starter kit with three bulbs and a bridge). Instead of making the user scan four separate QR codes, a manufacturer can use Concatenation.

By using an asterisk (*) as a delimiter, multiple Onboarding Payloads can be chained together inside a single, slightly larger QR code printed on the instruction manual. When you scan it, your smart home app automatically unpacks all four payloads, finds all four devices, and commissions them into your home sequentially in one smooth motion.

Summary

A Matter QR code is a masterwork of localized engineering. By packing discovery hints, device identifiers and a cryptographic passcode into a tiny, offline, Base-38 encoded square, Matter ensures that adding a device to your home is not only instantaneous but fundamentally immune to cloud based interceptions.

Continue Learning Matter Protocol

Compare Matter With Other Technologies

Keep Reading