Skip to main content

Transport Layer

At the physical level, data is encoded into a series of QR codes to facilitate their transmission between devices. This layer defines the methods for structuring information and generating QR codes for efficient data reading and transmission. Each QR code contains part of the information necessary for decoding at the subsequent levels.

Bitahon Transport Layer

Data processing follows these steps:

  1. SHA256 Hashing: Before encoding into QR codes, the payload undergoes the SHA256 hashing algorithm. The first 4 bytes of the hash result serve as a checksum for data integrity verification.

  2. Data Compression: The payload is compressed using the Deflate algorithm to reduce data size before being divided into fragments.

  3. Fragmentation: Compressed data is divided into fragments, each not exceeding the Maximum Transmission Unit (MTU), typically set to 256 bytes by default.

  4. Encoding into QR Code Frames: Each data fragment is encoded into a QR Code frame, containing a header and data. The QR Code frame header consists of 5 bytes, where:

    • The first byte represents the version (currently set to 0x01).
    • The second and third bytes represent the uint16be frame number.
    • The fourth and fifth bytes represent the uint16be total number of frames.

This process ensures efficient encoding and transmission of data through QR codes with integrity control and support for data fragmentation.