4

My question seems simple to answer, but I could not find an answer to this yet.

I assume that I have to compile the contract to byte code and deploy the byte code to the blockchain directly?

Before the Crypto Kitties hype I did not even know that deploying anything 'soopersecret' would be even possible.

5

The bytecode that lives on the blockchain is readable by anyone, but you don't have to reveal the Solidity (or whatever programming language you used) source code. This means you could obfuscate your code to try to prevent people from understanding it.

That said, this is somewhat contrary to the purpose of using smart contracts, and in practice, smart contracts are usually so simple that it's not hard to de-obfuscate them.

CryptoKitties has off-chain code that's closed source, but the on-chain contracts' bytecode can be read by anyone.

1

Technically, only the bytecode lives in the blockchain, if you don't upload the actual code to a service like etherscan, the code source remains secret. You could also use non-standard optimization options to difficult some kind of disassembly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.