Can a canister have multiple principals?

As the title says. Can a canister send messages to other canisters forging a different principal each request? Can a canister send messages anonymously?

It seems like for self authenticated principals it is possible.

Internet Identity introduces a mechanism when a user could use a session key, but present for other canisters as some another principal, not connected mathematically to the session key.

I remember, @kpeacock once said that in order for it to work the team had to tweak a replica a little bit.
Can one elaborate on this a bit more? I see that this info exists, but it’s hidden from public behind this link.

1 Like

No. At least not at the moment.

A canister can use “canister signatures” to “sign” stuff with one of many principals derived from the canister id; this is the mechanism behind the Internet Identity. But it doesn’t work for inter-canister calls (which are not signed), only for ingress calls. Although it arguably would be a natural thing to allow.

The link you can’t access is the internal (and easier to read and navigate) rendering of the Interface Specification, but the content is also at The Internet Computer Interface Specification :: Internet Computer

1 Like