<?xml version="1.0" encoding="utf-8"?>
<rfc version="3" docName="draft-luo-orasrs-decentralized-threat-signaling-01" category="std" ipr="trust200902" submissionType="IETF" xml:lang="en">
  <front>
    <title abbrev="DTSP">Decentralized Threat Signaling Protocol (DTSP) using OraSRS</title>
    <seriesInfo name="Internet-Draft" value="draft-luo-orasrs-decentralized-threat-signaling-01"/>
    
    <author fullname="Ziqian Luo" initials="Z." surname="Luo">
      <organization>OraSRS Protocol</organization>
      <address>
        <email>luo.zi.qian@orasrs.net</email>
      </address>
    </author>
    
    <date year="2025" month="December" day="19"/>
    <area>Security</area>
    <workgroup>Network Working Group</workgroup>
    <keyword>DDoS</keyword>
    <keyword>Decentralized</keyword>
    <keyword>Threat Intelligence</keyword>
    <abstract>
      <t>This document specifies the Decentralized Threat Signaling Protocol (DTSP), a mechanism for distributed edge clients to collaboratively detect, report, and mitigate network threats. The protocol defines a state machine for threat lifecycle management (T0-T3), a standardized data format for threat signaling, and security mechanisms to prevent abuse in a permissionless environment.</t>
    </abstract>
  </front>
  
  <middle>
    <section anchor="introduction" title="Introduction">
      <t>The increasing sophistication of network attacks requires a collaborative defense mechanism that operates at the edge. Centralized systems introduce unacceptable latency and single points of failure. DTSP shifts the paradigm from 'Filter then Verify' to 'Verify then Filter', enabling &lt; 1ms response times at the edge while maintaining global consensus integrity.</t>
      <t>DTSP enables a decentralized network of edge clients to share threat intelligence in real-time, leveraging a blockchain-based consensus mechanism for verification.</t>
      <t>See Figure 1 (Architecture Diagram) for the interaction between Kernel Space, User Space, and the Consensus Layer. [Reference: https://github.com/srs-protocol/OraSRS-protocol/docs/]</t>
    </section>
    
    <section anchor="terminology" title="Terminology">
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" 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>
    </section>
    
    <section anchor="protocol-logic" title="Protocol Logic">
      <t>The lifecycle of a threat in DTSP is modeled as a Finite State Machine (FSM). Each edge client maintains the state of detected threats.</t>
      
      <section anchor="state-machine" title="State Machine">
        <t>The FSM consists of the following states:</t>
        <ul>
          <li><strong>IDLE</strong>: No threat detected.</li>
          <li><strong>OPTIMISTIC_BLOCK (T0)</strong>: Local detection of suspicious activity. Immediate local mitigation.</li>
          <li><strong>REPORTED (T1)</strong>: Threat evidence submitted to the network.</li>
          <li><strong>VERIFIED (T2)</strong>: Network consensus reached. Threat confirmed.</li>
          <li><strong>GLOBAL_ENFORCE (T3)</strong>: Global propagation of the threat signature.</li>
          <li><strong>EXPIRED</strong>: Threat entry validity period ended.</li>
        </ul>
      </section>
      
      <section anchor="state-transitions" title="State Transitions">
        <section anchor="t0-local-detection" title="T0: Local Detection">
          <t>The Edge Client <bcp14>MUST</bcp14> transition to the <tt>OPTIMISTIC_BLOCK</tt> state immediately upon detection of traffic matching local heuristic rules (e.g., high-frequency connection attempts).</t>
          <t>In this state, the client:</t>
          <ol>
            <li><bcp14>MUST</bcp14> block the source IP locally.</li>
            <li><bcp14>SHOULD</bcp14> generate a <tt>ThreatEvidence</tt> package.</li>
          </ol>
          
          <section anchor="outbound-c2-interception" title="Outbound C2 Interception">
            <t>In addition to inbound defense, the Edge Client <bcp14>MUST</bcp14> inspect outbound traffic for patterns matching known C2 (Command &amp; Control) signatures.</t>
            <ul>
              <li><strong>Pre-Release Query</strong>: Outbound connections to suspicious domains/IPs trigger a synchronous lookup in the Local Cache.</li>
              <li><strong>T0 Block</strong>: If a match is found, the connection is terminated immediately at the kernel level to prevent data exfiltration.</li>
            </ul>
            <t>This mechanism protects against private key exfiltration from compromised nodes and botnet command reception. Implementation <bcp14>MUST</bcp14> use kernel-space filtering (e.g., Netfilter/eBPF) to achieve sub-millisecond interception latency.</t>
          </section>
        </section>
        
        <section anchor="t1-signaling" title="T1: Signaling">
          <t>The Edge Client <bcp14>MUST</bcp14> transition to the <tt>REPORTED</tt> state after generating valid evidence. The client sends a <tt>ThreatSignal</tt> message to the network.</t>
          <t>To prevent front-running, the client <bcp14>MUST</bcp14> use a Commit-Reveal scheme:</t>
          <ol>
            <li><strong>Commit</strong>: Send <tt>Hash(Evidence + Salt)</tt>.</li>
            <li><strong>Reveal</strong>: Send <tt>Evidence + Salt</tt> after a random delay.</li>
          </ol>
        </section>
        
        <section anchor="t2-verification" title="T2: Verification">
          <t>The state transitions to <tt>VERIFIED</tt> when the network (via Smart Contract or Oracle) validates the evidence. A threat is considered verified if: <tt>Sum(Reputation(Reporters)) &gt; Threshold</tt></t>
        </section>
        
        <section anchor="t3-global-enforcement" title="T3: Global Enforcement">
          <t>Upon entering the <tt>GLOBAL_ENFORCE</tt> state, the threat signature is added to the Global Blocklist. All participating clients <bcp14>MUST</bcp14> synchronize this list and enforce blocking rules via their local kernel datapath (e.g., eBPF).</t>
        </section>
      </section>
    </section>
    
    <section anchor="data-format" title="Data Format">
      <section anchor="threat-signal" title="Threat Signal">
        <t>The <tt>ThreatSignal</tt> message is used to report a detected threat. It is serialized using JSON.</t>
        <table align="center">
          <thead>
            <tr>
              <th>Field</th>
              <th>Type</th>
              <th>Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td><tt>version</tt></td>
              <td>uint8</td>
              <td>Protocol version (e.g., 1)</td>
            </tr>
            <tr>
              <td><tt>type</tt></td>
              <td>uint8</td>
              <td>Threat type (0=DDoS, 1=Scanning, 2=Malware)</td>
            </tr>
            <tr>
              <td><tt>source_ip</tt></td>
              <td>bytes</td>
              <td>IP address of the attacker (4 or 16 bytes for IPv4/IPv6)</td>
            </tr>
            <tr>
              <td><tt>target_ip</tt></td>
              <td>bytes</td>
              <td>IP address of the victim (4 or 16 bytes for IPv4/IPv6, optional)</td>
            </tr>
            <tr>
              <td><tt>timestamp</tt></td>
              <td>uint64</td>
              <td>Unix timestamp of detection (ms)</td>
            </tr>
            <tr>
              <td><tt>evidence</tt></td>
              <td>bytes</td>
              <td>Cryptographic proof or log snippet</td>
            </tr>
            <tr>
              <td><tt>signature</tt></td>
              <td>bytes</td>
              <td>Digital signature of the reporting client</td>
            </tr>
          </tbody>
        </table>
      </section>
      
      <section anchor="evidence-package" title="Evidence Package">
        <table align="center">
          <thead>
            <tr>
              <th>Field</th>
              <th>Type</th>
              <th>Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td><tt>packet_dump</tt></td>
              <td>bytes</td>
              <td>Sample of malicious packets (pcap format)</td>
            </tr>
            <tr>
              <td><tt>flow_stats</tt></td>
              <td>struct</td>
              <td>Flow statistics (PPS, BPS, duration)</td>
            </tr>
            <tr>
              <td><tt>heuristics</tt></td>
              <td>string</td>
              <td>ID of the heuristic rule triggered</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>
    
    <section anchor="operational-considerations" title="Operational Considerations">
      <section anchor="resource-constraints-performance" title="Resource Constraints &amp; Performance">
        <t>The protocol is designed for resource-constrained edge environments (e.g., 512MB RAM). Implementation validation (v3.3.6) has demonstrated:</t>
        <ul>
          <li><strong>Latency</strong>: The T0 local heuristic limiter (eBPF) achieves a query latency of 0.001ms (40x better than the 0.04ms target).</li>
          <li><strong>Throughput</strong>: Capable of mitigating 40M PPS (SYN-Flood) on standard edge hardware while maintaining 100% availability of management channels (SSH).</li>
          <li><strong>Footprint</strong>: The complete agent operates within &lt; 50MB (Hybrid Mode) or &lt; 5MB (Native Mode) of memory.</li>
        </ul>
        <t>Implementers <bcp14>MUST</bcp14> prioritize kernel-space offloading (e.g., Netfilter/eBPF) to meet these latency requirements.</t>
      </section>
      
      <section anchor="deployment-modes" title="Deployment Modes">
        <t>DTSP supports three deployment modes:</t>
        <ol>
          <li><strong>T0-Only (Standalone)</strong>: Edge client operates independently without blockchain connectivity. Suitable for air-gapped environments or maximum stability requirements.</li>
          <li><strong>T0+T2 (Hybrid)</strong>: Edge client with optional blockchain queries for enhanced threat intelligence. Recommended for most deployments.</li>
          <li><strong>T0+T2+T3 (Full)</strong>: Complete decentralized consensus with threat reporting capabilities.</li>
        </ol>
        <t>Default configuration <bcp14>SHOULD</bcp14> disable T2/T3 modules to ensure maximum stability on resource-constrained devices.</t>
      </section>
      
      <section anchor="performance-validation" title="Performance Validation">
        <t>Reference implementation testing (2025-12-19):</t>
        <ul>
          <li><strong>Test Environment</strong>: Linux 5.14.0, 4 CPU cores, 4.1Gi RAM.</li>
          <li><strong>API Latency</strong>: 19-24ms (P95 &lt; 50ms).</li>
          <li><strong>eBPF Query</strong>: 0.001ms average.</li>
          <li><strong>Stress Test</strong>: 38,766 requests, 0 failures (100% success rate).</li>
          <li><strong>Memory Usage</strong>: 25.45 MB for 1516 threat entries.</li>
        </ul>
      </section>
    </section>
    
    <section anchor="security-considerations" title="Security Considerations">
      <section anchor="sybil-attack-defense" title="Sybil Attack Defense">
        <t>To prevent Sybil attacks where an adversary creates multiple identities to flood the network with false reports, DTSP utilizes a Reputation System.</t>
        <ul>
          <li>Each client <bcp14>MUST</bcp14> stake tokens to participate in reporting.</li>
          <li>The weight of a report is proportional to the client's <tt>ReputationScore</tt>.</li>
          <li><tt>ReputationScore</tt> increases with valid reports and decreases with false positives.</li>
        </ul>
      </section>
      
      <section anchor="commit-reveal-mechanism" title="Commit-Reveal Mechanism">
        <t>To prevent "free-riding" (copying others' reports) or front-running:</t>
        <ol>
          <li>Clients <bcp14>MUST NOT</bcp14> broadcast raw evidence immediately.</li>
          <li>Clients <bcp14>MUST</bcp14> broadcast <tt>Commit = Hash(Evidence | Nonce)</tt>.</li>
          <li>After <tt>T_reveal</tt> blocks, clients <bcp14>MUST</bcp14> broadcast <tt>Reveal = (Evidence, Nonce)</tt>.</li>
          <li>The network verifies <tt>Hash(Reveal) == Commit</tt>.</li>
        </ol>
      </section>
    </section>
    
    <section anchor="iana-considerations" title="IANA Considerations">
      <t>This document has no IANA actions.</t>
    </section>
  </middle>
  
  <back>
    <references title="Normative References">
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
        </front>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" xml:base="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
        </front>
      </reference>
    </references>
    
    <references title="Informative References">
      <reference anchor="OraSRS-Paper" target="https://doi.org/10.31224/5985">
        <front>
          <title>OraSRS: A Compliant and Lightweight Decentralized Threat Intelligence Protocol</title>
          <author fullname="Luo Ziqian" initials="Z." surname="Luo">
            <organization/>
          </author>
          <date year="2025"/>
        </front>
      </reference>
    </references>
  </back>
</rfc>