What is the difference between canisterId and id?

When I deploy a backend canister locally, I am returned a candid UI interface similar to this:

http://127.0.0.1:4943/?canisterId=[canisterId]&id=[id]

In my canister_ids.json, I can see that:

{
  "__Candid_UI": {
    "local": [canisterId]
  },
  "backend": {
    "local": [id]
  }
}

This leads me to have two questions:

  1. Why is id (which is the canister id) named id in the link?
  2. I reviewed this document: Using Candid | Internet Computer and found Candid UI id is the Candid identifier. Why does Candid UI have an identifier that is different from the canister id?

canisterId is what icx-proxy (the thing that translates from browser requests to IC calls) uses to figure out which canister to forward the request to.

Candid UI is a GUI to make calls to canisters so you can test your backend without having to use dfx or a real frontend. id is a feature of Candid UI that tells it which canister you want to make calls to. If you load Candid UI without the id parameter, then you get to choose the target canister yourself.

2 Likes