DeFi Hacks And The Reasons Behind Them, Explained.

Easy Contents Jumps

The DeFi (decentralized finance), which has the potential to establish a more fair and censorship-resistant financial system, has grown in favor in recent years. This protocol's shortcomings have been brought to light by a variety of hacks, it suffered.


The DeFi (decentralized finance), which has the potential to establish a more fair and censorship-resistant financial system, has grown in favor in recent years. This protocol’s shortcomings have been brought to light by a variety of hacks, it suffered.

User Review
5 (1 vote)

The DeFi (decentralized finance), which has the potential to establish a more fair and censorship-resistant financial system, has grown in favor in recent years. This protocol’s shortcomings have been brought to light by a variety of hacks, it suffered.

The recent spike in DeFi hacks has brought attention to DeFi technology’s shortcomings. Concerns concerning the security of decentralized finance (DeFi) have increased along with its popularity. Malicious actors are finding new ways to exploit the system, which has led to an increase in the frequency of DeFi hacks.

What is DeFi?

A blockchain-based financial system called Decentralized Finance (DeFi) enables users to communicate with one another without the use of centralised middlemen.

what is DeFi

It makes use of the benefits of smart contracts and digital assets to offer a safe, open and trustworthy platform for decentralized financial services. Access to financial services including loans, savings accounts, trading platforms and even insurance is made available to customers through DeFi.

Numerous unrelated projects that are frequently referred to as “decentralized financial protocols” provide these functions. These protocols enable safe, open, and reliable user-to-user communication and the exchange of digital assets. The utilization of flash loans is one of the most widely used DeFi services.

Flash loans are short-term, instantaneously performed loans that let borrowers borrow money to accomplish deals. DeFi protocols also give consumers access to crypto bridges, which let them transfer money between several blockchains. Because of this, users can transfer money directly from one project to another without going through an exchange (crypto exchange platforms) or another middleman.

DeFi is emerging as a safe alternative to conventional financial services. Users now have a special chance to invest in digital assets without the need for conventional middlemen. It has a lot of advantages, but recent hacks have also brought to light several serious disadvantages. DeFi protocols, for instance, are built on top of the Ethereum blockchain, which is still in its infancy and prone to faults and glitches that expose users to malicious attacks. The protocols also frequently use smart contracts, which are susceptible to programming errors or malicious code.

Last but not least, while allowing customers to transfer funds fast, Flash Loans and crypto bridges can also open a security flaw that could be exploited by bad actors. If DeFi is to become a viable alternative to centralized banking systems, all of these problems must be resolved.

How DeFi Works:

DeFi is a fast-expanding segment of the cryptocurrency economy. Without relying on conventional financial institutions, it gives consumers access to a range of financial services, such as lending and borrowing, via the blockchain. It gives people more control over their finances without the need for expensive middlemen by utilizing smart contracts.

Decentralized applications (dapps) are at the heart of DeFi, and these dapps are powered by algorithms that allow them to carry out transactions and other tasks. The MakerDAO protocol, which enables users to collateralize their cryptocurrency assets in return for DAI tokens.

The Dao maker protocol

To control the risk involved with creating DAI tokens, the MakerDAO algorithm employs a number of smart contracts. DeFi uses algorithms, blockchain as well as decentralised networks (DAG). These technologies offer the framework necessary for consumers to connect with DeFi applications and store data on the blockchain securely.

Graph Of DeFi

The infrastructure layer and the application layer are the two basic layers that make up DeFi. The technology that supports blockchain transactions and features, like distributed ledger technology and smart contracts, makes up the infrastructure layer. Dapps make use of the underlying technology under the application layer to give customers access to financial services like lending and borrowing.

A recent report from Quant Analytics (read here) on the state of DeFi found that there are currently over 6 million users interacting with DeFi protocols, representing an increase of more than 40% since March 2019.

Dune Analytics total Defi users

(Source: Quant Analytics)

This is a sign of a rising user base that is utilizing DeFi’s advantages and its potential to transform the financial sector. Defi has expanded quickly, but it is still a young technology with a lot of flaws that have led to recent attacks and security flaws.

These include the uncertainty of smart contracts, the impossibility of auditing and validating blockchain transactions, the absence of regulatory control and the difficulty of P2P transactions. For Example, according to a recent report by Investopedia, DeFi hacks have costed over $4.4 Billion so far (Read Here). Developers must keep concentrating on enhancing the core infrastructure and creating solutions to these problems to reduce these risks and guarantee the long-term sustainability of DeFi protocols.

Developers are starting to use cryptographic algorithms like Zero-Knowledge Proofs to safeguard P2P transactions, which will further increase the safety and security of DeFi protocols. These algorithms allow two parties to communicate without disclosing their identities or the specifics of the transaction.

Without revealing the data involved, they can also be used to confirm the authenticity of a transaction. To lower the danger of attacks, Defi protocols are also starting to include extra levels of protection, such as custodial funds and multi-signature transactions. Additionally, more investigation is being done into the basic principles of Defi protocols in order to better comprehend the dangers involved and spot possible areas for development.

On the Ethereum blockchain, for instance, the Defi Sentry Protocol is being developed to build an automated method for identifying and reacting to harmful activities. On the blockchain, Defi protocols are algorithms that let users communicate with one another without relying on any central authorities or other parties.

Users can safely carry out P2P transactions and issue digital assets by using these protocols. These digital assets are frequently ERC-20 tokens, which are tokens that follow a set of guidelines on the Ethereum blockchain and can be used for a number of things, like representing assets or digital currencies.

