DSS 2026 — Bytecode Back to Source: AI Reconstruction of Unverified Contracts Yannis Smaragdakis Source video: https://www.youtube.com/watch?v=Unf3kUNHTrI Automatic captions — not human-reviewed. Complete spoken-audio coverage is unverified. Source language tag: en (English). Source export SHA256: b8a148a7748c74c02447e96da7d35c05d1ad29cd6fb2a58bd812ac1bc89f4ba8 [0:00] you. [0:04] Okay. So I'm Janis from D.D.O.B. [0:08] Uh I'm co-founder of D.D.O.B. Maybe [0:11] let's get a quick show of hands. Who has [0:13] ever used our decompiler? Who has ever [0:15] used D.D.O.B.? [0:17] Okay. So a bunch of people have. So this [0:20] is what we've been known for. So since [0:23] 2019 we've had a decompiler that's been [0:25] running over the entire Ethereum mainnet [0:28] and many other blockchains. [0:30] Uh so our decompiler is code code named [0:33] Gigahorse. It's now in version three. [0:35] It's been documented in multiple [0:37] publications. Right now we have over [0:39] 15,000 registered users. [0:41] Some of those are duplicates. We know [0:43] that some of you like to abuse our [0:45] service and [0:47] uh get lots for free. Uh [0:50] we don't like that, but okay. But still [0:53] it's it's a very sizable community [0:55] that's using our decompiler. And if you [0:57] are a user or if you're not uh [1:00] if you go on app.ddob.com [1:03] right now one of the stages of the [1:05] compilation that you will see is AI [1:07] reconstruction. So I'm going to talk a [1:08] bit about AI reconstruction. Our AI [1:10] reconstruction on the site is just a [1:13] poor man's just one shot thing. [1:16] Obviously you can also get the output of [1:18] our decompiler and feed it to your [1:19] favorite LLM, but we try to give you [1:22] very presentable code if you want to [1:24] just use our site. Uh and if you want to [1:26] integrate uh much much of our decompiler [1:29] is open source. The the heart of it is [1:31] open source uh and it's a Gigahorse [1:34] toolchain. So you can find it on GitHub [1:37] uh down there and you can get all of [1:39] that if you just search on D.D.O.B. [1:41] Okay. So basically [1:43] the big question here, and this is a [1:45] very short talk, is can modern LLMs [1:48] decompile from bytecode? And you [1:50] probably have an idea about that [1:52] already. And the answer is well to a [1:55] first approximation yes. [1:57] They are modern LLMs are obviously [2:00] incredibly impressive. They've [2:02] superseded us in so many ways. So, of [2:04] course, they can decompile from [2:06] bytecode. But how do they decompile from [2:08] bytecode? So I took that terminology [2:10] from a paper that I'm going to cite in [2:12] one slide, end-to-end models, no [2:14] algorithmic component. You just [2:17] bytecode in, decompiled out. So that [2:20] would be end-to-end. You just give it [2:21] the bytecode. [2:23] The refinement model in contrast, which [2:25] is what we do and what I will argue is [2:29] uh advantageous in many ways, you start [2:32] from an algorithmic decompiler. You get [2:34] some hacky intermediate language out. [2:37] Maybe it looks like Solidity, maybe it's [2:39] even lower level. Actually, looking like [2:40] Solidity is turns out to be an [2:42] advantage. And then you have an LLM [2:44] produce the final code. So end-to-end [2:47] versus refinement model. Uh now I have [2:50] to warn overall, every time you see a [2:54] study or every time you see an anecdote, [2:56] like someone goes on Twitter and says, [2:58] hey, we decompiled that contract using [3:00] just an LLM and nobody could decompile [3:02] it before or anything like that. So [3:04] LLMs are great because of experience, [3:07] not because necessarily of smarts. So if [3:10] your contract is not too rare, if it's [3:13] very similar to past contracts, or if [3:15] it's something that has source code [3:17] online already, the LLM will do [3:18] fantastically well. Every time we've [3:21] tried it with completely original [3:23] bytecode, [3:25] it has not done that tremendously well. [3:27] There are clear shortcomings and it's [3:30] very easy to get fooled. We've had to [3:32] work very hard to get representative [3:34] studies. So don't trust people who don't [3:37] give you full details on the workload. [3:39] And one of the things that you need to [3:40] have is prevent network access. The LLM [3:43] should not be able to look up the [3:45] contract online. And if you have some [3:49] way, which is very, very hard typically, [3:51] to make sure that the LLM has not seen [3:53] the contract before, like if you create [3:55] new contracts, then that's the most [3:57] representative. But that's an extremely [3:59] hard study to run. [4:01] Uh also on the side on the [4:04] uh caveat side, I will cite this paper [4:07] that I mentioned before, uh which is uh [4:10] by Syracuse University, When LLM [4:12] Decompilers Recompile More and Preserve [4:13] Less. It was just recently uploaded a [4:15] couple of months ago to Archive. Uh this [4:18] is for x86, this is for binary [4:20] decompilers, but one very the the main [4:22] finding there is that [4:24] you have an LLM produce decompiled code. [4:28] It's great, it satisfies all the test [4:30] cases. If you have other test cases that [4:32] it has not seen, most likely the [4:34] decompiled code will do differently than [4:36] the original code. So the LLM will give [4:38] you [4:39] fixed code, so to speak, but not [4:41] necessarily faithful code compared to [4:44] the original thing you're decompiling. [4:45] So that's another caveat. So let's get [4:47] to more original results on our study. [4:50] So on our study, uh refinement model [4:54] versus end-to-end model, like if you [4:56] give it the output of our algorithmic [4:58] decompiler and use versus starting [5:01] directly from bytecode and all the [5:03] setting of the experiment is up there. [5:05] So these are very popular contracts. So [5:08] the LLM has likely seen many of those [5:11] because they are the thousand contracts [5:12] that don't use a Yul pipeline and have [5:14] the most transactions in the past couple [5:17] of years. So popular contracts. So we [5:20] expect inflated numbers, but still the [5:22] refinement model is clearly better than [5:26] the end-to-end model. So we get uh [5:29] recompilation rate uh of over 92% versus [5:33] 88%. [5:34] We have lower cost, obviously in tokens. [5:37] And then if you actually look at the [5:39] output, the output that has uh how many [5:42] of the decompiled contracts contain [5:43] assembly, it's a much higher percentage [5:46] for the end-to-end model. And the [5:49] assembly uh share of the code again is [5:51] much higher in the end-to-end model. So [5:54] the argument here is that if you try to [5:56] be very systematic, there's clear value [5:59] in having a refinement model, in having [6:01] an algorithmic decompiler as a first [6:03] stage and then running a good LLM over [6:06] it. [6:06] Clearly, [6:08] any of those numbers are [6:11] very are subject to change. If you have [6:14] a million rounds on the LLM and you keep [6:17] refining and you give it the right [6:19] objectives, it will end up being near [6:22] perfect. [6:23] But it's going to be very very hard for [6:26] it to get near perfect. It's much easier [6:28] for it to fool you and run a bad [6:30] experiment is my point. If you try to [6:32] run a fair experiment, it's always [6:35] better to give it high-level code to [6:36] begin with. [6:38] Okay, so that's uh that's the that's the [6:40] brief talk and I think we have time for [6:44] brief questions. [6:49] One one question. [6:53] I think that's you. Yes. [7:06] >> Yes. [7:09] >> No, this is not identical bytecode [7:11] matching because if it's identical [7:13] bytecode, then it will pass by [7:14] definition all the test cases. So this [7:16] is not something that's doing [7:19] transaction replay or anything. I mean, [7:20] we have statistics on transaction [7:22] replay, but the very first test is [7:24] re-compilability. And even if you fail [7:27] if you even fail re-compilability, then [7:29] there's no point in [7:31] in trust in trying transaction replay. [7:33] But you're asking is it identical [7:34] bytecode? No. I mean, it wouldn't be [7:36] that high. Like Garrett's numbers from [7:38] before, it would be like for [7:40] re-compilable, you can I am sorry, for [7:42] identical bytecode, you can let the LLM [7:45] run for a month. Maybe you'll get to 70% [7:47] at this point. Maybe in the future it [7:49] will be much better. Maybe you spend [7:50] billions more in tokens. You can get to [7:53] be much better, but it's going to have a [7:55] much lower [7:57] upper threshold. [8:01] Thank you.