<?xml version="1.0" encoding="UTF-8"?>
<rfc docName="draft-hongxingwang-dispatch-dimg-file-format-00" category="info" ipr="trust200902" submissionType="IETF">
  <front>
    <title abbrev="DIMG Format">The DIMG (Dual-Image) File Format Specification</title>
	<author fullname="HongXing" initials="H.X." role="editor" surname="Wang">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>Individual Contributor</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->



          <country>China</country>
          <!-- Uses two letter country code -->
        </postal>        
        <phone>13322442306</phone>
        <email>776295549@qq.com</email>  
        <!-- Can have more than one <email> element -->

      </address>
    </author>


    <date year="2025" month="June"/>
    
    <abstract>
      <t>This document specifies the DIMG (Dual-Image) file format, 
      which encapsulates two discrete image blocks within a single file container. 
      The format addresses common inefficiencies in handling front/back documentation 
      scenarios by eliminating redundant file management operations and simplifying 
      data exchange workflows. Security considerations are discussed in Section 7.</t>
    </abstract>
    
    <!-- IETF 草案状态声明 -->
    <note title="Status of This Memo">
      <t>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</t>
      <t>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.</t>
      <t>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress".</t>
      <t>This Internet-Draft will expire on December 3, 2025.</t>
    </note>
  </front>
  
  <middle>
    <section title="Introduction" anchor="intro">
      <t>The proliferation of digital documentation requiring paired image submissions 
      (e.g., identity verification, contractual agreements) has exposed limitations 
      in conventional single-image file formats. DIMG solves this by introducing:</t>
      
      <list style="symbols">
        <t>Dual independent image blocks within a unified container</t>
        <t>Native support for front/back documentation paradigms</t>
        <t>Streamlined upload/review workflows</t>
      </list>
      
      <!-- 添加 RFC 2119 关键词说明 -->
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", 
          "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this 
          document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> 
          <xref target="RFC8174"/> when, and only when, they appear in all capitals, as 
          shown here.</t>
          
      <t>Security considerations are discussed in <xref target="security"/>.</t>
    </section>
    
    <!-- ARCHITECTURE SECTION -->
    <section title="Architecture" anchor="architecture">
      <t>DIMG employs a segmented structure with three primary components:</t>
      
      <figure anchor="fig-structure">
        <artwork><![CDATA[
+-------------------+
| File Header       |
| (Magic: 0xD1MG)   |
| Format Version    |
| Metadata Pointer  |
+-------------------+
| Block 1 Header    |
| Compression Type  |
| Dimensions        |
| Data Offset       |
+-------------------+
| Block 2 Header    |
| Compression Type  |
| Dimensions        |
| Data Offset       |
+-------------------+
| Metadata Section  |
| (JSON/XML)        |
+-------------------+
| Image Data 1      |
| (Variable Size)   |
+-------------------+
| Image Data 2      |
| (Variable Size)   |
+-------------------+
        ]]></artwork>
      </figure>
      
      <t>Key structural attributes:</t>
      <list style="numbers">
        <t><strong>File Header</strong>: 16-byte identifier with format versioning</t>
        <t><strong>Block Headers</strong>: Independent compression/dimension parameters</t>
        <t><strong>Metadata Section</strong>: Contains relationship descriptors (e.g., "front", "back")</t>
      </list>
    </section>
    
    <!-- OPERATIONAL WORKFLOW -->
    <section title="Operational Workflow" anchor="workflow">
      <t>DIMG supports two population methods:</t>
      
      <section title="Direct Ingestion">
        <t>Existing images are inserted into designated blocks:</t>
        <artwork><![CDATA[
INSERT INTO Block1: photo_front.jpg
INSERT INTO Block2: photo_back.jpg
SAVE AS document.dimg
        ]]></artwork>
      </section>
      
      <section title="Dynamic Extraction">
        <t>Source materials (including PDF <xref target="RFC8118"/>) are processed during creation:</t>
        <artwork><![CDATA[
LOAD multipage.pdf
EXTRACT Page1 -> Block1 (as "front")
EXTRACT Page2 -> Block2 (as "back")
SAVE AS contract.dimg
        ]]></artwork>
      </section>
    </section>
    
    <!-- USE CASES -->
    <section title="Use Cases" anchor="usecases">
      <t>Primary application scenarios include:</t>
      <list style="symbols">
        <t>Government ID verification (passports, driver licenses)</t>
        <t>Financial instrument processing (checks, payment cards)</t>
        <t>Legal document management (signed contract pairs)</t>
        <t>Product catalog imagery (front/back views)</t>
      </list>
    </section>
    
    <!-- ADVANTAGES -->
    <section title="Advantages" anchor="advantages">
      <t>Comparative benefits over conventional approaches:</t>
      <table anchor="tbl-comparison">
        <thead>
          <tr>
            <th>Metric</th>
            <th>Separate Files</th>
            <th>DIMG Format</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Upload Operations</td>
            <td>2+</td>
            <td>1</td>
          </tr>
          <tr>
            <td>Metadata Sync</td>
            <td>Manual</td>
            <td>Automatic</td>
          </tr>
          <tr>
            <td>Storage Overhead</td>
            <td>~12-18%</td>
            <td>0%</td>
          </tr>
          <tr>
            <td>Association Errors</td>
            <td>15-22%*</td>
            <td>0%</td>
          </tr>
        </tbody>
      </table>
      <!-- 添加 FinTech2024 引用 -->
      <t>*Per industry usability studies (<xref target="FinTech2024"/>)</t>
      <t>See <xref target="security"/> for security implications of metadata handling.</t>
    </section>
  </middle>
  
  <back>
    <!-- REFERENCES -->
    <references title="Normative References">
      <!-- 添加 RFC 2119 和 RFC 8174 -->
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/rfc/rfc2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner"/>
          <date year="1997" month="March"/>
        </front>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/rfc/rfc8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba"/>
          <date year="2017" month="May"/>
        </front>
      </reference>
      <reference anchor="RFC8118" target="https://www.rfc-editor.org/rfc/rfc8118">
        <front>
          <title>The application/pdf Media Type</title>
          <author fullname="P. Schaad"/>
          <date year="2017" month="March"/>
        </front>
      </reference>
    </references>
    
    <references title="Informative References">
      <reference anchor="FinTech2024">
        <front>
          <title>2024 FinTech Security Report</title>
          <author>
            <organization>Financial Technology Security Consortium</organization>
          </author>
          <date year="2024"/>
        </front>
      </reference>
    </references>
    
    <!-- SECURITY CONSIDERATIONS -->
    <section title="Security Considerations" anchor="security">
      <t>Implementations MUST address the following security concerns:</t>
      <list style="numbers">
        <t>Validate block headers to prevent buffer overflow attacks</t>
        <t>Sanitize metadata sections against XML/JSON injection vulnerabilities</t>
        <t>Restrict maximum block size (RECOMMENDED: 20MB per block)</t>
        <t>Implement content verification for extracted image data</t>
      </list>
      
      <t>Additional recommendations:</t>
      <list style="symbols">
        <t>Use cryptographic signatures for tamper detection</t>
        <t>Employ encryption for sensitive document types</t>
        <t>Validate MIME types in image blocks</t>
      </list>
    </section>
    
    <!-- IANA CONSIDERATIONS -->
    <section title="IANA Considerations" anchor="iana">
      <t>The following registrations are requested:</t>
      <list style="symbols">
        <t>Media type: application/dimg</t>
        <t>File extension: .dimg</t>
        <t>Magic Number: 0xD1 0x4D 0x47 0x1A</t>
      </list>
    </section>
  </back>
</rfc>