<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged behavioral-intelligence</title>
<link>https://coderlegion.com/tag/behavioral-intelligence</link>
<description>Powered by Question2Answer</description>
<item>
<title>VeritasLab Built a Behavioral Intelligence Layer for Solana. Here's What We Learned.</title>
<link>https://coderlegion.com/20459/veritaslab-built-a-behavioral-intelligence-layer-for-solana-heres-what-we-learned</link>
<description>&lt;p&gt;Most Web3 security tools ask: is this contract dangerous?&lt;/p&gt;
&lt;p&gt;We asked a different question: who is the person behind it, and what have they done before?&lt;/p&gt;
&lt;p&gt;That shift — from contract risk to actor risk — changed everything about how we built NexusVeritas.&lt;/p&gt;
&lt;p&gt;The Problem Nobody Was Solving&lt;/p&gt;
&lt;p&gt;Solana processes thousands of token launches daily. The existing security tools fall into three buckets:&lt;/p&gt;
&lt;p&gt;Audit firms (CertiK, Hacken) analyze code before deployment. They tell you whether a contract is technically sound. They don't tell you whether the person who wrote it has launched 400 identical tokens in the last 30 days.&lt;/p&gt;
&lt;p&gt;On-chain analytics (Arkham, Nansen, Bubblemaps) map money flows. They're descriptive — they tell you what happened. They don't model behavioral risk.&lt;/p&gt;
&lt;p&gt;Anti-scam scanners (GoPlus, De.Fi) flag known honeypot patterns and approval risks. Rule-based, reactive, no memory across actors.&lt;/p&gt;
&lt;p&gt;None of them answer the question that actually matters before you interact with a token: what kind of operator created this, and does their behavioral pattern match known scam profiles?&lt;/p&gt;
&lt;p&gt;The Architecture: Actor Risk Engine&lt;/p&gt;
&lt;p&gt;We built what we call an Actor Risk Engine (ARE). The pipeline is straightforward:&lt;/p&gt;
&lt;p&gt;tokens_clean.txt&lt;br&gt;
  → enrich_parallel.js   (fetch on-chain data via Helius RPC)&lt;br&gt;
  → operator_classify.js (behavioral classification)&lt;br&gt;
  → db_insert.js         (pgvector storage)&lt;/p&gt;
&lt;p&gt;Each creator wallet gets enriched with three behavioral layers:&lt;/p&gt;
&lt;p&gt;Structural — wallet age, funding sources count, funding concentration&lt;/p&gt;
&lt;p&gt;Behavioral — total incoming SOL, transfer patterns, recycling loops&lt;/p&gt;
&lt;p&gt;Operational — tokens created, signature density, launch frequency&lt;/p&gt;
&lt;p&gt;These 25 normalized features form vector_v2, stored in PostgreSQL with pgvector for cosine similarity search.&lt;/p&gt;
&lt;p&gt;The Classification Layer&lt;/p&gt;
&lt;p&gt;We defined 8 operator archetypes based on signal rules with confidence weights:&lt;/p&gt;
&lt;p&gt;ArchetypeBaseline RiskKey SignalsWALLET_FACTORYelevatedsingle token, fresh wallet, micro fundingWALLET_FACTORY_HUBelevatedrecycling loop + factory patternROTATION_OPERATORhighsplit init pattern, 500+ tokens, no visible fundingINDUSTRIAL_DEPLOYERneutral500+ tokens, 3000+ signatures, high activityINFRASTRUCTURE_HUBunknown50+ SOL incoming, many funding sourcesEXCHANGE_FUNDED_DEPLOYERunknownhub pattern + exchange funding signalsPROFESSIONAL_CREATORlow-medium20–500 tokens, visible funding, 7+ days activeCASUAL_CREATORlowunder 20 tokens, externally funded&lt;/p&gt;
&lt;p&gt;Classification returns operator_class, confidence, baseline_risk, and matched_signals — the exact rules that fired. No black box.&lt;/p&gt;
&lt;p&gt;Example output:&lt;/p&gt;
&lt;p&gt;json{&lt;br&gt;
  &quot;operator_class&quot;: &quot;ROTATION_OPERATOR&quot;,&lt;br&gt;
  &quot;confidence&quot;: 0.85,&lt;br&gt;
  &quot;baseline_risk&quot;: &quot;high&quot;,&lt;br&gt;
  &quot;matched_signals&quot;: [&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&quot;split_init_pattern&quot;,
&quot;fresh_wallet&quot;,
&quot;tokens_created_500_plus&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  ]&lt;br&gt;
}&lt;/p&gt;
&lt;p&gt;What We Got Wrong (and Fixed)&lt;/p&gt;
&lt;p&gt;recycling_loop was a stub&lt;/p&gt;
&lt;p&gt;For weeks, recycling_loop was hardcoded to false. The field existed in the schema, the classifier used it as a signal, but no detection logic ran.&lt;/p&gt;
&lt;p&gt;The fix: in getFunding(), we now track both directions of SOL flow. If a wallet received SOL from address X and also sent SOL back to X within the same transaction batch — it's a loop.&lt;/p&gt;
&lt;p&gt;javascript// incoming: someone → addr&lt;br&gt;
if (t.toUserAccount === addr &amp;amp;&amp;amp; t.amount &amp;gt;= 500000) {&lt;br&gt;
  inc.set(f, { count: e.count + 1, sol: e.sol + t.amount / 1e9 });&lt;br&gt;
}&lt;br&gt;
// outgoing: addr → someone&lt;br&gt;
if (t.fromUserAccount === addr &amp;amp;&amp;amp; t.amount &amp;gt;= 500000) {&lt;br&gt;
  out.add(t.toUserAccount);&lt;br&gt;
}&lt;br&gt;
// recycling_loop: received from X and sent back to X&lt;br&gt;
const recycling_loop = [...inc.keys()].some(f =&amp;gt; out.has(f));&lt;/p&gt;
&lt;p&gt;Simple set intersection. Catches the pattern reliably within the 50-transaction window.&lt;/p&gt;
&lt;p&gt;Graph flood attack vector&lt;/p&gt;
&lt;p&gt;build_graph.js builds a funding graph: which wallets funded which operators, and which wallets funded those funders. Without degree limits, a single high-volume transit wallet could anchor hundreds of nodes and create false cluster signals.&lt;/p&gt;
&lt;p&gt;We added MAX_DEGREE_THRESHOLD = 50. Any wallet outside knownServices.json with more than 50 child nodes gets flagged HIGH_DENSITY_TRANSIT and excluded from hub scoring:&lt;/p&gt;
&lt;p&gt;javascriptconst highDensityNodes = new Set();&lt;br&gt;
for (const [parent, children] of parentMap.entries()) {&lt;br&gt;
  if (children.length &amp;gt; MAX_DEGREE_THRESHOLD &amp;amp;&amp;amp; !KNOWN_SET.has(parent.toLowerCase())) {&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;highDensityNodes.add(parent);
graph.get(parent).flag = 'HIGH_DENSITY_TRANSIT';
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;  }&lt;br&gt;
}&lt;/p&gt;
&lt;p&gt;for (const node of graph.values()) {&lt;br&gt;
  if (node.flag === 'HIGH_DENSITY_TRANSIT') { node.hub_score = 0; continue; }&lt;br&gt;
  node.hub_score = hubScore(node.creator_count, childCount, !!node.parent);&lt;br&gt;
}&lt;/p&gt;
&lt;p&gt;Known services (exchanges, DEXes) are exempt — they legitimately move high volumes.&lt;/p&gt;
&lt;p&gt;The Honest Bottleneck: Signal Quality&lt;/p&gt;
&lt;p&gt;After 565 creators classified, we hit a wall: P50 similarity = 1.0.&lt;/p&gt;
&lt;p&gt;Cosine similarity across the full dataset was collapsing to near-identical values. candidate_discovery.js — which finds behaviorally similar operators across archetypes — was returning noise.&lt;/p&gt;
&lt;p&gt;The cause: most vectors had too many features at boundary values (0 or 1). Not enough continuous signal variance to differentiate actors.&lt;/p&gt;
&lt;p&gt;This is not a bug in the vector math. It's a signal quality problem. The classifier has 8 archetypes and returns sensible labels, but the underlying features don't yet carry enough entropy to power similarity search.&lt;/p&gt;
&lt;p&gt;The fix requires temporal vectors — separating behavioral features into 30d, 90d, and all-time windows. A ROTATION_OPERATOR who was highly active 90 days ago but dormant recently looks different from one who is active today. Current vectors flatten that timeline.&lt;/p&gt;
&lt;p&gt;This is Q3 work. Until then, similarity search is degraded.&lt;/p&gt;
&lt;p&gt;What &quot;Actor-Centric&quot; Actually Means in Practice&lt;/p&gt;
&lt;p&gt;The fundamental reframe is this: a contract is not the threat. The operator is.&lt;/p&gt;
&lt;p&gt;The same wallet that launched a clean token six months ago can launch a rug today. CertiK audits the contract. We track the wallet across every token it ever touched, model its behavioral evolution, and flag when the pattern shifts toward known high-risk profiles.&lt;/p&gt;
&lt;p&gt;This is closer to how financial crime detection works — Visa doesn't just flag a bad transaction, it models cardholder behavior over time and detects deviation. We're building that for on-chain actors.&lt;/p&gt;
&lt;p&gt;The practical output for integrators:&lt;/p&gt;
&lt;p&gt;Wallets (Phantom, Backpack): show a risk warning at transaction simulation time, before the user signs&lt;br&gt;
DEX aggregators (Jupiter): filter token listings based on creator archetype&lt;br&gt;
Launchpads: gate participation based on operator history&lt;/p&gt;
&lt;p&gt;One API call, one score, full explanation.&lt;/p&gt;
&lt;p&gt;Stack Decisions&lt;/p&gt;
&lt;p&gt;PostgreSQL + pgvector over a dedicated graph DB. At current scale (565 operators, target 1000+), adjacency lists in Postgres are sufficient. Memgraph becomes relevant at 1000–1500 operators with real-time query requirements. Premature infrastructure is how you burn runway.&lt;/p&gt;
&lt;p&gt;Rule-based classification over ML at this stage. XGBoost makes sense after 500+ labeled examples. Before that, weighted rules with explainable outputs are more reliable and debuggable than a model trained on insufficient data.&lt;/p&gt;
&lt;p&gt;Helius RPC for Solana data. The enhanced API gives parsed transaction data without manual deserialization. Worth the cost at this stage.&lt;/p&gt;
&lt;p&gt;Node.js pipeline over a compiled language. The bottleneck is network I/O (RPC calls), not CPU. Node's async model handles CONCURRENCY=5 cleanly.&lt;/p&gt;
&lt;p&gt;Where This Goes&lt;/p&gt;
&lt;p&gt;The roadmap is staged around signal quality, not architectural complexity:&lt;/p&gt;
&lt;p&gt;Now: improve signal primitives (split_init_pattern, temporal window analysis), scale to 1000+ creators&lt;/p&gt;
&lt;p&gt;Q3: temporal vectors (30d/90d/all_time), XGBoost baseline, Review UI&lt;/p&gt;
&lt;p&gt;Q4: Memgraph migration at load trigger, GNN embeddings for vector_v3, B2B API (Phantom, Jupiter integration)&lt;/p&gt;
&lt;p&gt;The hard part is not the graph database or the embeddings pipeline. The hard part is accumulating enough clean signal data to make behavioral classification reliable at scale.&lt;/p&gt;
&lt;p&gt;We're building that now.&lt;/p&gt;
&lt;p&gt;NexusVeritas is open-source. GitHub: github.com/cryptaveritas&lt;/p&gt;
&lt;p&gt;This article is based on internal technical documentation by VeritasLab.&lt;br&gt;
Authenticity certified by CryptaVeritas digital fingerprint protocol.&lt;br&gt;
Document hash (SHA-256): 3369f77ea8d34d39b6427f3f31c8c9834ea3812f814c9a810cc73fcac6ec73a9&lt;br&gt;
Verify: cryptaveritas.github.io/cryptaveritas-verify&lt;/p&gt;
</description>
<category>Discussions</category>
<guid isPermaLink="true">https://coderlegion.com/20459/veritaslab-built-a-behavioral-intelligence-layer-for-solana-heres-what-we-learned</guid>
<pubDate>Fri, 12 Jun 2026 23:09:57 +0000</pubDate>
</item>
</channel>
</rss>