Pubkeys are passed as &[u8] (compressed 33-byte form) in some modules (dm, api_token, moderation, reactions, channel membership) and as &str (hex string) in others (relay_members, archived_identities, git_repo, community ownership). This forces callers to know which form each function expects and convert at every call site. A newtype wrapping the byte form with AsRef<[u8]> and hex display would standardize the interface and catch misuse at compile time. Priority: Medium — independent effort, improves type safety across the crate.
🤖 AI review update (2026-08-23)
Correct the target representation: Nostr public keys stored by Buzz are 32-byte x-only keys, not 33-byte compressed keys. Introduce a validated 32-byte newtype with hex parsing/display and database conversion at boundaries, then migrate one domain at a time. Avoid a flag-day signature change across all consumers.
Pubkeys are passed as
&[u8](compressed 33-byte form) in some modules (dm, api_token, moderation, reactions, channel membership) and as&str(hex string) in others (relay_members, archived_identities, git_repo, community ownership). This forces callers to know which form each function expects and convert at every call site. A newtype wrapping the byte form withAsRef<[u8]>and hex display would standardize the interface and catch misuse at compile time. Priority: Medium — independent effort, improves type safety across the crate.🤖 AI review update (2026-08-23)
Correct the target representation: Nostr public keys stored by Buzz are 32-byte x-only keys, not 33-byte compressed keys. Introduce a validated 32-byte newtype with hex parsing/display and database conversion at boundaries, then migrate one domain at a time. Avoid a flag-day signature change across all consumers.