Principal are generic identifiers for canisters and users.
raw, _ := hex.DecodeString("abcd01")
p := principal.Principal(raw)
fmt.Println(p.Encode())
// Output:
// em77e-bvlzu-aq
These are always generated by the system and have no structure of interest outside the system. Typically, these end with the byte 0x01
.
An external user can use these ids as the sender of a request if they own the corresponding private key.
sha224(public_key) 0x02
Derived IDs are currently not explicitly used, but they may be used internally or in the future.
sha224(len(registering_principal) registering_principal derivation_nonce) 0x03
Used for the anonymous caller. It can be used in call and query requests without a signature.