Skip to content

Introduce a validated Fingerprint newtype codebase-wide #300

Description

@scolear

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions