Blockchain Security / ML Engineering

CryptoSecure: AI-Powered Smart Contract Security

RoleML/AI Engineering & Frontend
Team4 Members
Timeline~3 months
CryptoSecure: AI-Powered Smart Contract Security
Overview

Making Blockchain Security Accessible to Every Developer on the TON Network

Skill Constellation

Primary

Prompt Engineering for SecurityDual-Layer Analysis ArchitectureDeveloper-Centric UX

Supporting

Static AnalysisLLM Integration (GPT-4o)React Frontend

Emerging

Blockchain SecurityAdversarial Thinking

Project Type: Graduate Team Project — Drexel University
Duration: ~3 months

Next.jsReactTypeScriptTailwind CSSShadcn UIOpenAI GPT-4oRechartsVercel
The Problem

The Problem Nobody Was Solving

Here's a number that should worry anyone building on the TON blockchain: 14,995 vulnerabilities were recently discovered across just 1,640 smart contracts. That's more than 9 bugs per contract on average. And these aren't cosmetic bugs — they're security holes that let hackers drain wallets, steal funds, and exploit users.

The TON blockchain is exploding. Telegram's 900+ million users are being funnelled into a crypto ecosystem that's growing faster than the security infrastructure can keep up. Developers — many of them building their first smart contracts — are deploying code that handles real money. And the safety net doesn't exist.

Traditional Option

A professional security audit costs $10,000 to $50,000 and takes 2 to 4 weeks. Impossible for independent developers, students, or small NFT teams.

Automated Option

Existing tools catch syntax errors—like spell-checking a legal document. They miss semantic vulnerabilities and logic flaws that get exploited.

So developers are left with a choice: spend money they don't have on a manual audit, or launch and hope for the best. We built CryptoSecure to eliminate that choice.

Smart contract vulnerabilities aren't just technical bugs. They're real money at risk. A reentrancy flaw in a DeFi contract doesn't just cause an error — it lets someone drain the entire liquidity pool. The stakes aren't theoretical.

Skill Spotlight

Problem Framing

Identified underserved market gap: individual and student developers on TON who need audit-grade security but can't afford $10K+ audits.

Evidence: 14,995 vulnerabilities across 1,640 contracts; no free TON-native tool existed.

The Solution

What We Built

CryptoSecure (also called TON Guardian) is an AI-powered security scanner that analyses TON smart contracts in seconds, identifies vulnerabilities across 8+ categories, explains them in plain English, and generates the actual code fixes — not just warnings, but working patches.

The experience is designed for developer velocity, not security theatre:

Upload → Analyse → Fix → Export. That's it.

A developer drags in their FunC or Tact smart contract file (or pastes a code snippet directly). The AI engine scans it in under 30 seconds. A security score from 0 to 100 appears, with vulnerabilities broken down by severity — Critical, High, Medium, Low. Each finding comes with a plain-language explanation of what's wrong, what could happen if it's exploited, the specific lines of code affected, and a recommended fix with working replacement code.

The developer reviews the fixes in an interactive diff viewer — side-by-side comparison, colour-coded changes, the ability to accept, reject, or manually edit each suggestion. When they're satisfied, they export a professional PDF audit report with severity scoring, impact analysis, and an executive summary suitable for sharing with investors or partners.

What used to cost $10,000 and take a month now takes 30 seconds and costs nothing.

The Craft

Owning the Engine & Interface

In a team of four, I owned two areas: the AI/ML analysis pipeline and portions of the frontend interface.

The AI Engine

The core technical challenge was this: how do you get an AI system to understand smart contract security deeply enough to catch real vulnerabilities — not just pattern-match against a list of known bad code snippets? The approach combined two layers:

1

Layer 1: Static Analysis & Heuristic Engine

A custom vulnerability database built from TONScanner research and known exploit patterns specific to the TON blockchain. This catches the deterministic issues—the patterns we know are dangerous based on historical exploits and documented vulnerability classes. This layer works without any API dependency and provides baseline detection.

2

Layer 2: AI-Powered Semantic Analysis

Using OpenAI's GPT-4o model to perform deeper semantic reasoning about the contract's logic. This is where CryptoSecure goes beyond what traditional automated tools can do—the AI can understand the intent of the code, spot logical flaws that aren't captured by pattern matching, and reason about how different functions interact in ways that create emergent vulnerabilities.

The combination matters. Static analysis is fast and deterministic but limited to known patterns. AI semantic analysis can catch novel vulnerabilities but can hallucinate or miss deterministic issues. Together, they're more reliable than either alone.

Skill Spotlight

Dual-Layer Analysis Architecture

Combined deterministic static analysis with GPT-4o semantic reasoning. Neither alone is sufficient — together they catch both known patterns and novel logic flaws.

Evidence: 8+ vulnerability categories detected; handles both deterministic and emergent issues.

The vulnerability categories the engine detects:

CategoryWhat It CatchesWhy It Matters on TON
ReentrancyFunctions called recursively before state updates completeThe #1 exploit vector in DeFi — the classic "drain" attack
Access ControlMissing permission checks on privileged functionsAllows unauthorised users to execute admin operations
Integer OverflowArithmetic operations that exceed data type boundsCan manipulate balances, mint tokens, or bypass limits
Unchecked ReturnsExternal calls whose return values aren't validatedFailed operations that proceed as if they succeeded
Gas Limit IssuesOperations that could exceed gas limits mid-executionTransactions that revert after partial state changes
TON DefectsVulnerabilities unique to FunC/Tact and TONIssues not caught by tools designed for Ethereum/Solidity
Input ValidationMissing or insufficient validation of external inputsAllows attackers to pass malicious data
Logic ErrorsSemantic flaws in business logicRequires understanding what the code is supposed to do

The "Hacker Mode" Feature

We built an advanced analysis mode (powered by GPT-4o with a dedicated API key) that goes beyond detection into adversarial thinking. Hacker Mode doesn't just identify vulnerabilities — it describes how an attacker would exploit them, step by step. This was designed for developers who want to understand the threat model, not just the fix list.

Think of it as the difference between a doctor saying "you have high blood pressure" and a doctor explaining "here's what will happen to your cardiovascular system over the next 10 years if this isn't addressed." The second version creates urgency and understanding. Hacker Mode does the same for smart contract security.

Skill Spotlight

Adversarial Thinking (Hacker Mode)

Designed prompt engineering to generate step-by-step exploit narratives, transforming abstract vulnerability reports into concrete threat models.

Evidence: Developers understand WHY a flaw is dangerous, not just that it exists.

Frontend Contributions

I worked on portions of the React frontend, specifically around the security score visualisation (built with Recharts), the vulnerability report display, and the integration between the analysis engine output and the UI components. The interface uses Shadcn UI components styled with Tailwind CSS, with a dark-mode aesthetic that matches the developer tooling context.

Design Craft

The Design Decisions That Mattered

Decision 1: Plain English Over Error Codes

Most security tools speak in jargon: "CVE-2024-XXXX detected at line 47." Technically accurate. Practically useless to a developer who isn't a security specialist. We made a deliberate choice: every finding would be explained in language a developer with no security background could understand. Not dumbed down — just translated.

Decision 2: Fix It, Don't Just Flag It

Identifying a vulnerability is only half the value. Every finding includes a remediation section with working replacement code. The interactive diff viewer shows the vulnerable code on the left and the patched code on the right. This transforms the tool from a diagnostic into a solution.

Decision 3: The Security Score as a Trust Signal

The 0–100 security score isn't just a vanity metric. It's designed to be shareable — a signal that a project can show to investors, partners, and users to demonstrate that their contract has been analysed and meets a minimum security threshold.

Decision 4: Sample Contracts for Education

We included pre-loaded vulnerable contracts so developers can see the tool in action immediately. This serves two purposes: it removes the "cold start" barrier, and it educates developers about common vulnerability patterns before they encounter them in their own work.

Skill Spotlight

Developer-Centric UX

Every design decision served developer velocity: plain English explanations, working code fixes, interactive diff viewer, and shareable security scores.

Evidence: Four distinct design principles each grounded in developer workflow research.

The best security tool is one that makes developers better at security — not just one that catches their mistakes. If a developer uses CryptoSecure ten times and starts writing more secure code on the eleventh, that's a bigger win than catching ten bugs.

