decrypt101
SocialOpen ProjectsSupport me My Resumes
  • Preface
    • Motivation
    • Roadmap’s
  • Introduction to Blockchain
    • A Brief History
    • Growth of Blockchain
    • Structure of Blockchain
    • Types of Blockchain
    • Key Technologies of Blockchain
    • Features of Blockchain
    • How Blockchain Works ?
    • Implementation of Blockchain
    • Summary
  • Components of Blockchain Architecture
    • Distributed Ledger
    • Blocks
    • Transaction
    • Chain
    • Peer-to-Peer Network
    • Blockchain Layers
    • Off-Chain & On-Chain
    • Wallet
    • Mining
    • Tokens
    • Assets
    • State Channels
    • Sidechains
    • Oracles on Blockchain
    • Atomic Swaps
    • Decentralized Identity (DID)
    • Blockchain Data Storage
    • Interoperability
    • Data structures for Scaling Blockchain
    • Maximal Extractable Value (MEV)
  • Consensus Mechanisms
    • Proof of Work (PoW)
      • Implemation Using Rust
    • Proof of Stake (PoS)
    • Proof of Burn (PoB)
    • Proof of Capacity (PoC)
    • Proof of Activity (PoAc)
    • Proof of Weight (PoWe)
    • Proof of Luck (PoL)
    • Proof of Ownership (PoO)
    • Proof of Existence (PoE)
    • Proof of Believability (PoBe)
    • Proof of History (PoH)
    • Proof of Authority (PoA)
    • Proof of Elapsed Time (PoET)
  • Cryptographics
    • Encryption & Decryption
      • Symmetric Encryption
      • Asymmetric Encryption
      • Key Management and Exchange
      • Implementation
    • Cryptographic Hashing
      • Secure Hash Algorithms (SHA)
      • Message Digest Algorithms
      • Ethash
      • Blake2
      • SCrypt
      • RIPEMD-160
    • Digital Signature
      • Digital Signature Algorithms
      • Digital Signature in Blockchain
    • Zero-Knowledge Proofs (ZKPs)
      • Types of Zero-Knowledge Proof and Protocols
      • A Case Study of Polygon Platform
    • Multi-Party Computation (MPC)
    • Cryptanalysis
    • Practical Implementation
  • Decentralized Application (DApp)
    • Design and UX in Web3
  • Smart Contract
    • Development Tools
    • Solidity
    • Testing Smart Contract
    • Developing Smart Contract
    • Interacting & Deploying with Smart Contract
    • Verifying Smart Contracts
    • Upgrading Smart Contracts
    • Securing Smart Contract
    • Smart Contract Composability
    • Testnet and Mainnet
    • Blockchain Platform Using Smart Contract
    • Application of Smart Contract
    • Practical Implementation
  • Blockchain Platforms
    • Ethereum
      • Ethereum Virtual Machine (EVM)
      • ETHER and GAS
      • Ethereum transaction
      • Ethereum Accounts
      • Ethereum Stacking
      • Ethereum Network
      • Ethereum Scaling Solutions
      • Ethereum Use-Cases
      • Getting Started with Ethereum
      • Ethereum Ecosystem and Support
    • Solana
      • Solana Architecture
        • Solana Account Model
        • Solana Wallet
        • Transactions and Instructions
        • Solana Programs
        • Program Derived Address (PDA)
        • Cross Program Invocation (CPI)
        • Tokens on Solana
        • Clusters and Public RPC Endpoints
        • Transaction Confirmation & Expiration
        • Retrying Transactions
        • Versioned Transactions
        • Address Lookup Tables
        • State Compression
        • Actions and Blinks
      • Solana Developments
      • Solana Client
      • Advanced Solana
      • Solana Scaling and Performance Architecture
      • Solana Solutions and cases
      • Practical Implemenation
    • Binance Smart Chain (BSC)
      • Create a BEP20 Token
    • Hyperledger Fabric
    • Cosmos
    • Polkadot
    • Quorum
    • Polygon
    • Algorand
    • Corda
    • Avalanche
    • TRON
    • Summary
  • Decentralized Finance (DeFi)
    • DeFi Components
    • DeFi Protocols
    • DeFi Platforms
    • DeFi Risk Classification
      • Infrastructure-layer Attacks
      • Smart Contract Layer-attacks
      • Application Layer-attacks
      • DeFi Risks
    • DeFi and Blockchain
    • DeFi Impact
  • Decentralized Ecosystem and Digital Innovation
    • Layer 2 Scaling Fundamental
    • Tokenomics
    • Cryptocurrency
    • Quantative Trading
    • NFTs
    • GameFi
    • Metaverse
  • Blockchain as a Service (BaaS)
    • Building Fullstack Blockchain Platform
    • Decentralized Digital Identity
    • Build a Cryptocurrencies Exchange
    • Play-to-Earn Gaming
    • Solana Token Airdrop Manager
    • Smart Contract Development on Solana with Rust
    • Quantitative Trading Platform
    • Insurances protocols
    • Flash Loans
    • Asset Management
    • Tokenized Derivatives
    • Automated Market Makers (AMMs)
    • Staking
    • Lending and Borrowing Platforms
    • Yield Farming
    • Stablecoin System
    • Security Token Offerings (STOs)
    • Initial Coin Offerings (ICOs)
    • On-Chain Voting Systems
    • Decentralized Autonomous Organizations (DAOs)
    • NFT Marketplaces
    • Provenance Verification
    • Supply Chain Tracking
    • Commodities Tokenization
    • Real Estate Tokenization
    • Digital Certificates
    • KYC (Know Your Customer)
  • Blockchain Development Across Languages
    • Blockchain using Go(Golang)
    • Blockchain using Rust
    • Blockchain using Python
    • Blockchain using Cairo
  • Distributed Systems & Infrastructure Technology
    • Classification of Distributed Systems
    • Networked systems versus Distributed systems
    • Parallel systems vs Distributed systems
    • Distributed versus Decentralized systems
    • Processes of Distributed Systems
    • Architecture of Distributed systems
    • Infrastructure Technologies
  • Distributed System Patterns
    • Distributed Agreements Algorithms
      • HoneyBadgerBFT
    • Data Replications
    • Data Partition
    • Consistency
    • Distributed Time
    • Cluster Management
    • Communication between Nodes
    • Fault Tolerance and Resilience
      • How to design better fault tolerance systems
      • Resilience Patterns
    • Coordination systems
      • Clock synchronization
    • Security
      • Trust in distributed systems
      • Design of Principal Security
      • Security threats, policies, and mechanisms
      • Authentication and Authorizations
      • Cryptography
      • Monitoring in Security
  • Distributed System Design
    • Page 1
    • Distributed Shared Memory
    • Distributed Data Management
    • Distributed Knowledge Management
    • Distributed Ledger
  • FAQs
  • Support and Community
Powered by GitBook
On this page
  • Blockchain Attacks
  • Collapse of Terra Blockchain
  • MEV Attacks
  1. Decentralized Finance (DeFi)
  2. DeFi Risk Classification

Infrastructure-layer Attacks

The infrastructure-layer attacks include vulnerabilities in the BC design. They might directly target the BC, its nodes, and consensus mechanisms on which DeFi protocols operate (BC Attack) or exploit design faults in processing the transaction (MEV Attack).

Blockchain Attacks

The 51% attack allows tampering with the ledger data by controlling over half of the network hash rate. Other examples include block timestamp manipulation. DeFi service customers and arbitrageurs are partially affected during the BC attacks, as they are only restricted from using the DeFi Protocols. LPs lose all tokens locked on the victim BC. Similarly, issuers of stablecoins and liquids staking tokens lose the collateral. The governance users are fully affected, as their DeFi protocol is based on the victim BC. The BC attacks might be mitigated by using DeFi protocols only from the established BCs with vast networks of nodes and staked assets.

Collapse of Terra Blockchain

The Terra blockchain be- longed for the ten largest blockchains with a market capitalization of over $30bn. Its collapse was caused by the vulnerability in the economical design of its algorithmic stablecoin UST, and led to the fall of the DeFi protocols operating on Terra. In infrastructure layer attacks, such as the attack on Terra, all DeFi stakeholders - service customers, liquidity providers (LPs), arbitrageurs, and governance users - are fully exposed, as the attack ultimately leads to the loss of value of the victim blockchain with all deployed smart contracts and tokens.

MEV Attacks

MEV attacks (Miner Extractable Value attacks) refer to miners or validators benefiting from their access to information about an upcoming transaction. The traditional financial market has been encountering similar cases since the 1970s. The blockchain, by design, allows validators to decide on the order of transactions in the block. In MEV attacks, transactions are re-ordered for the benefit of validators at the expense of the initiator of the victim transaction. Flash loans additionally increase the arbitrage revenue of the attackers. Some liquid staking protocols incorporate revenue from MEV attacks in the rewards tokens. Depending on the re-ordering strategy, the MEV attacks can be classified as follows:

  • Front-running attack - the validator inserts the transaction before the victim transaction; if the victim transaction does not settle, the attack is fatal. This form of MEV attack targets, for instance, the arbitrage transaction. The validator makes a risk-free profit by copying and front-running the arbitrage transaction. The original transaction is not executed, as the arbitrage conditions no longer exist.

  • Back-running attack - the validator’s transaction is executed after the target transaction. For instance, in MEV arbitrage, the validator executes the transaction that equals the prices between CEX and AMM-DEX.

  • Sandwich attack combines front- and back-running, as depicted in algorithms.

  • Just In Time Liquidity (JIT) attack occurs only at CLMM, such as Uniswap (v3), and refers to providing liquidity only for the price range of the target transaction. Once the transaction is executed, the liquidity is withdrawn from the pool, as presented in the algorithm.

DeFi protocols cannot prevent MEV attacks, as they are initiated in the blockchain infrastructure layer. Multiple approaches to mitigate transaction-ordering attacks have emerged, but all provide unsatisfactory results. Considering swap fees, slippage tolerance, and gas fees, MEV attacks are only profitable if the size of the victim transaction ex- ceeds a certain threshold. Privacy-preserving blockchains with TEE, e.g., Integritee or Secret Network, prevent transaction reordering from the infrastructure layer.

MEV Attacks affect mostly traders (service customers) and arbitrageurs at CLOB and AMM DEXs. Traders pay the higher swap costs and arbitrageurs cannot execute their transaction. In JIT attacks, the traders profit from the attack, paying lower slippage costs. LPs are the victims of the attack, as their rewards from the swap fees are shared with the MEV attacker. Less than 1% of liquidity at Uniswap (v3) is provided by JIT

PreviousDeFi Risk ClassificationNextSmart Contract Layer-attacks

Last updated 8 months ago