Introduction

On April 21st 2025, zkSecurity started a security audit of Renegade’s updated circuits and contracts. The code was shared via public GitHub repositories, accompanied by written specifications for both the circuits and smart contracts. The audit lasted two weeks with one consultant.

This is zkSecurity’s third audit collaboration with Renegade. The first audit reviewed circuits and Stylus contracts in general, while the second audit was focused on a new feature, atomic settlement. A detailed description of the system can be found in those two reports.

Scope

The Renegade team froze the following branches in the three affected repos for this audit:

  1. renegade/zksecurity-audit-4-21-25
  2. renegade-contracts/zksecurity-audit-4-21-25
  3. renegade-solidity-contracts/zksecurity-audit-4-21-25

The audit, performed on the branches listed above, covers several updates to the Renegade platform:

  • Solidity contracts. Stylus (Rust) contracts were rewritten in Solidity to support deployment to more chains. We reviewed the renegade-solidity-contracts repo, covering all methods of the Darkpool contract and its subcomponents.
  • Malleable matches. A new darkpool capability was added: Performing an atomic match-settle trade, where the exact match size does not have to be decided at proof creation time, but only when calling the onchain contract. The circuit only specifies bounds on the trade size.
    We reviewed the new circuit and the new Stylus contract method, as well as the Solidity method covered by the first point.
  • Optimization: In-Circuit Full Wallet Commitments. Previously, circuits only computed a commitment of private wallet shares, which was combined with public shares onchain to produce the full wallet commitment. To save gas consumed by onchain Poseidon-hashing, the computation of full commitments in some methods was moved down into the circuit. For other methods, an alternative that expects the full commitment in the proof statement was added next to the existing variant.
    We reviewed changes to the affected circuits and methods, covered by the following commit ranges in the respective repos: renegade, renegade-contracts. We also reviewed updated Merkle insertion methods.
  • Optimization: Poseidon gadget. The Poseidon gadget was rewritten to make more efficient use of jellyfish’s PLONK layout, collapsing the entire round function into a single row per state element.
    We reviewed the new Poseidon gadget in its entirety.

Summary

The code in all three repositories was found to be well-organized, well-tested, thoroughly commented, and of high quality. The Renegade team was highly responsive and provided valuable context throughout the process.

We did not find any issue in the new Poseidon gadget or with in-circuit full wallet commitments. In the new malleable-match circuit, a single soundness bug was identified, deep inside the low-level gadgets it depends on.

Although not explicitly part of the audit scope, we re-reviewed Renegade’s “proof-linking” relation used in several contract interactions to bundle proofs from different parties. No further issue of note was found in this effort.

Most of our findings relate to the new Solidity contracts. Apart from several specific issues, we added a summary finding to document a few best practices that we think could benefit the codebase going forward. Given Renegade’s goal of supporting tokens as permissionlessly as possible, we recommend maintaining a comprehensive database of known ERC20 token quirks and their potential security implications. As the protocol expands its token support, we advise implementing a continuous monitoring and testing process to ensure that these token-specific behaviors don’t introduce new attack vectors or vulnerabilities into the protocol’s core functionality. The following overview is a great starting point.