# Bonded security campaigns

**A feasibility study and open reference design for reviewers who stake on the code they reviewed**

Version 1.0 · 13 November 2026 · Grant proposal to TheDAO Security Fund, ETHSecurity Initiatives Round 2. Initiative 3 of 3. Research stage: proposed terms only, no live funds.

Online: https://proofofaudits.com/whitepapers/bonded-campaigns

## Abstract

After an audit is delivered, nobody is accountable for the code that ships. The auditor is paid either way, and a later exploit costs the auditor reputation at most. Users cannot tell an auditor who would stand behind a review from one who would not.

A bonded campaign lets reviewers stake a bond against a precisely defined scope: a frozen hash of the scope, the reviewed commit and the deployed runtime. If the reviewed code is exploited in scope, the bond pays the protocol first. If the code was changed after review, the bond does not pay, and the runtime-hash rule decides this mechanically. Reviewers who stand behind clean code get their bond back plus a fixed reward.

We have a proposed-terms escrow contract with 45 passing Foundry tests (including fuzz tests of the payout bounds), a deterministic replay of four scenarios on a local chain, and a TypeScript model that matches the Solidity results. Nothing is live, nothing has been independently reviewed, and several questions (legal classification, loss measurement, reviewer selection) are open. This grant funds a feasibility study: publish the design, get it independently reviewed, run testnet pilots with real platforms, and publish what works and what does not.

## Live demos

- [Demo: four scenarios replayed](https://proofofaudits.com/stake-to-audit/demo)
- [Bonded campaigns programme page](https://proofofaudits.com/bonded-campaigns)

## 1. The problem

Audit quality is hard to see before the fact and expensive to learn after it. Today's signals are firm reputation, contest leaderboards and the length of a report. None of them puts anything at stake on a specific deployment.

- **Misaligned incentive.** Review fees are paid on delivery. A missed critical bug costs the reviewer nothing directly.
- **Unclear scope.** Even when a firm wants to stand behind its work, it can only do so for the code it reviewed. Upgrades and unreviewed changes make "what did you stand behind?" ambiguous.
- **No credible signal for users.** "Audited by X" says nothing about how confident X is in this particular deployment.

Proof of Audits' evidence layer (Initiatives 1 and 2) already pins scope to a commit and a runtime hash. A bond can use that pin to decide mechanically whether an incident is in scope.

## 2. Design goals

1. **Exact scope.** A bond covers named functions of a frozen runtime, nothing else.
2. **Changed code is not covered.** If the exploited runtime differs from the reviewed runtime, no bond is slashed.
3. **Bounded loss.** A reviewer can never lose more than a declared share of the bond, and a claim never pays more than the loss or the campaign's coverage cap.
4. **Separate bounty money.** Bug bounties are paid from their own budget and never touch bonds.
5. **Conflicts declared up front.** A reviewer cannot vote on a claim against a bond whose owner declared a conflict with them.
6. **Principal is never swept.** Unused rewards and bounty can be returned to the protocol; bonded principal can only go back to its owner or to a settled claim.

## 3. Mechanism

### 3.1 Roles

*Roles in the reference escrow*

| Role | Does |
| --- | --- |
| Protocol | Deploys the escrow, sets the terms, funds the reward and bounty budgets, files claims. |
| Auditor (up to 3) | Accepts the frozen terms by hash, posts a bond on chosen functions, may respond to a claim, may appeal once. |
| Reviewer (5) | Votes on claims after the response window. Three matching votes decide. |
| Appeal arbiter (1) | Resolves the single appeal allowed per claim. |

All roles must be distinct, non-zero addresses. In this design the reviewers and the arbiter are trusted parties; section 6 discusses what that implies.

### 3.2 Lifecycle

1. **Terms.** The protocol sets the terms (bond limits, capacity, reward rate, budgets, coverage cap, ordinary cap, durations and a bit-mask of in-scope functions) and may change them until it calls `freezeTerms(scopeHash, commitHash, runtimeHash)`. Freezing fixes the enrollment end, maturity and reporting-tail end, and pulls the full reward and bounty budgets into the escrow. The terms hash binds the chain id, escrow address, terms, the three hashes, the reviewers and the arbiter.
2. **Bond.** An auditor calls `acceptAndBond(amount, functionMask, sharedLiability, conflictMask, acceptedTermsHash)`. The call fails unless `acceptedTermsHash` equals the frozen terms hash, so an auditor always bonds against exactly what they read. `topUp` adds to a bond during enrollment.
3. **Claim.** Before the reporting tail ends, the protocol files a claim with the exploited function, the loss and the incident runtime hash. If the runtime hash differs from the reviewed one, nothing is eligible. The payout is reserved on the eligible bonds at filing.
4. **Response and vote.** Auditors may respond during the response window. Reviewers then vote until the claim's time limit. Three matching votes approve or reject; approving a zero-payout claim reverts.
5. **Appeal.** One appeal per claim: an affected auditor against approval, or the protocol against rejection. The arbiter resolves it.
6. **Settle.** Anyone can call `settle`. On approval, reservations become slashes and the payout goes to the protocol. On rejection, reservations are released. A claim nobody decides in time expires and releases its reservations.
7. **Exit.** After the tail, each auditor withdraws remaining principal plus the full reward. Withdrawal is blocked while any reservation on that bond is open. The protocol can sweep unused reward and bounty budget, never principal.

### 3.3 Payout rules

```text
reward(bond)      = bond × rewardRateBps / 10,000            (fixed, over the whole lock)
headroom(bond)    = bond × ordinaryCapBps / 10,000 − slashed − reserved
eligible bonds    = bonds whose functionMask covers the exploited function
                    (if more than one bond is eligible, only those that opted into shared liability)
payout            = min(loss, coverageCap, Σ headroom(eligible))   — 0 if runtime ≠ reviewed runtime
slash(bond)       = payout split across eligible bonds in proportion to headroom
                    (largest-remainder rounding, so the parts sum exactly to the payout)
```

The reward budget must cover full capacity at the reward rate before terms can be frozen, so every enrolled bond's reward is pre-funded.

## 4. Worked example: four scenarios, replayed

The replay runs the real escrow on a local Anvil chain from a fixed genesis, with a fictional vault whose `withdrawFor` is missing an authorisation check. Terms (in token units): minimum bond 5,000; maximum 25,000 per auditor; capacity 50,000; reward 6% over a 270-day lock; reward budget 3,000; bounty budget 2,000; coverage cap 15,000; ordinary cap 50% of each bond; in scope `deposit` and `withdrawFor`, out of scope `rescueTo`.

*Auditors in the replay*

| Auditor | Bond | Functions bonded | Declared conflict | Reward at maturity |
| --- | --- | --- | --- | --- |
| A | 5,000 | deposit, withdrawFor | none | 300 |
| B | 10,000 | withdrawFor | none | 600 |
| C | 20,000 | deposit, withdrawFor | reviewer 4 | 1,200 |

*Outcomes*

| Scenario | What happens | Result |
| --- | --- | --- |
| A. Covered exploit | `withdrawFor` is exploited on the reviewed runtime; loss 8,000. Payout = min(8,000, 15,000, 17,500) = 8,000. | Approved. Slashes 1,142.857143 / 2,285.714286 / 4,571.428571; each auditor keeps the rest of the bond and the full reward. |
| B. Code changed after audit | The exploit is in `rescueTo` on a changed contract. The incident runtime hash differs from the reviewed one. | Payout 0, rejected. Full principal and reward return. |
| C. Bug bounty | A researcher reports a bug before exploitation. | 1,000 paid from the bounty budget. No bond touched. |
| D. Campaign matures | No incident during the lock and tail. | Full principal and reward return. |

In every scenario 900 of unused reward budget is swept back to the protocol (capacity was not filled). The TypeScript model in the site reproduces all four outcomes exactly; a parity test fails the build if they diverge. Watch the replay at [https://proofofaudits.com/stake-to-audit/demo](https://proofofaudits.com/stake-to-audit/demo).

## 5. What exists, and what does not

*Status of each part*

| Part | Status |
| --- | --- |
| Proposed-terms escrow (`StakeToAuditDemoEscrow.sol`) | 45 Foundry tests pass, 0 fail, 256 fuzz runs; solc 0.8.24. Deploys only on a local chain (31337) or Base Sepolia (84532); the constructor reverts elsewhere. |
| Replay of four scenarios | Deterministic; the replay output matches the committed artifact. |
| TypeScript model and parity tests | Match the Solidity replay for all four scenarios. |
| Campaign backend | States draft, open, enrollment closed, settling, closed; fixed to Base Sepolia by a database check. |
| Earlier V1 escrow (`BondedAuditEscrow.sol`) | Roles, pause and emergency refund; 9 tests. Superseded by the proposed-terms design for this study. |
| Misconduct slashing | Not implemented. Proposed only. |
| Independent security review | None yet. |
| Live campaigns, real funds, insurance | None. Nothing on the site is an offer, a return, insurance or compensation for losses. |

## 6. Threat model and open questions

*Risks of the design*

| Risk | Current handling | What the study must answer |
| --- | --- | --- |
| Reviewers collude or are bribed | Five reviewers, 3-of-5 quorum, declared conflicts, one appeal | How reviewers are selected and paid so collusion is costly; whether votes should be public. |
| Protocol files a false or inflated claim | Runtime-hash rule, coverage cap, ordinary cap, reviewer vote | How loss is measured and evidenced on chain. |
| Self-declared conflicts are incomplete | Trusted declarations only | Whether conflicts can be checked against public records. |
| Exploit outside bonded functions | Function bit-mask decides eligibility | Whether function-level scope is too narrow for composite exploits. |
| Token used for bonds fails | Demo token only | Which assets are acceptable for bonds. |
| Legal classification | Not addressed | Whether a bond resembles insurance or a security in key jurisdictions; what terms avoid that. |
| Liveness: nobody votes | Claims expire and release reservations | Whether expiry should favour the protocol or the auditor. |

## 7. What the grant funds

A feasibility study with an open, independently reviewed reference implementation that any audit or contest platform can adopt or reject on the evidence. Proposed ask: **$50,000 over 9 months**, of which $17,000 (one third) is adoption.

*Milestones (proposed)*

| # | Milestone | Budget | Pass condition for the independent reviewer |
| --- | --- | --- | --- |
| 1 | Publish the specification and reference contracts under Apache-2.0; open a public comment period; publish the legal-classification question list. | $8,000 | Spec and code public; every comment answered in a public log. |
| 2 | Independent security review of the escrow; findings fixed. | $15,000 | Review report published; fixes verified by the reviewer. |
| 3 | Public Base Sepolia deployment; the four-scenario replay reproducible by anyone against it. | $10,000 | Contracts verified on the testnet explorer; replay results match. |
| 4 | **Adoption:** at least 2 audit or contest platforms or protocols run a pilot campaign on testnet under the published terms; publish a findings report on what worked. | $17,000 | Pilot campaigns visible on-chain; findings report published. |

No mainnet funds are used during the grant. A mainnet version is a separate decision after milestones 2 and 4 and legal advice.

## 8. Team, reviewer and co-funding

- **Team.** Proof of Audits, led by its founder, Veer ([veer@proofofaudits.com](mailto:veer@proofofaudits.com)). The escrow, tests, replay and model described here are in the Proof of Audits codebase and shown on the site.
- **Independent technical reviewer.** To be agreed with TheDAO Security Fund before milestone 1 starts, with no ties to Proof of Audits.
- **Co-funding.** None committed as of 13 November 2026. We will ask audit and contest platforms that would run pilots to pledge about 15%.

> **Not an offer.** Bond sizes, reward rates and settlement rules are proposed and may change. Nothing in this paper is an offer, a return, insurance or compensation for losses.

## References

- [Foundry](https://getfoundry.sh/)
- [Base Sepolia testnet](https://docs.base.org/chain/network-information)
- [TheDAO Security Fund](https://thedao.fund/)
