Skip to content

Spec: Align trail-hash length in examples with canonical format #8

@chrishooooo-netizen

Description

@chrishooooo-netizen

Summary

The trail-hash component in DID identifiers has inconsistent length across the spec examples and the validation module.

Details

Validation module (merged in #7): The regex pattern enforces exactly 16 hex characters for the trail-hash:

did:trail:(self|org|agent):z[a-km-zA-HJ-NP-Z1-9]+:[a-f0-9]{16}

Spec examples (Appendix A): Some examples use shorter hashes:

  • did:trail:agent:z6Mkf5rG...:e1f2a3b48 hex chars
  • did:trail:org:z6Mkq7rT...:a1b2c3d4e5f612 hex chars

Canonical examples (§5): Use 16 hex chars, matching the validator.

Proposed Fix

  1. Update Appendix A examples to use 16 hex characters consistently (matching §5 and the validator)
  2. Alternatively, if shorter hashes should be valid, update the spec to define a minimum length and adjust the validator regex accordingly

Context

This was identified during the code review of #7. The current validator works correctly against the canonical format — this is a spec documentation consistency issue, not a bug.

Labels

spec, documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions