Reproduce an ICP chain-key public key offline

A watch-only service can derive a canister's public key from published key material when it reproduces the signing algorithm, network key and exact derivation path.

Preserve component boundaries

Record the canister principal, key identifier, algorithm and each path component as bytes. Use the reference derivation library with its canister-prefix facility. The decimal text 17 and a binary integer with value 17 encode different bytes. Joining adjacent components also changes the derivation.

path A = [bytes("vault"), bytes("17")]
path B = [bytes("vault17")]
A != B

Compare a known vector

Ask the canister for its public key at one example path and compare its encoded key bytes with the offline result. Only then derive more addresses. Matching the vector checks the derivation setup. It confers no access to the subnet's private signing material.

Sources