Skip to content

[BE-01] Fix buildDataKey() returning bare 'doc_' prefix — breaks all Stellar anchoring #726

Description

@mftee

Overview

buildDataKey() in StellarService constructs the Stellar manageData key by sanitizing and slicing the hash, but the return statement is incomplete — it returns the literal string "doc_" without appending the sanitized hash. This means every document gets anchored under the same Stellar data key, causing all but the first anchor to silently overwrite previous records on the ledger.

Background

File: backend/src/stellar/stellar.service.ts

The method should return "doc_" + sanitized.slice(0, 58) but currently only returns the prefix. Both anchorHash() and verifyHash() call buildDataKey(), so the entire Stellar integration is broken until this is fixed.

Acceptance Criteria

  • Return statement in buildDataKey() correctly concatenates "doc_" with the first 58 characters of the sanitized hash
  • Two documents with different hashes produce two different Stellar data keys
  • Existing anchorHash() and verifyHash() calls work correctly end-to-end with the fix applied

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions