What actually happens when you do a dfx deploy?

I am curious about what actually happens when I do a dfx deploy.

  1. Are my canister files being uploaded to the Internet Computer chain?
  2. Can nodes see all of my code?
  3. Can people querying the chain see all of my code? If so, why should non-open sourced projects deploy on the IC?

Hi @princess_eth ,

Your code will first be compiled to Webassembly, and the resulting .wasm file is deployed to the canister.

Your source is never uploaded.

As @icpp said: only the compiled wasm is uploaded, plus if you use an asset canister then of course the website assets also will be uploaded

Nodes can for now still see the wasm that’s deployed, plus the canister state. Work is underway to make it invisible to them.

People from the outside can not see the code. Only a hash of the code is visible, which you can try out with dfx canister --network ic info <canister id>


Thank you @icpp and @Severin for the response!

Thank you for the clarification on the asset canister. I followed the tutorials without understanding how the asset canister works. I will try to deploy a frontend without calling labelling it as an asset canister.

Is there a value to deploying an asset canister?

If you want to host a website on the IC then there’s value to using an asset canister :slightly_smiling_face:

Doing it manually, however, is mostly just unnecessary tedium. Instead it’s probably better to read this, but it’s not all that important to understand

1 Like