In addition to the algorithms that drive the Defi protocols, smart contracts are also used to control data interchange, storage, and token issuance.

For example, the Compound Crypto protocol uses a network of smart contracts to let users borrow and lend digital assets on the blockchain.

The Uniswap protocol also enables decentralised token trading on the blockchain for a variety of token kinds. There have been a lot of studies and publications published recently that have been devoted to comprehending the risks connected with DeFi protocols and how to solve them.

The Technical Limitations Of Defi:

DeFi’s reliance on macroeconomic and tokenomic models is one of its main drawbacks. As a result, DeFi protocols frequently have to rely on centralised sources for pricing information, which might result in the usage of numbers that are incorrect or unreliable.

Additionally, due to the small quantity of traded tokens in many DeFi protocols, traders might not be able to locate enough buyers or sellers for their tokens. The scalability of DeFi is another drawback.

Many smart contracts are unable to scale up and satisfy the demands of more complicated financial products because they cannot manage huge numbers of transactions at once. Transaction processing may take longer as a result, and the cost of maintaining the protocol may rise.

ERC-20 tokens and other legacy tokens are also used in the construction of various DeFi protocols, which might reduce capital efficiency and lead to security and privacy problems. The capital efficiency of DeFi protocols may be further impacted by the inherent risk associated with the process of minting crypto-tokens.

In addition, a lot of users aren’t aware of the dangers of DeFi initiatives, like the possibility of stolen money or frozen tokens. The majority of DeFi protocols are also built on the Ethereum blockchain, which can experience congestion under a lot of traffic. Some projects may struggle to be successful as a result of lengthy transaction times.

In addition, a lot of protocols use wrapped tokens to transfer data between other blockchains, which comes with extra costs and possible security risks.

DeFi Limitations, Reason Of Attack:

Recent hacks have a common thread that is blockchain bridges. Hackers have managed to figure out how to exploit the bridge and get the money out of smart contract. Bridges are relatively new technology and to be more research are being carried out to hack proof them.

What is Blockchain Bridge:

Wha is a Blockchain Bridge

Blockchain bridges are pieces of technology that connect and communicate between two or more different blockchain networks. Between many blockchains, digital assets can be transferred using this connection. As a result of the instantaneous nature of the asset transfers between blockchains, this technology is also known as “atomic swaps.”

The “Ethereum-EOS” bridge is the most widely used kind of blockchain bridge, since it enables users to transfer tokens from one chain to another.

How Bridges Work:

There are many different blockchains in the market, and every blockchain has its own native cryptocurrency. Suppose if a user wants to move money from blockchain A to blockchain B. Blockchain A has a very different implementation from blockchain B so how does blockchain A and blockchain B communicate with each other that’s why the bridges come, the bridges are used to transfer funds from one blockchain to another blockchain via Smart contracts.

Both Blockchains have some sort of smart contracts on its ends, the bridges have some sort of processes to facilitate the transfer of fund from one smart contract to another.

How Bridges Are Exploited:

According to recent reports (read here) the attacker forged a valid signature to bypass the bridge and transfer funds to its smart contract. Data on the bridge is verified using a digital signature. Data sent over the bridge is checked for integrity using digital signatures to make sure it hasn’t been tampered with.

Each side of the bridge needs a unique digital signature for it to operate properly. The usage of this digital signature serves as evidence that the user who started the transaction is the same person who is trying to transfer the assets to them. The bridge hacks happen when the digital signature algorithm is weak and easily broken by attackers, or some recent edits leave a loophole in the code. As in the case of the Nomad cyberattack.

zero value pass to authorize the value

samczun nomad attack

[Source: Samczsun]

The developer Smart contracts just before the hack but failed to set some values in the upgrade, which left the room to pass 0 value as an acceptable route to authorize the value. It basically caused a side effect of auto-approving every single message. Anyone who had access to the smart contract passed the 0 value and proved to the smart contract the legitimacy of their transactions.

The truth is, Bridge is still an evolving technology and the upgrades in bridge codes will always be vulnerable to hacks like a man-in-the-middle attack when the hacker intercepts communication between the two blockchains and steals user information or money. Even, the smart-contracts are susceptible to hacks.

Re-entrancy is one of the most popular ways that hackers can take advantage of smart contracts. This happens when a hostile actor repeatedly executes a function in a contract, allowing them to drain money or tamper with data. Re-entrancy attacks are particularly successful since the calling party is typically assumed to be a reliable party under contracts.

Hackers can also take advantage of smart contracts by writing bad code.
If a contract’s code is not properly constructed, an attacker may be able to manipulate it to access funds or otherwise corrupt data.
For instance, if the code had an unchecked overflow vulnerability, an attacker may send a sizable transaction that would surpass a variable’s maximum value and cause an overflow.

Take Caution:

Utilizing the several security mechanisms offered by DEFI platforms, such as multifactor authentication, two-factor authentication, and whitelisting of addresses, is also crucial. Decentralized exchanges are a more safe alternative to using huge sums of money in a single wallet.

Last but not least, stay current on DEFI news and updates by subscribing to reputable websites, podcasts, and Twitter accounts. By doing this, you can make sure that you are always informed about any potential security threats or changes that might be released regarding the projects you are engaged in. You can better defend yourself from cyberattacks in the future by remaining aware.


A significant development in the blockchain sector has been the advent of DeFi, which enables consumers to access a variety of financial services without the help of conventional financial institutions.
However, there are significant restrictions and dangers associated with using DeFi, just like with any other technology. DeFi has the potential to be a secure and lucrative platform for investors with the right safeguards in place.

Leave a Reply

error: Content is protected !!