DSS 2026 / Day 2 / Amber Hall
Removing the Staking Oracle: Beacon Chain Proofs in Production
Clément Moller
Source: YouTube automatic caption track · Exported 2026-11-16. Timestamps link to the source video. Cue end times were not supplied.
Transcript
0:04Okay.
0:05Hi everyone. Uh thanks a lot for
0:07attending to this talk. I'm Clement
0:09Molera.
0:10I'm um smart contract developer at Ored
0:13at Origin Protocol for more than two
0:15years now and I would like to present
0:17you today the work that we did at Origin
0:19Protocol. Uh this work has been led by
0:22Nick Edison Nick Edison
0:24who is a smart contract engineer
0:26too.
0:27Uh so what I would like to show you
0:28today is how we remove the staking
0:30oracle on our liquid staking token using
0:33the beacon chain proofs in production.
0:36Okay. So
0:43that's how much is that our liquid
0:45staking token OIS has in its staking
0:48validator strategy.
0:52Think of the last time
0:54No.
0:55Before this this is very great because
0:57for this no one reported this value to
1:00the contract no one nobody.
1:02So think of the last time you audited
1:03the liquid staking token
1:05uh who say to who say to you there is
1:08that much ether in this validator. Most
1:11of the time this is a an external oracle
1:14that pull the value from from the beacon
1:16chain
1:17using off-chain script and pull it
1:19directly into the
1:22into the sorry into the oracle.
1:25Uh why does it matter? It matters
1:27because it drives the rebase. If you
1:28make this value too too high then you
1:31are meeting unbacked liquid stake token
1:33and then you are wrecked. And the
1:35subject of this talk is trying to not be
1:37wrecked.
1:39Uh before that before that at Origin we
1:41was using a trust layer so it was really
1:44easy. It's an off-chain script that
1:46assumed that every validator held 32 ETH
1:50and run the accounting and by running
1:51the accounting every time there is more
1:53we counting as um
1:56as reward and every time there is less
1:57we counting as a slashed event or an
2:00exit.
2:01But anyone can prove the
2:04can prove the value that we have in our
2:06validator.
2:08It's pretty easy. It's the sum of three
2:12three different things. There is first
2:14the pending deposit which correspond to
2:16the deposit queue on the beacon chain.
2:18Then there is the validator on the
2:20beacon chain too. And then there is the
2:23if that are in the contractor itself.
2:27Sorry. So keep this equation in mind. We
2:29will try to break it during this talk.
2:34So for those who don't know that much
2:35how the consensus layer and the beacon
2:37chain works, here is a quick primer.
2:39So since the since the merge, Ethereum
2:41is now two different machine. There is
2:44on one side on the left side the the
2:46execution layer that runs the EVM.
2:48That's most of the time what you use.
2:52That's this is where you have your
2:53transaction, your smart contract, your
2:55balance. That's where you are doing
2:57DeFi. 90% of the time this is the
2:58section of Ethereum that you are doing.
3:01On the other way, you have the beacon
3:02chain and the consensus layer. This is
3:04where the proof of stake run.
3:06On this section, you have the deposit
3:09queue and the validator's balance.
3:12There is one issue with this is that Can
3:14I point? No.
3:16One issue with this is that the EVM
3:17cannot talk directly to the beacon
3:19chain. So if the EVM want to ask, okay,
3:22beacon chain, tell me how many there is
3:24in this
3:25validator that I own,
3:27this is not possible.
3:29So how can we do it something like this?
3:31So thanks to Dan Kuan and the EIP 4788,
3:35every block on the EVM puts the previous
3:37beacon root state into a system contract
3:40on the EVM. I I say it again. Every
3:43block on the EVM put the previous beacon
3:46block root into a system contract on the
3:48EVM. And that's the only way the EVM
3:50know something about the beacon chain.
3:53So what is this contract? This contract
3:55is what we called root 0x000F3 and adds
3:58with beacon so it's easy to remember.
4:00You can cast this and you will receive
4:0297 97 bytes and that's the whole
4:06contract.
4:07You can take the timestamp of this one
4:10and call it with a you uncode it and you
4:13use it as an argument when you call this
4:15and you will receive something that's
4:16called the beacon proof.
4:19And that's all mostly.
4:21If you you have to make it at the exact
4:23block, if you make it one second later
4:25or one second before, then it will
4:26revert. So the rule is pretty simple. If
4:28there is no block, there is no root.
4:32What is this contract? This contract is
4:33a ring buffer of 8,191
4:36entries which represent around 27 hours
4:38of of history. Keep this value in mind.
4:41We will use it at the end of the talk.
4:44So what is this beacon doc root? This
4:47beacon block root basically represents
4:49the whole beacon state
4:51the beacon
4:52chain basically.
4:54It is one giant merkle tree and there is
4:56one specificity in this merkle tree is
4:58that all the position are in a fixed
5:01position. You cannot mess with it. It's
5:02at a fixed position.
5:04So
5:05you have first the beacon block root,
5:07then you go a bit down, there is the
5:08state balances and if you go a bit down
5:10again, you see the leaves and on the
5:13leaves you have the validators balance.
5:14Obviously it's
5:16it's make it easy.
5:17So if you are a caller, it's pretty
5:19simple if you want to recompute it, you
5:21start from here, then you you hash it
5:23with its siblings and you do it all the
5:25way up and that's how you end up with
5:27the beacon block root.
5:28On the other hand, if you are a smart
5:29contract and you want to
5:31decode it, you can take the beacon block
5:33root and all the data
5:35and you can go all the way down using
5:37your installed node storage to take the
5:39indexes at where you have to switch from
5:42one branch to another.
5:44And that's all basically. So if you are
5:46the caller, you choose the data where
5:48you can put any data you want, we don't
5:50care. The only thing that care is the
5:52position. The position is not
5:53negotiable.
5:56So so yeah, that's it mostly. That's the
5:58merkle proof. It's one check in one loop
6:01in around 60 line of solidity code and
6:04that's it. If that was it, uh it would
6:06have been a 5-minute talk. Uh that's
6:08not, so here is the rest.
6:12Here is the rest. So
6:14every time we do a snapshot, we do a
6:17verify, we do something like this on our
6:18contract.
6:20This is permissionless. Anyone in this
6:21room can do it. Anyone can call this
6:23kind of function. And this is great
6:25because you can do it with any data you
6:26like. There is no check.
6:28Basically no check on the data. You can
6:30put it any any data you like at any
6:32time.
6:33So for the next uh something 9 minutes,
6:36you guys will be the the attacker. You
6:38will try Your job today is to make this
6:41value wrong.
6:42If you manage to make this wrong, if you
6:44make it too high, then you are be you
6:46are able to mint uh unbacked liquid
6:48stake token and then uh we are wrecked.
6:50If you make it too low, then some user
6:52will not receive the yield they deserve
6:54and they are wrecked too. So I will try
6:57to show you three ways you can try to
6:59make this value wrong to wreck everyone
7:01and uh what stop this.
7:05Okay, so the first one is is the is the
7:06simplest one. You can hide the
7:08validator. So for the remaining of the
7:10talk, let's assume that you have uh a
7:12set of validator.
7:14Okay, uh you have one of the validator
7:16that just gets slashed. That's sad.
7:19You have a naive contract that keeps uh
7:21the last proven balance for every
7:23validator that you have.
7:24So you make something simple uh to
7:27to update this value, you have to prove
7:29the balance. So you you take all the
7:32validator except the one that that gets
7:34slashed. You compute the proof. You
7:36submit everything. The hash checks out.
7:38The balance are correct and the proof
7:40are correct. So that's pretty simple.
7:42But because you don't account for the
7:43one that gets slashed, uh it's still
7:46counted, so you overestimate how much
7:48does your validator has. And so
7:49congrats, you are wrecked for the first
7:51time today.
7:53How to fix this?
7:54Um so every time we have to prove
7:56something, we have to match against the
8:00validator. So we don't loop against all
8:02the
8:04How can I say it? You don't have to loop
8:05against all the
8:07the the pool that you receive on your on
8:09your argument, but you have to loop
8:11against a list of that you have in your
8:13own storage. And that's how you avoid
8:15this kind of issue. So
8:17the the end of this attack if if you
8:19have to prove something, prove the whole
8:21set, not just one element of the set,
8:23prove the whole set, prove all the
8:24validator at the same time.
8:26Okay, so therefore the second attack say
8:29you can count a deposit twice.
8:31How does it work? So when you do
8:33deposit, your ECE is on the depo on the
8:35deposit queue and have to move to the to
8:37the validator, pretty simple. Uh but
8:39there is an issue on the Merkel proof is
8:42that you cannot some cannot say that
8:43something is happened from this Merkel
8:45proof.
8:46So how do you do it? How do you say
8:48okay, it's not on the deposit queue
8:49anymore?
8:50So you assume that the deposit the the
8:53beacon chain will go the older slot
8:56first. And in our situation, so we
8:59deposited at the slot 100 and the head
9:02of the queue is now 120, okay, pretty
9:04simple. Uh so that's mean that our
9:06deposit should have me should have been
9:08processed. So it lands now in the
9:12into the validator, right? It should
9:14should work like this, right? No?
9:16Okay, if you have to remember one attack
9:17from this talk, this one is the good
9:19one.
9:20It doesn't work because the the spec of
9:22the beacon chain itself breaks this
9:24order.
9:25So a deposit into a validator that goes
9:28back uh goes that goes back to the
9:30queue, it's keep its whole slot. It is
9:33keeping its whole slot. So let's take
9:36this situation. We have our own deposit
9:39that has been deposited at slot 100. So
9:42it's on the past, it's already created
9:44to the validator, everyone is happy.
9:46Then an attacker try to attack us. How
9:48he do it? He simply deposit into a
9:51validator that he that he control and
9:53then he exit it. The exit goes to the to
9:55the back of the queue and the queue goes
9:57up up up up up until it reach the head
9:59of the queue.
10:00And now what's the situation?
10:03So the head of the queue is now 90, but
10:06our deposit is 100. So there is an issue
10:08because we count our deposit into the
10:12into the validator on one side, but on
10:14the other hand now we are counting it as
10:16pending for the second time and so you
10:19count your ETH two time. So you are
10:21wrecked for the second time today.
10:24How do you fix this?
10:26You have two way to fix this and we are
10:29using both. So you can prove the
10:31balance. You have to prove our validator
10:33withdrawable epoch into a simple
10:35question, is it exiting? If this is
10:37never exiting, then the order holds,
10:40everything is all right. Is it exiting?
10:42Then we wait until the head was added at
10:44or after that epoch.
10:45First solution. The second one is we
10:48stop guessing. We don't don't we make no
10:50guess anymore.
10:53An inclusion proof for every deposit
10:54that we still count as pending and like
10:56this we should avoid double counting.
11:00So if you must infer absence, name the
11:02spec rule you depend on.
11:05Which brings us to time and the third
11:07attack.
11:08So when you do a snapshot, you basically
11:09take a photo of the state and you put it
11:11into a transaction. So on this one there
11:13is the ETH that are sitting on the
11:14contract at the block on the execution
11:16layer and the beacon node that represent
11:20that that takes the at the beacon slot
11:23just before on the consensus layer. Like
11:25this you should have all the three
11:26possibility where the ETH could be.
11:28Could be either on your contract, on
11:30your deposit
11:31queue or on the validator.
11:35But
11:37there can be an issue. So when
11:40when you verify a deposit, you don't use
11:42this snapshot because you can use any
11:45beacon block that you want at any slot
11:47that you like.
11:49So here the see the following situation.
11:52You take a you take a slot that is after
11:54the the photo that we take.
11:56During the meantime the ETH get credited
11:58from the pending deposit to the
12:00validator.
12:01And after this
12:04after this sorry
12:07Yeah when when you like to to to verify
12:10it, then there is an issue because your
12:13ETH is not counted nowhere. It's not
12:15counting on the on the pending deposit,
12:17but it's not counting on it's not
12:19counted on the validator. So your ETH is
12:21a bit counted nowhere. And so you are
12:24underestimating how much do you have,
12:26and so you are wrecked for the third
12:27time today.
12:30Um yep, so deposit can only be marked as
12:32proceed at or before the snapshot slot.
12:37And we will end with this. So we have
12:3924/7 hours to lend the proof. You
12:41remember the 24 27 hours from the
12:44beginning. So because then the number
12:46ages. There is no fresh freshness check
12:49on this. So if we are a bit late and we
12:51are missing rewards, okay, that's fine.
12:53We will cut them later.
12:55But if we are a bit late and we are not
12:57reporting a slashed validator, then our
12:59someone that is integrating us can uh
13:03cannot be really accurate.
13:05So if you have
13:06to report a value and you have to pin
13:08every proof to one instant, but you have
13:10to say how old is this value. You have
13:13to publish how old is this value.
13:16Okay, so now we uh dodge the third
13:18bullet. I will drop you so some numbers.
13:21So we are still live with
13:2313,000 for almost 14k of ETH. So not
13:28wrecked today.
13:29Uh we are still using certain
13:31compounding validators. We are still
13:34reproving it every 12 hours and we
13:36computing it at 24
13:38252 time at the moment and zero
13:41slashing. So let's continue to pray.
13:45Uh but don't get me wrong. We didn't
13:47remove the trust at all. We moved it
13:49somewhere. We moved it to the consensus
13:51back, which is now our oracle. So we
13:53have to be sure that we really
13:54understand how the oracle the the
13:56consensus back works. We moved it to
13:59whoever keeps submitting the proof
14:00because if
14:01no one submit the proof, then it's not
14:03accurate anymore. And we are moving it
14:05to the registrator who first decide
14:09where we stake the ETH and uh
14:11then do the first deposit of one ETH
14:13until we can prove it's really how
14:15validator.
14:17So if you have to remember one thing
14:18from this talk for your next audit that
14:21on an LST that use the beacon chain
14:24you can use those three values.
14:26So ask you three question.
14:28What force the set to be complete for
14:29the first attack? Which which absence is
14:32inferred and from what rule for the
14:33second attack? And the last one, if you
14:36prove at one instant, how stale is this
14:38instant? [clears throat]
14:40So Merkle proof tells you a lot of
14:42things.
14:42It tells you what's in the tree, but it
14:44doesn't tell you what's missing, doesn't
14:47tell you what's gone and not when.
14:49This job is still our job and this job
14:51is still your job, guys. So thanks a lot
14:53for your attention. And if you have some
14:55questions, I would be happy to discuss a
14:57bit later on. Thanks a lot, guys.
Source and accuracy details
- Names, organizations, technical terms, code and numbers may be misrecognized.
- Source wording and disfluencies are preserved; no editorial corrections were applied.
- Export contains whole-second cue starts only; cue ends and subsecond timing are unavailable.
- A full caption-track export does not establish that every spoken word is represented.
- Automatic YouTube captions; not human-verified against the audio.
Source export SHA256: c7a0fe0e3863c7b0c2da6adde68a94a0fa88f3cb1513213bc792cca1f99e1675