Architecture

Technical Architecture

Developer Input │ ├── File Upload (.fc, .tact) └── Code Paste (inline editor) │ ▼ ┌──────────────────────┐ │ Static Analysis │ Layer 1: Pattern matching against │ Engine │ known vulnerability database │ (Custom heuristics) │ (TONScanner research + known exploits) └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ AI Semantic Analysis│ Layer 2: GPT-4o deep reasoning │ (OpenAI API) │ about logic, intent, and emergent │ │ vulnerability patterns └──────────┬───────────┘ │ ▼ ┌──────────────────────┐ │ Results Aggregation │ Merge findings, deduplicate, │ & Scoring │ calculate severity-weighted │ │ security score (0–100) └──────────┬───────────┘ │ ├──→ Security Score Dashboard (Recharts) ├──→ Vulnerability Report (detailed findings) ├──→ Auto-Fix Engine (patched code generation) ├──→ Diff Viewer (side-by-side comparison) └──→ PDF Report Export (audit-ready document)
Positioning

Competitive Positioning

We built CryptoSecure to fill a specific gap that no existing tool addresses:

CapabilityCryptoSecureManual AuditsExisting Tools
Speed30 seconds2–4 weeksMinutes
CostFree$10k–$50kFree–$1k
ExplanationPlain English with fixesTechnical reportsError codes
UnderstandingAI-powered reasoningHuman expertisePattern match
AccessibilityAny developerEnterprise onlySec-minded
TON supportBuilt for FunC/TactVariesAlmost none
Fix genAutomatic patched codeManual adviceNone
LearningAdapts to new exploitsManual updatesFixed rules
The Evidence

What We Compressed

The value proposition is a compression ratio: $10,000–$50,000 and 2–4 weeks of manual audit → 30 seconds and $0. That's not a marginal improvement. It's a category shift in who can afford to write secure smart contracts.

< 30sAnalysis speed

Under 30 seconds to scan a smart contract natively.

8+Vulnerability Types

Detects various categories including TON-specific defects.

19Deployments

Production deployments on Vercel ensuring continuous availability.

AutoFix Generation

Provides working patched code for detected issues.

Why it matters at scale: TON aims to onboard 500 million users by 2027. That growth will be built on smart contracts written by thousands of developers — most of whom won't have security budgets. CryptoSecure makes the difference between those contracts being audited or being deployed blind.

The Growth

Reflections & Next Steps

AI is a tool, not an oracle. The most important design decision we made was layering static analysis under the AI engine rather than relying on AI alone. GPT-4o is remarkably good at semantic reasoning about code — but it can hallucinate or produce overconfident assessments. Together, they're genuinely useful.

Explanation is a feature, not a nice-to-have. A security tool that says "reentrancy vulnerability detected" is technically correct but practically useless to 80% of its target audience. Making security knowledge accessible isn't a UX polish item — it's the core value proposition.

Developer experience drives adoption for developer tools. The diff viewer, the auto-fix engine, the one-click export — these aren't the "smart" parts of the tool. But they're why developers actually use it rather than looking at the vulnerability list and closing the tab.

My UX instincts shaped the ML output design. Eight years of thinking about how users consume information directly influenced how the analysis engine presents its findings. The severity hierarchy, the progressive disclosure, the visual score dashboard — these are UX patterns applied to ML output.

Skill Spotlight

UX-Shaped ML Output

Applied 8 years of UX thinking to ML interface design: severity hierarchy, progressive disclosure, and visual scoring transformed raw analysis into actionable developer experience.

Evidence: Severity hierarchy, diff viewer, and score dashboard — all UX patterns applied to ML.

What's Next

Expanded language support — Extending beyond FunC and Tact to cover Solidity (Ethereum) and Move (Aptos/Sui).
CI/CD integration — A GitHub Action / CLI tool that runs CryptoSecure as part of the deployment pipeline.
Vulnerability knowledge base — A public, searchable database of TON vulnerability patterns that feeds back into the analysis engine.
Community-driven rule sets — Allowing security researchers to contribute custom detection rules.