Skip to content

Evaluate near-cryptohash-rs extraction #17

Description

@r-near

Context

CryptoHash is duplicated across the ecosystem:

  • nearcore/core/primitives-core/src/hash.rs (canonical, with ProtocolSchema derive)
  • near-workspaces-rs/workspaces/src/types/mod.rs (copy with sha2 dep)
  • near-api-rs/types/src/lib.rs (another copy)
  • near-cli-rs (wrapper around near-primitives)

Action

  • Evaluate whether a standalone near-cryptohash-rs crate is worth the coordination cost
  • Prototype a minimal crate (sha256-based hash only, no ProtocolSchema)
  • Determine if nearcore could wrap/extend it vs. the other way around
  • Assess downstream migration effort

Considerations

  • nearcore's version has ProtocolSchema derive (protocol-level concerns)
  • Other consumers just need the basic hash functionality
  • Coordination cost vs. deduplication benefit

Reference

Priority: Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions