DSS

DSS 2026 / Day 1 / Amber Hall

Proving the Spoke: Formal Verification of Aave V4’s Hub-and-Spoke Architecture

Lilian Cariou

14:43 · Recording

Watch on YouTube ↗Open recording viewerOriginal programme entry
Download plain textDownload timestamped JSON

Source: YouTube automatic caption track · Exported 2026-11-16. Timestamps link to the source video. Cue end times were not supplied.

Transcript

0:00Hello everyone. Uh, I'm Lilian. I'm

0:03working for Centrifuge. I'm doing I do

0:06security and formal verification for

0:07more than a year and a half. And if

0:09approved by the DAO governance, um

0:13custom spokes can be integrated within

0:15uh shared liquidity apps um on Aave V4.

0:19So the idea of this talk is to give you

0:21an overview of what we formally proved

0:23on Aave and what you should formally

0:25prove if you want to develop your custom

0:27spokes and maybe have it integrated one

0:29day within the architecture.

0:33Uh, tuk tuk.

0:36Uh, so let's start about where we left

0:38last year. If you were there last year

0:40in GSS Buenos Aires and you saw the Aave

0:43Centrifuge talk presented by Darius

0:45Achief from Aave team and Thomas Ganor

0:48from previous Centrifuge. This one was

0:50about the apps, why the architecture,

0:52why this design, how the math works, how

0:54winding can drift, and one headline

0:57property. The share weight can never go

0:58down. It finished on a promise um on the

1:02properties exist, you can take the new

1:04spokes against them.

1:05So some numbers to get your attention.

1:08Aave V4 of course is live on multiple

1:11networks. It has more than 1.4 billions

1:14uh dollars supplied and more than 450

1:18millions uh dollars borrowed. So it's

1:21bigs and let's see how it works.

1:25First at the bottom, we have the apps.

1:28The apps hold the liquidity and the

1:30share accounting with a separate set of

1:32books per assets. Apps are similar to

1:34vaults and um and it caps what each

1:37spoke can add and can draw. So the draw

1:40caps is the spoke credit line. Then we

1:42have spokes. Spokes are similar to

1:44markets with an Oracle prices with

1:47parameters and user position.

1:49Then we have users. Users only interact

1:52uh

1:53to to a spoke via simple calls like

1:57supply, withdraw, borrow, repay. And

1:59finally we have custom spokes that can

2:02plug in and reuse the liquidity that

2:04they already desire.

2:05Babylon spokes which is a custom spoke

2:07extern to Ave should be the first one if

2:10the approval is accepted.

2:12It's a basically a lending market for

2:15Bitcoin vault collateral that draws on

2:17Ave liquidity instead of bootstrapping

2:18its own.

2:20So um the question for the rest of the

2:22talk is what do the spokes have to

2:24guarantee and what do the Ave guarantees

2:26back? But before the properties let's

2:29see where the state lives.

2:31On the left you have what this what the

2:34Ave stores per assets. So liquidity,

2:37shares, index and premium accountings

2:39and underneath it you have um the per

2:43spoke slice which is what the Ave

2:46believe each individual spoke is

2:47holding. On the right you have what the

2:50spokes basically stores position per

2:52user per reserve. Each spoke has its own

2:55storage of course because they have

2:57different contracts. They are just

2:59connected or linked to the same Ave uh

3:02and by the way a spokes can be connected

3:04to a multiple Ave.

3:06But um but spokes here are connected to

3:11the same Ave sharing the liquidity which

3:13makes this architecture so powerful. And

3:15one things really important on this

3:17slide is that um um the the the the

3:21agreements between Ave and a spokes

3:24because a spokes only ever sees per

3:25total uh

3:27spokes. It never sees user position. So

3:29the property linking a Ave and a spokes

3:32um is uh is a property sorry the

3:35agreement between a Ave and a spokes is

3:37a property linking per spokes total Ave

3:39per spokes total to spokes per user

3:41position which has to be formally

3:43proved. So let's have a look on what we

3:45proved on the Ave.

3:47The first property that was already

3:49discussed last year as I said is a share

3:51weight only goes Ave. So total assets

3:54over total shares never decreased after

3:56any function. The second properties is

3:58that the Ave stays solvent. So total

3:59asset cover total shares. What do we

4:02mean is that we verified here that the

4:04share weight is always at least one.

4:06Property number three, no spokes can all

4:09shares the hub as an account. So here we

4:11verified that every spoke share sends to

4:14the hub totals. And property number

4:16four, this is a property that makes a

4:18custom spokes a tractable piece of work

4:20at all in terms of formal verification

4:23because we formally verified that if

4:26that one spoke cannot touch another

4:28basically. So let's zoom on this fourth

4:30property and have a look at what does it

4:33looks like from a verification language

4:35CVL point of view.

4:37The idea of this no change to the spokes

4:40rule is to have this F

4:42here which is parametric meaning it can

4:45be any hub function. So we make sure

4:47that no matter the function call on the

4:49hub from a spokes um

4:52the state stays the same for a spoke

4:54that is different ones than the one we

4:56target. So whatever spoke A does on the

4:59hub

5:00doesn't

5:01is it cannot add to spoke B's depth

5:04depth. It cannot shrink spoke B shares

5:07and cannot add a spoke A cannot add to

5:09spoke B deficit. And the table on the

5:12right is the idea in one picture.

5:14For example, we have spoke A sorry there

5:17are there should have been animation but

5:19but here we are. And the idea is that

5:21spoke A borrows its one shares goes for

5:24100 to 140.

5:26And we formally verified that for spoke

5:28B and spoke C it stays the same.

5:31So as I said, this is a property that

5:33lets a spokes be added without

5:34re-auditing the ones already deployed

5:37because

5:38if you develop your custom spokes, you

5:40have the formal insurance that even when

5:42added to a new to a hub, it won't be

5:44touched by another one.

5:46So that was the upside. Let's have a

5:48look on what we prove on the spoke.

5:51On the spokes, we have five families.

5:52Family number one is user isolation and

5:55accounting integrity.

5:57By user isolation here, what do we mean

6:00is that we verified that if your balance

6:03with an average change, it means that

6:05you are a position manager you approve

6:07make the call. And there is an exception

6:09here. I left the security researcher in

6:11the room guess what the exception for

6:14user isolation. And about non-zero

6:16change, here we wanted to verify that

6:19whatever user gets

6:20it means a non-zero cost come with it.

6:23So for example, if shares are minted

6:25from protocol, we verified that tokens

6:28went in. If token are going out from the

6:30protocol, it means that either shares

6:33were burned or debt was added. And if

6:35debt goes down for an account, it means

6:38that tokens went in.

6:40And here again, there is an exception.

6:42It's due to windings, of course, we all

6:44know that. But for winding, we verified

6:46that it's never under shares, token or

6:48debt really for free. So basically, we

6:51verify that windings is always in the

6:52protocol favor.

6:55Going back to isolation, here the

6:56exception you may have guessed that it's

6:58it's liquidation.

7:00It's well known and at its own family,

7:02so it's

7:03we will get into it soon.

7:06On family number two is consistency.

7:10As a reminder here, the only ever sees

7:13one total per it doesn't see user

7:16position.

7:17So

7:19it relies on the

7:21own per user books to decide who may

7:23borrow or not. And if these books drift

7:26from what the believes each individual

7:29as, it means that

7:32liquidity can live against positions

7:33that do not exist. And this loss would

7:35land on users that never interacted with

7:38with these

7:39So that's the reason we have this this

7:42family to prove that there is a

7:44consistency between and a

7:46The proof we built to prove a

7:49consistency has three pieces. The first

7:51piece is a ghost. A ghost is a winding

7:53total the prover keeps which is not part

7:55of the contract.

7:57The second piece of the proof is a

7:59A as its name suggests is

8:03triggers on every write to drawn shares.

8:05So on every SS draws on the code to

8:08drawn shares here anywhere in the code,

8:11it will keep it it it is triggered. And

8:14the the goal of this hook is to keep the

8:17growth variable we just defined up to

8:19date.

8:20And this English path that nobody sought

8:23to test, that's why this kind of

8:25properties is a good is a really good

8:26fit for formal verification.

8:28And piece number three is the invariant

8:30itself, that the total equals of the

8:32record for this box between the spoke

8:35and the app. Um

8:37here this invariant is proved by

8:39induction, meaning it's it's true after

8:41deployment and preserved by every call.

8:44Again, here the exception is

8:45liquidation, but liquidation sits

8:48kind of outside this

8:50this family this family and has its own

8:53family.

8:54And

8:56and as I said, this three proof pattern

8:59can be can be useful for other variables

9:02like drawn shares, supply shares, and

9:04premier shares and offsets. But here the

9:06idea for

9:08for drawn shares between the spoke on

9:10the app was to prove that they matches

9:12exactly because a missing share will be

9:14debt nobody owes and an extra one will

9:17be debt nobody can repay.

9:20Family number three is else factor.

9:22Basically, when you have a landing

9:23protocol, you want to make sure that no

9:26operation lower else without a checks.

9:28So that's what we did and in addition,

9:30we verify that an NFT account can only

9:32move back up. And what was interesting

9:35is there is that for the function they

9:37skip the L checks, we verify that they

9:40can only add collateral or reduce

9:42depths.

9:43Family number four, position invariants.

9:46Here we verify that a position never

9:48takes a shape the protocol cannot

9:50handle. So kind of obvious things but

9:53kind of hard to verify for manual audits

9:55or LLM audits that the depth there is no

9:57depth without collateral, the borrowing

9:59flags always matches the actual depths

10:01and there is no balance in a reserve

10:03that does not exist.

10:05Because all those states will make

10:07all the downstream calculation

10:09meaningless. So what we did is that we

10:11roll them out once as invariants. And

10:14and yeah, again this is kind of property

10:16that is really good fit for EV.

10:18And family number five, finally

10:21liquidation. Here the main goal was to

10:24verify that only an NLC account can be

10:26liquidated. In addition, we verified

10:28properties like if the liquidator

10:31received collateral, it means the

10:33borrower debts goes down, seizure and

10:35bonus stay bound, and there is no

10:37uninvolved account between during the

10:40liquidation, and no bad debt is white

10:42enough while the borrower still has

10:43collateral.

10:45These five families of rules we proved

10:48on the spokes represent around 60 rules.

10:52And everyone of them calls the So the

10:54question is if you develop your custom

10:57spokes, do we need to reprove the each

10:59time? Because when we when we try to

11:02that, we had to face the challenge of

11:05trying to prove to be code because the

11:07on a spoke is

11:09is obviously

11:10a big piece of code. And for that the

11:13answer is no, we don't have to reprove

11:15the because when we face that we had to

11:18use what we call modular verification.

11:20And for that we created what we call

11:23symbolic app.

11:25So let's have a look at the symbolic

11:26app.

11:27The idea of this part is that you, as I

11:29said, you don't verify a system this big

11:32in one piece. You split it, that's

11:34modular verification. And modular

11:35verification can be achieved in three

11:37steps. The first step is that you prove

11:39each component on its own. For example,

11:41for the

11:42share rate, solvency, per spoke

11:45isolation properties were proved once

11:48with no spokes involved. So they were

11:49really proved on their own system. The

11:52second step is that your proof become

11:54axiom. So when when we we first created

11:58the symbolic that specs, we define some

12:01variable on it that was that were

12:04important for for us like the share to

12:06asset ghost variable.

12:08A ghost variable is a variable that we

12:10let free, meaning it can take any

12:12values. But on these values, we assume

12:15two behaviors that we already proved on

12:17the hub,

12:19uh that are the share only goes up and

12:21it never drops below one. Those are

12:23properties from a few slide ago that we

12:25verified on the hub and that we know

12:27that they hold. So at the end, we have a

12:29free variable which establish the the

12:33the hubs uh the hubs guarantees that we

12:36already verified. And share trust at

12:38ratio is an example. We can define other

12:41variable like for example debt index can

12:42get the same treatments.

12:44And uh and that's proof number two

12:46basically. The proof become axiom and

12:48the axiom is what you assume uh that you

12:52already proved on the hub.

12:53Step number three is that you summarize

12:56every every hub call uh

12:58so when you want to verify something

13:00about the spoke, about your custom

13:02spokes, what you do is that you replace

13:04every hub calls the spoke makes by a few

13:07line of C V L running to the ghost

13:10variable which establish the hubs

13:12behaviors.

13:14So at the end, the spoke is proved

13:16against what the hubs guarantee

13:18which is strong, which is mostly cheaper

13:20and easier to prove for the

13:23not against one version of its code. And

13:25on top of that, what's nice is that if

13:27you develop your custom spokes, you can

13:29reuse this symbolic hub uh file.spec.

13:32You can import it on your projects and

13:34uh on the formal verification part of

13:37your custom spokes will be a lot

13:38cheaper.

13:41So if you want to develop your custom

13:43spokes, I hope I convinced you. Um there

13:45are three steps. The first step is that

13:47you import the shared model, symbolic

13:49hub, math summaries, positions, such

13:51models. Everything is available on our

13:53repo.

13:54Uh second is that you prove the

13:55checklist. Your custom spokes uh will

13:59can be proved against five families

14:02which represent around 60 rules on

14:03invariants. And this is important that

14:06you reprove them because they describe

14:08what any spokes must guarantee. And

14:10finally um step number three is that you

14:13write rules only for what you change.

14:15For example, Babylon will liquidate a

14:18BTC vault, which is different than other

14:20spokes does. So,

14:22it's a new behavior, meaning you have to

14:24develop new rules, and for that we can

14:26help at of course

14:29on this process. So, at the end, the

14:31answer to how much formal verification

14:32work is a custom spokes is only the

14:35different ones, not the world, which

14:36makes everything a lot easier.

14:40Thank you very much.

Source and accuracy details

Source export SHA256: 85f5c0e5913c5bab1e6f8d94b80373592a157c4dfbb7b82c5288d9e60a70e904