Skip to content

Catalyst Signed Documents DocLocator proper definition #585

@Mr-Leshiy

Description

@Mr-Leshiy

Summary

Modify the current draft implementation of the DocLocator type to starting actually define it as ipfs Cid v1

Description

  • Use ipld-core = { version = "0.4.1", features = ["serde"]} crate version
  • Update the DocLocator to pub struct DocLocator(ipld_core::Cid);
  • Modify the DocumentRef API, so it will start hashing the CatalystSignedDoc bytes and properly derive a DocLocaltor type

Additional notes

Note: Only CIDv1 with multihash sha2-256 is permitted for document CIDs; implementations MUST reject other multihash functions.

CIDv1 binary encoding

  • Layout (packed bytes): cidv1 = varint(1) || varint(multicodec) || multihash.
  • Multihash for this PoC MUST be sha2-256 with a 32-byte digest:
    • multihash = varint(0x12) || varint(32) || digest[32].
  • Length varies slightly (36..40 bytes) due to varint encoding of the multicodec field.
  • We do not accept other multihash functions.

References

Metadata

Metadata

Assignees

Labels

squad: gatekeepersCatalyst App Backend, System Development & Integration Team

Type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions