1

Suppose you don't have the source of a contract, but have its bytecode. Can you theoretically interact with it somehow, or see what it does, by only looking at its bytecode?

Can functionality be obscured, or can you deduce everything that a contract does by its bytecode alone?

Fernando Tiberti
  • 2,299
  • 1
  • 15
  • 28

2 Answers2

3

Decompiling bytecode is much the same as revere engineering any other form of binary program. It can be a bit tricky, but given the right incentive someone could definitely learn enough from the bytecode to interact with the contract.

Obfuscation is not very practical right now, so for the present, just assume that if you publish something to the blockchain, it will be public.

It is not necessary to have the ABI for the contract, since it is trivial to figure out the function signature hashes from the bytecode, which is all you need

Tjaden Hess
  • 37,046
  • 10
  • 91
  • 118
  • As reverting to source code is impossible ( see http://ethereum.stackexchange.com/a/238/405 ) could you provide an example of extraction of necessary information to interact with contracts from opcode ? – Nicolas Massart Jan 24 '17 at 09:24
  • Sure, names are removed but it's a pretty common practice to attempt to reverse-engineer compiled code. I never said it was straightforward, though. It will require significant testing and experience with the solidity compiler – Tjaden Hess Jan 24 '17 at 22:34
0

I might be wrong, but ihmo, I don't think it is possible to interact with it, since the bytecode is the result of the compiler, compiling your ABI code and making your code understable by the EVM which runs low level low-level assembly.

If you want have the sources that build up this response:

FrenchieiSverige
  • 1,498
  • 1
  • 12
  • 23