L2 Security Audits: Securing Bitcoin’s Next Generation

Thesis Defense Team
Thesis Defense
Published in
5 min readApr 3, 2024

Bitcoin L2 protocols are proliferating. The result? Ushering in an era of unprecedented speed, versatility, and value for Bitcoin. By enabling smart contracts, DeFi services, and seamless cross-chain communication, L2 technologies are not just expanding Bitcoin’s utility — they’re transforming it from a digital store of value into a robust platform for a wide array of decentralized applications.

Together with other innovations in the ecosystem like BitVM, BRC-20 tokens, and Ordinals, opportunities for Bitcoin developers and users are vast. Yet as is often the case in crypto, with technological advancement comes complexity and risk — both reputational and financial.

The Importance of Security Audits

As L2 solutions reduce network congestion and enable a richer set of applications, they also introduce new vulnerabilities and potential security issues. That’s where security auditors come in.

Security auditors are white hat professionals who specialize in assessing and determining mitigations for the security risks in crypto systems and infrastructure. They’re also well equipped to determine the best methods to both optimize and decentralize those systems. With around $64 billion stolen in hacks in the past two years alone, prioritizing security due diligence is paramount.

To contextualize this, security auditors can help Bitcoin L2s by:

  • Identifying latent vulnerabilities: Regular, comprehensive audits help in identifying potential security weaknesses in the code, ensuring that any updates or changes haven’t introduced new security vulnerabilities.
  • Ensuring compatibility and interoperability: As multiple L2 solutions emerge, security auditors can evaluate the interaction with other L2s and L1s to determine security loopholes or operational inefficiencies, and identify solutions.
  • Countering fraudulent activities: Malicious actors may withhold or present fraudulent data to mislead users or the system. Robust fraud detection mechanisms, including security audits, can help counter this.
  • Understanding unique vulnerabilities: Each L2 solution has a unique system design and, as a result, a nuanced attack surface area, leading to the potential for edge cases. An in-depth understanding of individual L2 system designs and implementations is essential for effective risk mitigation.
  • Building a strong foundation: Every new L2 launching on Bitcoin will aim to build an ecosystem of its own with a strong application layer, introducing a host of dApps that will require a strong and secure foundation, requiring security audits of their own. Engaging security auditors at the genesis sets a precedent for each L2 ecosystem, promoting security due diligence practices across the board.

With Bitcoin L2 season upon us, it has become quickly apparent that the Bitcoin ecosystem is underserved in terms of security. In contrast to Ethereum and other prominent ecosystems, security audits for teams building on Bitcoin are still rare, owing to the relative novelty of Bitcoin L2s. In order for the ecosystem to successfully make this transition, this needs to change.

Why Choose Thesis Defense?

Thesis Defense is a pioneer in auditing projects in the Bitcoin ecosystem — the first team to learn Clarity and provide security audits to the Stacks ecosystem in 2021, following the v2 launch. Since then, the Defense team has publicly audited notable projects including Zest Protocol, Magic Protocol, Trust Machines’ MultiSafe wallet, Leather Wallet (prev. Hiro Wallet), and Alex Protocol. Our work with Clarity and the Stacks ecosystem exemplifies our commitment to tackling new challenges and expanding our expertise. Most recently, we’ve partnered with other teams building in the Bitcoin ecosystem, including Hermetica and Ordiswap.

Beyond this, Defense auditors have carried out hundreds of audits in recent years, demonstrating proficiency in an array of languages widely used across the Bitcoin ecosystem, including Solidity, JS/TS, Go, and Rust. We’ve helped secure a wide range of technologies — smart contracts, bridges, roll-ups, DEXes, lending platforms, and wallets — in multiple leading ecosystems, including Ethereum where we most recently established a long term partnership with POKT Network.

Our Services

As the Bitcoin ecosystem expands, the need to begin integrating security services is paramount. Our services include:

  • Scoping and planning: Audit teams play a pivotal role by offering expert insights during the scoping and planning phases of development roadmaps. By engaging early in the process, development teams can proactively plan, schedule, and budget for security audits and design reviews, rather than retrofitting them after development is complete.
  • Security by design reviews: Reviewing design specifications, whitepapers, architectural diagrams, and other system design documentation helps ensure that security is integrated into a system’s design and architecture. By addressing issues early on in the design phase, upfront cost of security auditors will help avoid more costly changes or worse, hacks, later in a project’s lifecycle.
  • Manual code reviews: Line by line code reviews aid in identifying potential security vulnerabilities, coding errors, and other issues in a project’s codebase. Our approach begins with a threat modeling exercise, followed by assessing the security of the system’s design and implementation, in addition to determining the application of best practices when it comes to the use of dependencies, tests, and documentation.
  • Penetration testing: The process of simulating a series of attacks against a system checks the robustness of its defenses and identifies potential vulnerabilities that an attacker could exploit. This results in recommendations on how to better secure those systems in order to mitigate against potential vulnerabilities.

These services extend to the development teams building L2s in addition to those teams that will inevitably build the application layer on top of them. Engaging auditors facilitates the integration of security from day one.

Securing the Future of Bitcoin

Bitcoin offers tremendous opportunities for innovators and investors. Yet, due to lack of access to security audits and broad awareness about security best practices, most teams will move too quickly to seize these moments at the expense of security. At Thesis Defense, we understand your constraints and will work with you to strengthen your security while you focus on your project’s mission and roadmap to launch. Get in touch!

Thesis Defense auditors have carried out hundreds of audits on decentralized systems across a number of technologies including smart contracts, wallets, bridges, consensus mechanisms, and cryptographic protocols. In addition to Bitcoin, we work across a variety of ecosystems including Stacks, Ethereum, Solana, Cosmos, Avalanche, Zcash, and more.

To learn more about our services and get a free quote, schedule a call or email us @ defense@thesis.co. For more information about Thesis Defense, visit us on our website, blog and X (Twitter).

--

--