DSS

DSS 2026 / Day 2 / Amber Hall

Bytecode Back to Source: AI Reconstruction of Unverified Contracts

Yannis Smaragdakis

8:04 · 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:00you.

0:04Okay. So I'm Janis from D.D.O.B.

0:08Uh I'm co-founder of D.D.O.B. Maybe

0:11let's get a quick show of hands. Who has

0:13ever used our decompiler? Who has ever

0:15used D.D.O.B.?

0:17Okay. So a bunch of people have. So this

0:20is what we've been known for. So since

0:232019 we've had a decompiler that's been

0:25running over the entire Ethereum mainnet

0:28and many other blockchains.

0:30Uh so our decompiler is code code named

0:33Gigahorse. It's now in version three.

0:35It's been documented in multiple

0:37publications. Right now we have over

0:3915,000 registered users.

0:41Some of those are duplicates. We know

0:43that some of you like to abuse our

0:45service and

0:47uh get lots for free. Uh

0:50we don't like that, but okay. But still

0:53it's it's a very sizable community

0:55that's using our decompiler. And if you

0:57are a user or if you're not uh

1:00if you go on app.ddob.com

1:03right now one of the stages of the

1:05compilation that you will see is AI

1:07reconstruction. So I'm going to talk a

1:08bit about AI reconstruction. Our AI

1:10reconstruction on the site is just a

1:13poor man's just one shot thing.

1:16Obviously you can also get the output of

1:18our decompiler and feed it to your

1:19favorite LLM, but we try to give you

1:22very presentable code if you want to

1:24just use our site. Uh and if you want to

1:26integrate uh much much of our decompiler

1:29is open source. The the heart of it is

1:31open source uh and it's a Gigahorse

1:34toolchain. So you can find it on GitHub

1:37uh down there and you can get all of

1:39that if you just search on D.D.O.B.

1:41Okay. So basically

1:43the big question here, and this is a

1:45very short talk, is can modern LLMs

1:48decompile from bytecode? And you

1:50probably have an idea about that

1:52already. And the answer is well to a

1:55first approximation yes.

1:57They are modern LLMs are obviously

2:00incredibly impressive. They've

2:02superseded us in so many ways. So, of

2:04course, they can decompile from

2:06bytecode. But how do they decompile from

2:08bytecode? So I took that terminology

2:10from a paper that I'm going to cite in

2:12one slide, end-to-end models, no

2:14algorithmic component. You just

2:17bytecode in, decompiled out. So that

2:20would be end-to-end. You just give it

2:21the bytecode.

2:23The refinement model in contrast, which

2:25is what we do and what I will argue is

2:29uh advantageous in many ways, you start

2:32from an algorithmic decompiler. You get

2:34some hacky intermediate language out.

2:37Maybe it looks like Solidity, maybe it's

2:39even lower level. Actually, looking like

2:40Solidity is turns out to be an

2:42advantage. And then you have an LLM

2:44produce the final code. So end-to-end

2:47versus refinement model. Uh now I have

2:50to warn overall, every time you see a

2:54study or every time you see an anecdote,

2:56like someone goes on Twitter and says,

2:58hey, we decompiled that contract using

3:00just an LLM and nobody could decompile

3:02it before or anything like that. So

3:04LLMs are great because of experience,

3:07not because necessarily of smarts. So if

3:10your contract is not too rare, if it's

3:13very similar to past contracts, or if

3:15it's something that has source code

3:17online already, the LLM will do

3:18fantastically well. Every time we've

3:21tried it with completely original

3:23bytecode,

3:25it has not done that tremendously well.

3:27There are clear shortcomings and it's

3:30very easy to get fooled. We've had to

3:32work very hard to get representative

3:34studies. So don't trust people who don't

3:37give you full details on the workload.

3:39And one of the things that you need to

3:40have is prevent network access. The LLM

3:43should not be able to look up the

3:45contract online. And if you have some

3:49way, which is very, very hard typically,

3:51to make sure that the LLM has not seen

3:53the contract before, like if you create

3:55new contracts, then that's the most

3:57representative. But that's an extremely

3:59hard study to run.

4:01Uh also on the side on the

4:04uh caveat side, I will cite this paper

4:07that I mentioned before, uh which is uh

4:10by Syracuse University, When LLM

4:12Decompilers Recompile More and Preserve

4:13Less. It was just recently uploaded a

4:15couple of months ago to Archive. Uh this

4:18is for x86, this is for binary

4:20decompilers, but one very the the main

4:22finding there is that

4:24you have an LLM produce decompiled code.

4:28It's great, it satisfies all the test

4:30cases. If you have other test cases that

4:32it has not seen, most likely the

4:34decompiled code will do differently than

4:36the original code. So the LLM will give

4:38you

4:39fixed code, so to speak, but not

4:41necessarily faithful code compared to

4:44the original thing you're decompiling.

4:45So that's another caveat. So let's get

4:47to more original results on our study.

4:50So on our study, uh refinement model

4:54versus end-to-end model, like if you

4:56give it the output of our algorithmic

4:58decompiler and use versus starting

5:01directly from bytecode and all the

5:03setting of the experiment is up there.

5:05So these are very popular contracts. So

5:08the LLM has likely seen many of those

5:11because they are the thousand contracts

5:12that don't use a Yul pipeline and have

5:14the most transactions in the past couple

5:17of years. So popular contracts. So we

5:20expect inflated numbers, but still the

5:22refinement model is clearly better than

5:26the end-to-end model. So we get uh

5:29recompilation rate uh of over 92% versus

5:3388%.

5:34We have lower cost, obviously in tokens.

5:37And then if you actually look at the

5:39output, the output that has uh how many

5:42of the decompiled contracts contain

5:43assembly, it's a much higher percentage

5:46for the end-to-end model. And the

5:49assembly uh share of the code again is

5:51much higher in the end-to-end model. So

5:54the argument here is that if you try to

5:56be very systematic, there's clear value

5:59in having a refinement model, in having

6:01an algorithmic decompiler as a first

6:03stage and then running a good LLM over

6:06it.

6:06Clearly,

6:08any of those numbers are

6:11very are subject to change. If you have

6:14a million rounds on the LLM and you keep

6:17refining and you give it the right

6:19objectives, it will end up being near

6:22perfect.

6:23But it's going to be very very hard for

6:26it to get near perfect. It's much easier

6:28for it to fool you and run a bad

6:30experiment is my point. If you try to

6:32run a fair experiment, it's always

6:35better to give it high-level code to

6:36begin with.

6:38Okay, so that's uh that's the that's the

6:40brief talk and I think we have time for

6:44brief questions.

6:49One one question.

6:53I think that's you. Yes.

7:06>> Yes.

7:09>> No, this is not identical bytecode

7:11matching because if it's identical

7:13bytecode, then it will pass by

7:14definition all the test cases. So this

7:16is not something that's doing

7:19transaction replay or anything. I mean,

7:20we have statistics on transaction

7:22replay, but the very first test is

7:24re-compilability. And even if you fail

7:27if you even fail re-compilability, then

7:29there's no point in

7:31in trust in trying transaction replay.

7:33But you're asking is it identical

7:34bytecode? No. I mean, it wouldn't be

7:36that high. Like Garrett's numbers from

7:38before, it would be like for

7:40re-compilable, you can I am sorry, for

7:42identical bytecode, you can let the LLM

7:45run for a month. Maybe you'll get to 70%

7:47at this point. Maybe in the future it

7:49will be much better. Maybe you spend

7:50billions more in tokens. You can get to

7:53be much better, but it's going to have a

7:55much lower

7:57upper threshold.

8:01Thank you.

Source and accuracy details

Source export SHA256: b8a148a7748c74c02447e96da7d35c05d1ad29cd6fb2a58bd812ac1bc89f4ba8