DeFi protocols must move beyond “patch-after-the-hack” security and hard-code safety guarantees into their software if the $168 billion sector is to mature, accordingDeFi protocols must move beyond “patch-after-the-hack” security and hard-code safety guarantees into their software if the $168 billion sector is to mature, according

A16z Crypto wants DeFi to ditch ‘code is law’ for ‘spec is law’ to combat $649m exploit problem

2026/01/20 02:13
3 min read
For feedback or concerns regarding this content, please contact us at crypto.news@mexc.com

DeFi protocols must move beyond “patch-after-the-hack” security and hard-code safety guarantees into their software if the $168 billion sector is to mature, according to a16z Crypto.

In a January 11 post, Daejun Park, a senior security researcher at the firm, argued that DeFi developers should adopt a more principled approach to security instead of relying on trial and error.

At the core of that shift, Park said, is the use of standardised specifications that constrain what a protocol is allowed to do, and automatically revert any transaction that violates those predefined assumptions about correct behaviour.

“Almost every exploit to date would have tripped one of these checks during execution, potentially halting the hack,” Park said. “So the once-popular idea of ‘code is law’ evolves into ‘spec is law.’”

Such an idea, sometimes referred to as runtime enforcement or invariant checks, isn’t new. But it’s getting a fresh look as DeFi protocols struggle to defend against hackers exploiting bugs in their code.

Last year, hackers swiped over $649 million through code exploits according to a report from Slowmist, a blockchain security firm.

Even battle-tested protocols like Balancer, whose code had been live on the Ethereum blockchain since 2021, were not immune. It lost $128 million in November after a hacker exploited a code bug.

In recent months, DeFi developers fear hackers are increasingly using artificial intelligence to find DeFi protocol vulnerabilities and exploit them.

‘Not the silver bullet’

Park’s suggestions, if widely adopted, could go a long way in preventing exploits. But they’re not without downsides.

DeFi protocols often gain an edge over their competitors by having the cheapest fees. Adding extra checks on transactions would increase gas costs, potentially losing them users, Gonçalo Magalhães, head of security at Immunefi, told DL News.

Magalhães said invariant checks are a great security strategy, but they can’t account for everything — especially exploits that a protocol’s developers can’t reasonably anticipate. “It’s not the silver bullet,” he said.

It’s also tricky to get the checks to work properly, Felix Wilhelm, co-founder of Asymmetric Research, a crypto security firm, told DL News.

“For many vulnerabilities and real-life hacks, it is difficult or even impossible to write an invariant that detects the hack without also triggering under normal circumstances,” he said.

Wilhelm said runtime enforcement is an important part of protocol security. But it is typically used to detect anomalies, like an unusual flow of funds in a short timeframe.

“While helpful, this often serves only to limit impact or alert the team, rather than stopping the attack outright,” he said.

Many protocols are already adopting invariant checks.

Kamino, a Solana-based lending protocol, began checking for critical invariants using Certora Prover in March last year.

The XRP Ledger, the blockchain behind the $120 billion XRP token, has also implemented invariant checking. The blockchain’s developers said the checks are necessary because XRP Ledger is complicated, and there is a high potential for code to execute incorrectly.

“Invariants should not trigger, but they ensure the XRP Ledger’s integrity from bugs yet to be discovered or even created,” XRP Ledger developers said.

Tim Craig is DL News’ Edinburgh-based DeFi Correspondent. Reach out with tips at tim@dlnews.com.

Market Opportunity
DeFi Logo
DeFi Price(DEFI)
$0.000337
$0.000337$0.000337
+9.41%
USD
DeFi (DEFI) Live Price Chart
Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact crypto.news@mexc.com for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Etsy witches can apparently turn you into a crypto millionaire for $73

Etsy witches can apparently turn you into a crypto millionaire for $73

                                                                               New snake oil? Etsy witches are hawking spells they claim can change the weather on your wedding day, help you with your love life, or fatten your crypto portfolio.                     Etsy witches have become a massive trend on social media this year — from romance spells to helping manifest fame. Did you know they can also apparently help you become a crypto millionaire? The practice of witchcraft, once punishable by death by fire (or being pushed off a cliff), has become a talking point on TikTok. Online marketplace Etsy, which allows people to sell their handmade beanies and custom dog collars, has become a hub for the spellcasters despite having a ban on “metaphysical services.” Read more
Share
Coinstats2025/10/03 10:08
Ripple CEO Reacts to BBB Rating for Ripple Prime, Lists Three Points It Validates

Ripple CEO Reacts to BBB Rating for Ripple Prime, Lists Three Points It Validates

The post Ripple CEO Reacts to BBB Rating for Ripple Prime, Lists Three Points It Validates appeared on BitcoinEthereumNews.com. Brad Garlinghouse, CEO of Ripple
Share
BitcoinEthereumNews2026/04/03 11:28
REX-Osprey DOJE ETF Launch Drives Dogecoin Surge to $0.28

REX-Osprey DOJE ETF Launch Drives Dogecoin Surge to $0.28

The post REX-Osprey DOJE ETF Launch Drives Dogecoin Surge to $0.28 appeared on BitcoinEthereumNews.com. DOJE ETF Offers Direct Spot Exposure to Dogecoin In a press release, REX-Osprey announced the launch of the first-ever publicly traded ETF to provide exposure to Dogecoin (DOGE). The latest fund is the REX-OspreyDOGE ETF (CBOE: DOJE), an innovation in the cryptocurrency market. It is a unique exchange-traded fund (ETF) that offers direct spot exposure to Dogecoin, which has gained legendary popularity due to its Shiba Inu mascot and fan base of Shiba Inu followers. The introduction of the DOJE ETF is revolutionary for several reasons. It is the first ETF in the United States that provides investors direct access to the spot price of Dogecoin, a widely known cryptocurrency, which lacks inherent utility. This provides a controlled and smooth method for people to invest into DOGE through a regular brokerage account. Using this new product, REX-Osprey remains on the edge of digital asset integration into the regulated financial frameworks. Greg King, CEO of REX Financial and Osprey Funds, expressed his pride in this achievement: “Investors look to ETFs as trading and access vehicles. The digital asset revolution is already underway, and to be able to offer exposure to some of the most popular digital assets within the protections of the U.S. ’40 Act ETF regime is something REX-Osprey™ is proud of and has worked diligently to achieve.” SSK’s Success Sets the Stage for DOGE ETF Launch The DOJE ETF follows the successful launch of REX-Osprey’s SOL + Staking ETF (SSK) in July 2025. This fund became the first-ever U.S.-listed ETF to offer spot Solana exposure alongside on-chain staking rewards. Since its launch, SSK has been a significant success, accumulating over $275 million in assets under management. REX-Osprey has now expanded its crypto offerings with the addition of both DOGE and XRP ETFs, offering investors more opportunities to diversify their…
Share
BitcoinEthereumNews2025/09/19 00:52

Trade GOLD, Share 1,000,000 USDT

Trade GOLD, Share 1,000,000 USDTTrade GOLD, Share 1,000,000 USDT

0 fees, up to 1,000x leverage, deep liquidity