Flow Traps in Silicon: Detecting Hardware Trojan Insertions as Directed Flow Communities

When a malicious foundry or a third-party IP vendor inserts a Hardware Trojan into a gate-level circuit, the inserted logic must connect to the rest of the design somehow — it draws a few inputs from the functional circuit and feeds a payload back into it. Every existing detection strategy looks at what the inserted logic does: whether its signals rarely flip during simulation (HTDet), whether its signals are hard to control or observe with test tools (A Hardware Trojan-Detection Technique Based on Suspicious Circuit Block Partition), or whether it matches the local structural fingerprints of Trojans seen in training (TrojanSAINT). Modern Trojans deliberately defeat all three: TroLL builds triggers out of logic-locking primitives that avoid rare signals entirely, driving ATPG- and SAT-based detection to roughly 0% at 16-bit triggers and toward zero at 24 bits.

This proposal attacks the problem from the side no adversary has been forced to defend: how the inserted logic is wired in. A netlist is a directed graph in which signals flow from primary inputs toward primary outputs, and a Trojan is a subcircuit grafted onto that flow. I propose to model the netlist as a conduit for a directed random walk and apply flow-based community detection — methods that find "trap regions" where a random walker lingers before escaping through a bottleneck — to isolate inserted logic as an anomalous flow community. The detection signal is topological, not statistical: it does not care whether the Trojan's signals are rare, active, or stealthy during test, only that the Trojan forms a tightly coupled module with a disproportionately narrow interface to the functional circuit. This yields an unsupervised, golden-reference-free audit that works precisely where simulation-based and testability-based methods collapse.

Core Claim

A subcircuit inserted into a functioning design — whether a Trojan trigger network or a logic-locking protection structure — forms a distinguishable community under directed flow dynamics on the netlist graph, because its internal wiring reflects the attacker's design process (a self-contained, locally dense module) rather than the global optimization of the host synthesis flow. Two mechanisms from network science make this usable. First, the map equation — a principle that compresses the description of a random walker's path by giving each flow-trapping module its own short codewords (Community Detection with the Map Equation and Infomap: Theory and Applications) — identifies modules by structural flow containment, with no reference circuit and no training labels. Second, Markov Stability — a measure of how long a diffusion process stays inside a partition when run for a time interval $t$ (The stability of a graph partition: A dynamics-based framework for community detection) — lets us zoom across topological scales continuously, replacing the fixed 10-gate distance heuristic that prior netlist partitioning defenses admit is arbitrary (A Hardware Trojan-Detection Technique Based on Suspicious Circuit Block Partition).

Directionality is essential, not decorative. Prior graph-based netlist analysis flattens netlists into undirected graphs (TrojanSAINT; GNNUnlock), discarding the causal flow from inputs to outputs. Kim et al. showed that on directed networks, undirected modularity optimization clusters nodes by source/sink degree roles rather than by functional trapping (Finding communities in directed networks) — exactly the failure mode a netlist auditor cannot afford, since a combinational pipeline is one long directed path. The map equation natively supports directed flows, and LinkRank's PageRank-preserving null model (Finding communities in directed networks) prevents the walk from being biased by asymmetric gate fan-in/fan-out.

Research Program

The work has three components. First, a directed netlist flow model: parse gate-level netlists (ISCAS-85/89, ITC-99, TrustHub, and the TroLL benchmark circuits) into directed graphs with gates as nodes and signal wires as directed edges from fan-in to fan-out, optionally weighting edges by transition probabilities from short random simulation runs — the same signal-activity data HTDet uses, but as flow weights rather than as the detection signal itself, so that a Trojan which stays inactive during simulation still contributes its full topological structure.

Second, a suspicion score over discovered communities. For each module $M$ found by directed Infomap or by Markov Stability at a given Markov time $t$, compute

$$ S(M) \;=\; \frac{|M|}{b(M) + \epsilon}\;\cdot\;\rho(M), $$

where $|M|$ is the number of gates in the module, $b(M)$ is the number of boundary wires crossing between $M$ and the rest of the circuit, $\epsilon$ avoids division by zero, and $\rho(M)$ is the fraction of the Markov-time scan over which $M$ persists as a stable module (detected via plateau analysis with Normalized Variation of Information, following PyGenStability). The intuition: legitimate functional blocks in a synthesized circuit are carved by global optimization and typically have wide, well-mixed interfaces; an inserted trigger network is a small module whose only reason to exist is its internal coupling, so it traps flow while touching the host through a handful of wires. Circuits are flagged when their top-scoring module exceeds a threshold calibrated on clean benchmarks — no golden netlist of the suspect circuit is needed, only a corpus of clean circuits of similar size, which an auditor can obtain from public benchmark suites.

Third, a cost-of-evasion analysis. An adaptive attacker can widen the Trojan's interface to dilute the boundary-to-size signal. We will measure how much additional area and how many additional host-signal connections an attacker must add to push $S(M)$ below threshold, using the TroLL construction as the starting point, and report the resulting area overhead against the "often less than 1%" overhead TroLL achieves today (TroLL). This converts the proposal into a quantified security claim rather than a fixed-point arms race.

Scalability is handled by construction: the linearized Markov Stability implementation preserves $O(E)$ complexity in the number of edges (PyGenStability), and Infomap's greedy search scales to large sparse graphs (Community Detection with the Map Equation and Infomap: Theory and Applications); the largest circuit in the TroLL suite is SHA-256 at 51,222 gates, well within reach.

Proposed Experiments

The decisive evaluation is the TroLL suite (DES at 6,473 gates, a 32-bit multiplier at 10,609 gates, SHA-256 at 51,222 gates), because it is the one benchmark family where the strongest existing methods are known to fail: TroLL reports ATPG detection "as low as 0% for TroLL with 16-bit triggers" and detection across all tested SAT-based and evolved-ATPG methods plummeting toward zero at 24-bit triggers. Success means localizing the majority of Trojan gates (per-gate TPR ≥ 70%) at a per-circuit false-positive rate at or below what clean benchmarks produce, across 8-, 16-, and 24-bit trigger variants — with the 24-bit case being the headline result, since no method in the file reports any nonzero detection there.

The second evaluation is the TrustHub suite, including the TRIT-TC and TRIT-TS subsets of 914 Trojan benchmarks derived from ISCAS circuits, where the competing static method reports 0% false-negative rate and a maximum false-positive rate of 5.02% (A Hardware Trojan-Detection Technique Based on Suspicious Circuit Block Partition), and where HTDet reports a 99% true-negative rate and a true-positive rate "averaged around 79% overall." Here we do not expect to dominate — classic rare-signal Trojans are squarely in the statistical methods' home turf — but we must be competitive (TPR within ~10 points of HTDet) to show the topological signal is general, not TroLL-specific. Metrics throughout: per-gate TPR/TNR for localization, per-circuit detection rate for the audit decision, wall-clock time per benchmark (the block-partition method reports 0.43 minutes per benchmark, a concrete efficiency target), and a calibration curve of $S(M)$ on clean versus Trojan circuits showing separability.

A third, diagnostic experiment isolates the mechanism. We will run the full pipeline on the "rings of rings" synthetic graph, where modularity split five rings into 8 fragments and Infomap into 18 fragments while Markov Stability at the right Markov time recovered the five-ring structure (Markov Dynamics as a Zooming Lens for Multiscale Community Detection: Non Clique-Like Communities and the Field-of-View Limit). Elongated trigger chains in a netlist are structurally analogous, and this diagnostic tells us whether the multiscale machinery is doing the work or whether a single scale suffices.

Baselines

The do-nothing reference point is random flagging at the base rate: Trojan gates are under 0.2% of circuitry with regular-to-Trojan ratios up to 719:1 (TrojanSAINT), so a random auditor flags essentially nothing at any usable false-positive budget; any real method must clear this trivially, and it anchors the ROC curves.

The strongest competitor in the unsupervised, golden-free regime is the static block-partition method of A Hardware Trojan-Detection Technique Based on Suspicious Circuit Block Partition, which computes SCOAP controllability, clusters signals with K-means, and stitches suspicious signals into blocks via a fixed 10-gate distance cut. On the 914 TRIT-TC/TS TrustHub benchmarks it reports a maximum false-positive rate of 5.02% and 0% false-negative rate. We will re-run it on identical benchmarks (same netlist parses, same clean-circuit calibration corpus, same per-benchmark wall-clock allowance) and beat it by holding FPR at or below 5% while maintaining nonzero detection on the TroLL variants, where its controllability signal is designed out. HTDet (transition-entropy plus DBSCAN, reporting TNR of 99% and average TPR around 79%) is run the same way as the second unsupervised competitor.

The strongest method overall is supervised: TrojanSAINT, which trains an inductively learned graph neural network on sampled netlist subgraphs and reports 98% TPR and 96% TNR in leave-one-out validation but 78% TPR and 85% TNR in the realistic unseen-circuit setting. It will be run with the tuning budget its authors prescribe, on the same benchmark splits. It is the fair bar for the question "does unsupervised flow structure carry as much signal as learned structure" — and, critically, we will also run it in the setting it was not built for: trained on rare-signal TrustHub Trojans and tested on TroLL, to measure how much of its advantage evaporates under distribution shift, which is precisely the auditing scenario this proposal targets.

Finally, two ablations isolate the proposal's key ingredients. Running the identical community detection on the undirected version of each netlist graph tests whether directionality matters or whether any clustering would do — Kim et al.'s source/sink role-splitting result predicts it matters substantially (Finding communities in directed networks). Running only a single Markov time (or only Infomap at its default scale) versus the full time-scan tests whether the multiscale machinery earns its cost or whether the fixed-scale map equation alone explains the results.

Why not just…?

Why not just run ATPG or SAT-based analysis? These are the industry tools, and they fail exactly where this proposal aims to succeed: TroLL reports ATPG detection dropping to as low as 0% at 16-bit triggers and all tested SAT-based methods plummeting toward zero at 24 bits, because the trigger search space is $2^{24}$. Test-based methods are fundamentally about activating the Trojan; ours is about locating it structurally, so the exponential trigger space is irrelevant to us. The TroLL experiment above is the direct head-to-head.

Why not just use signal-activity or controllability clustering (HTDet, SCOAP + K-means)? On classic TrustHub Trojans these are strong, and I do not claim otherwise — the block-partition method's 0% FNR on 914 benchmarks is excellent. But both families key on rarity: HTDet's entropy signal exists because "triggers are designed to rarely transition," and SCOAP measures how hard signals are to control. TroLL's entire contribution is a Trojan class with no rare signals, and it also stays dormant under the simulation vectors HTDet needs. Our TrustHub experiment concedes the home turf and our TroLL experiment is the discriminating test; if the flow-community method also fails on TroLL, the proposal is wrong and the experiments will say so. The honest residual risk is that TroLL modules, being built from Mutation Units spliced into functional logic, may be less topologically isolated than classic trigger trees — the cost-of-evasion analysis quantifies exactly how much isolation remains.

Why not just train a better GNN? TrojanSAINT is a real threat: in its best setting it reaches 98% TPR, far above any unsupervised method's plausible ceiling. Three things bound it here. It needs labeled Trojan examples and degrades to 78% TPR and 85% TNR on unseen circuits — and an auditor facing a novel Trojan family, by definition, has no labels for it. Its graph models are undirected and 2-hop-local; TROJAN-GUARD found that deeper GNNs suffer over-smoothing on circuit graphs (2 layers beat 5), which caps the receptive field exactly where long trigger chains live, while diffusion over Markov time traverses long paths without feature collapse. And the two approaches are complements, not rivals: the community labels our method produces are exactly the weak supervision a GNN lacks, and a follow-on could use $S(M)$ as a node feature. The TrojanSAINT-on-TroLL transfer experiment in the baselines settles empirically how much the supervised advantage survives distribution shift.

Why not just run Infomap or modularity on the netlist as an undirected graph? This is the closest cheap version of our own idea, so it is run as an ablation rather than argued away. The evidence against it is specific: undirected modularity on directed networks splits nodes by source/sink role rather than function (Finding communities in directed networks), and single-scale methods over-partition sparse, elongated structures — the field-of-view limit that made modularity fragment the ring-of-rings benchmark into 8 pieces and Infomap into 18 (Markov Dynamics as a Zooming Lens for Multiscale Community Detection: Non Clique-Like Communities and the Field-of-View Limit). If the undirected single-scale ablation matches the full pipeline, the directionality and multiscale claims are overstated and the proposal should be cut down to whatever ingredient actually carried the result.

Decisive Checks

The proposal lives or dies on three numbers. Localization TPR on 24-bit-trigger TroLL circuits, where every method in the file reports detection at or near zero — any nonzero, calibrated detection there is a new result. False-positive rate on clean ISCAS/ITC-99 circuits relative to the 5.02% maximum the static block-partition method achieves on TrustHub. And the attacker's added area and boundary wires needed to evade, reported as a multiple of TroLL's current sub-1% overhead. If the first number is zero, the core claim about inserted-logic topology is wrong; if the second is uncalibratable, the method is unusable for auditing; if the third is trivially small, the defense only raises a one-time cost. Each failure mode is measurable within the proposed experiments, on benchmarks that already exist in the file.