Skip to main content

MQTT

Learn how to use MQTT for presentations.

The system enables the presentation and verification of credentials between mobile devices over MQTT.

What is MQTT

MQTT is a publish-subscribe, or "pub-sub", messaging protocol for device to device communication. Devices communicate with a "broker", software responsible for coordinating messages between connected devices.

MQTT with two devices

Devices publish and subscribe to "topics" to send and receive messages. The broker manages a the message queue, sending published messages to the devices subscribed to the relevant topics. All messages between devices and the broker are encrypted; the broker is effectively a post office, receiving and sending messages along without opening the envelopes and packages.

What is implemented

Procivis One implements a proprietary adaptation of OID4VP over BLE using the MQTT channel. The flow is the same, but instead of establishing a BLE connection, the verifier and wallet devices are connected to the same broker and publish and subscribe to shared topics.

How it works

Verifiers put the URL of their broker in the system configuration. When the mobile verifier creates an OID4VP proof request that includes MQTT, it subscribes to a newly created topic and the connection information, including an ephemeral public key, is shared to the wallet holder via the QR code.

The wallet responds by publishing its identification information. Once both devices compute the session key, all subsequent communications are encrypted. The verifier makes a proof request and the wallet responds. After either accepting or rejecting the request, the devices unsubscribe from all topics and the session is closed.

Related guide: System configuration: transport parameters

Dynamic transport choice

Procivis One enables mobile devices exchanging with OID4VP to dynamically choose between using MQTT or BLE according to the situation. When both MQTT and BLE are used by the verifier, the wallet can choose how to connect according to what it supports and prefers.

This enables mobile devices to use a fast and efficient transport when they have internet connectivity and dynamically switch to an offline transport as needed.

See the transport array for how the system determines which transport to use:

See the transport object of the configuration for setting order preferences.