Nassirzadeh, Behkish2025-08-252025-08-252025-08-252025-08-21https://hdl.handle.net/10012/22264The adoption of blockchain technologies in security-critical and high-throughput domains remains limited by persistent challenges in scalability, reliability, and automated vulnerability mitigation. This thesis presents a cohesive body of work that addresses two fundamental limitations of modern blockchain systems: the difficulty of ensuring safe, efficient execution in smart contracts and the lack of robust mechanisms for secure data connectivity through decentralized oracle networks (DONs). To address the first challenge, we introduce a suite of tools, GasGauge, GasGuard, and GasGaugeAI, that advance the detection, analysis, and automated repair of gas-related Denial-of-Service (DoS) vulnerabilities in Ethereum smart contracts. GasGauge leverages static-dynamic analysis to model safe loop bounds and identify Out-of-Gas (OOG) risks. We examine how emerging AI methods, particularly large language models (LLMs) and program synthesis tools, provide a scalable path forward for developing self-healing blockchain systems. GasGuard builds on this foundation by integrating a fine-tuned LLM to insert guard conditions that prevent unsafe execution automatically. Finally, GasGaugeAI extends the pipeline with a novel multi-LLM framework that classifies gas-dependent vulnerabilities, generates Foundry-based test cases, synthesizes function-level repairs, and validates fixes iteratively. Across hundreds of real-world contracts, these systems demonstrate the potential of AI-guided repair to drastically reduce manual auditing efforts and prevent exploitable gas exhaustion patterns. Beyond contract-level vulnerabilities, this thesis tackles the broader problem of trustworthy data connectivity in decentralized applications. We propose CountChain, a game-theoretic decentralized oracle network for secure aggregation in counting systems. Built on this foundation, AdChain applies DON principles to online advertising, mitigating discrepancy fraud through incentive-aligned protocols. Our experiments demonstrate that CountChain and AdChain provide both scalability and provable security against rational adversaries. Together, the tools, systems, and theoretical insights presented in this thesis contribute to the vision of blockchain infrastructures that are both secure and scalable by design, bridging the gap between automated repair and game-theoretic connectivity.enblockchaincomputer securityartificial intelligenceAILLMsmart contractEthereumdecentralized oraclesgame theorystatic analysisfuzzingautomatic program repairTowards Secure and Scalable Blockchain Systems: From Game-Theoretic Oracle Networks to AI-driven Smart Contract RepairDoctoral Thesis