Star on GitHubStar2.4k stars

Case study

GoonFi V2: byte-identical Rust recompilation of a Solana program

OtterSec researchers describe an agent pipeline that reconstructed Rust source for the closed-source GoonFi V2 Solana program until a rebuild with the original toolchain reproduced the deployed ELF. Per-function instruction scoring, a deterministic merge judge and bans on assembly and other score-gaming constructs steered the agents; matching function order and panic-location paths closed the last differences. The article and a companion repository document the method and a verification script, while the internal tooling and agent transcripts remain unpublished.

Targets
Binary
Category
Independent reconstruction cases
Relationship
Independent reconstruction project
Sources reviewed
Copy as MarkdownView JSONCite

Requirements & limits

  • The target is GoonFi V2 as deployed at slot 448984043; the live program was upgraded on 2026-10-06, so verification uses the earlier ELF.
  • The reconstruction uses the deployed binary, program IDL and on-chain transactions. The core agent harness, merge judge and transcripts are unpublished.
  • build.sh requires Linux x86-64 and downloads Solana platform-tools v1.48 (rustc 1.84.1-dev, LLVM 19.1.7). VERIFY.sh needs an Alchemy archive key or another archival RPC to recover the original ELF from deploy-transaction writes and compare it byte for byte.
  • The companion repository names no license for its reconstructed source; rights to the original closed-source program remain with its owner.

Cite

BibTeX

@misc{goonfi-v2-rust-recompilation-case,
  title = {{GoonFi V2: byte-identical Rust recompilation of a Solana program}},
  howpublished = {\url{https://osec.io/blog/goonfi-decompilation/}},
  url = {https://osec.io/blog/goonfi-decompilation/},
  urldate = {2026-10-18},
  note = {Awesome REA entry: \url{https://awesomerea.org/resources/goonfi-v2-rust-recompilation-case/}}
}

Plain text

GoonFi V2: byte-identical Rust recompilation of a Solana program. https://osec.io/blog/goonfi-decompilation/ (accessed 2026-10-18). Awesome REA entry: https://awesomerea.org/resources/goonfi-v2-rust-recompilation-case/

Useful? Star Awesome REA on GitHub2.4k

About this entry

The description was reviewed against primary sources.

Report an outdated entry Suggest a translation fix

Primary sources

  1. https://osec.io/blog/goonfi-decompilation/
  2. README.md GitHub · renato-osec/goonfi-v2-decompiled · Revision 381cc31
  3. build.sh GitHub · renato-osec/goonfi-v2-decompiled · Revision 381cc31
  4. VERIFY.sh GitHub · renato-osec/goonfi-v2-decompiled · Revision 381cc31
  5. verify_onchain.py GitHub · renato-osec/goonfi-v2-decompiled · Revision 381cc31
  6. Cargo.toml GitHub · renato-osec/goonfi-v2-decompiled · Revision 381cc31
  7. https://x.com/pashov/status/2111066785890054605

More in Native binaries

All 502 entries in Native binariesNative binaries case studies (64)

↑↓ move↵ open⌘↵ new tab