Where a Daml protocol's safety actually lives
What we learned getting Alpend audited on a network with no audit playbook: the guarantees sit in the ledger's authorization rules, not the code.
Most of what the industry knows about auditing smart contracts was learned on EVM chains. It comes as a checklist: known attack classes, applied contract by contract.
Canton has no such checklist. When we brought in Halborn to review Alpend, our money market on Canton, the first thing we needed was an auditor who would not reach for one.
The guarantees are in the authorization layer
In Alpend, most of the security model is not in application code. It sits in the ledger's authorization rules: who has to sign a contract, and who is allowed to act on it. In Daml these are signatories and controllers.
Every position in Alpend is a contract co-signed by the user and the pool operator. Neither side can forge a deposit or hide a debt on its own. That property is not a check someone remembered to write. It is how the ledger works.
Which means a review that only hunts for bad code can miss the place where the real guarantees are, or aren't. A mistake in who signs what is a mistake in the protocol, even if every line of logic is correct.
The stakes are higher than one protocol. A pooled lending market holds other institutions' assets, so one unaddressed flaw in authorization or accounting can reach counterparties well beyond us.
What was reviewed
- The full Daml multi-package workspace and how its contracts relate to each other
- The signatory and controller sets that govern authorization across pool positions
- The on-chain risk recomputation across the full collateral basket
- The oracle path, including on-chain signature verification of signed price reports
Findings you can run
Every finding came back as an executable Daml Script scenario, not a paragraph. Each one passes on the audited commit, which proves the bug is real, and contrast tests isolate the exact cause.
The review produced 30 findings, none of them critical. We fixed all of them in a single commit. The scenarios now live in our repository as about 350 regression tests.
A finding you can run is worth more than one you can read. Nobody argues about whether it is real, and it stays fixed.
Testing the tester
No existing harness could produce valid signed reports for our oracle verification path. So Halborn built a signed-report generator from scratch, then tested their own generator with tampered reports and wrong-signer reports to confirm Alpend rejected both.
Authenticity is half of the oracle problem. The other half is whether an authentic price is still fresh enough to use.
What changes with institutions
Diligence with an institutional counterparty used to start with our claim about the design. Now it starts with an independent party's documented attempt to break it, plus a security architecture writeup that their engineering, compliance and risk teams can read as is.
Canton has no established audit corpus. The right auditor learns your trust model on its own terms, then audits what you actually built.