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

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 [email protected].

Market Opportunity
DeFi Logo
DeFi Price(DEFI)
$0.000305
$0.000305$0.000305
-3.48%
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 [email protected] 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

Coinbase CEO advocates for crypto legislation reform in Washington DC

Coinbase CEO advocates for crypto legislation reform in Washington DC

The post Coinbase CEO advocates for crypto legislation reform in Washington DC appeared on BitcoinEthereumNews.com. Key Takeaways Coinbase CEO Brian Armstrong is actively working in Washington, D.C. to promote new crypto market structure legislation. Armstrong is aiming to prevent future SEC leadership similar to former chair Gary Gensler. Coinbase Chief Executive Officer Brian Armstrong said he is working in Washington to advance crypto market structure legislation and prevent another Securities and Exchange Commission chair like Gary Gensler from taking office. The Coinbase CEO said he is focused on getting crypto market structure legislation passed. Coinbase, the largest U.S. crypto exchange, has been among the companies navigating the regulatory landscape as lawmakers and agencies work to establish clearer rules for digital assets. Source: https://cryptobriefing.com/coinbase-ceo-crypto-legislation-washington-dc/
Share
BitcoinEthereumNews2025/09/18 09:43
Pope Leo laments a world ‘in flames’ at Ash Wednesday service

Pope Leo laments a world ‘in flames’ at Ash Wednesday service

'It is so easy to feel powerless in the face of a world that is in flames,; said Leo, the first US pope.
Share
Rappler2026/02/19 11:40
CME to launch Solana and XRP futures options on October 13, 2025

CME to launch Solana and XRP futures options on October 13, 2025

The post CME to launch Solana and XRP futures options on October 13, 2025 appeared on BitcoinEthereumNews.com. Key Takeaways CME Group will launch futures options for Solana (SOL) and XRP. The launch date is set for October 13, 2025. CME Group will launch futures options for Solana and XRP on October 13, 2025. The Chicago-based derivatives exchange will add the new crypto derivatives products to its existing digital asset offerings. The launch will provide institutional and retail traders with additional tools to hedge positions and speculate on price movements for both digital assets. The futures options will be based on CME’s existing Solana and XRP futures contracts. Trading will be conducted through CME Globex, the exchange’s electronic trading platform. Source: https://cryptobriefing.com/cme-solana-xrp-futures-options-launch-2025/
Share
BitcoinEthereumNews2025/09/18 01:07