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

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.000525
$0.000525$0.000525
+3.14%
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 service@support.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

Trump’s Tactics Reignite Crypto’s SEC Dialogue

Trump’s Tactics Reignite Crypto’s SEC Dialogue

Prior to Donald Trump’s influence, cryptocurrency companies primarily encountered the Securities and Exchange Commission (SEC) through legal battles. Under the leadership of former SEC Chair Gary Gensler, the lack of clear guidance from the commission bred a climate of apprehension, leaving businesses in a perplexed state.Continue Reading:Trump’s Tactics Reignite Crypto’s SEC Dialogue
Share
Coinstats2025/09/18 04:08
Top 3 Price Prediction for Ethereum, XRP and Bitcoin If Crypto Structure Bill Passes This Month

Top 3 Price Prediction for Ethereum, XRP and Bitcoin If Crypto Structure Bill Passes This Month

The post Top 3 Price Prediction for Ethereum, XRP and Bitcoin If Crypto Structure Bill Passes This Month appeared on BitcoinEthereumNews.com. Bitcoin price, Ethereum
Share
BitcoinEthereumNews2026/01/20 03:41
Polygon Tops RWA Rankings With $1.1B in Tokenized Assets

Polygon Tops RWA Rankings With $1.1B in Tokenized Assets

The post Polygon Tops RWA Rankings With $1.1B in Tokenized Assets appeared on BitcoinEthereumNews.com. Key Notes A new report from Dune and RWA.xyz highlights Polygon’s role in the growing RWA sector. Polygon PoS currently holds $1.13 billion in RWA Total Value Locked (TVL) across 269 assets. The network holds a 62% market share of tokenized global bonds, driven by European money market funds. The Polygon POL $0.25 24h volatility: 1.4% Market cap: $2.64 B Vol. 24h: $106.17 M network is securing a significant position in the rapidly growing tokenization space, now holding over $1.13 billion in total value locked (TVL) from Real World Assets (RWAs). This development comes as the network continues to evolve, recently deploying its major “Rio” upgrade on the Amoy testnet to enhance future scaling capabilities. This information comes from a new joint report on the state of the RWA market published on Sept. 17 by blockchain analytics firm Dune and data platform RWA.xyz. The focus on RWAs is intensifying across the industry, coinciding with events like the ongoing Real-World Asset Summit in New York. Sandeep Nailwal, CEO of the Polygon Foundation, highlighted the findings via a post on X, noting that the TVL is spread across 269 assets and 2,900 holders on the Polygon PoS chain. The Dune and https://t.co/W6WSFlHoQF report on RWA is out and it shows that RWA is happening on Polygon. Here are a few highlights: – Leading in Global Bonds: Polygon holds 62% share of tokenized global bonds (driven by Spiko’s euro MMF and Cashlink euro issues) – Spiko U.S.… — Sandeep | CEO, Polygon Foundation (※,※) (@sandeepnailwal) September 17, 2025 Key Trends From the 2025 RWA Report The joint publication, titled “RWA REPORT 2025,” offers a comprehensive look into the tokenized asset landscape, which it states has grown 224% since the start of 2024. The report identifies several key trends driving this expansion. According to…
Share
BitcoinEthereumNews2025/09/18 00:40