Context
Review of #291 raised the idea: represent Canton fingerprints with a dedicated type instead of bare Strings, and validate the shape at construction.
A Canton fingerprint has a fixed shape: the multihash prefix 1220 followed by 64 hex characters. A newtype can check that shape once and carry the guarantee everywhere.
Why not in #291
Fingerprints appear across the codebase: signed_by on signatures, topology calls, utils::compute_fingerprint, identity storage. A newtype that lives only in the signing module would create two representations of one concept. The full adoption is its own change, next to the existing CantonId type.
Scope
- Add
Fingerprint (validated newtype) next to CantonId.
- Return it from
utils::compute_fingerprint.
- Adopt it at the main call sites: signing, topology proposals, identity storage.
Raised by @ksrichard in #291 (comment).
Context
Review of #291 raised the idea: represent Canton fingerprints with a dedicated type instead of bare
Strings, and validate the shape at construction.A Canton fingerprint has a fixed shape: the multihash prefix
1220followed by 64 hex characters. A newtype can check that shape once and carry the guarantee everywhere.Why not in #291
Fingerprints appear across the codebase:
signed_byon signatures, topology calls,utils::compute_fingerprint, identity storage. A newtype that lives only in thesigningmodule would create two representations of one concept. The full adoption is its own change, next to the existingCantonIdtype.Scope
Fingerprint(validated newtype) next toCantonId.utils::compute_fingerprint.Raised by @ksrichard in #291 (comment).