Skip to content

Build the NestJS Stellar Service to Anchor and Verify Document Hashes on the Stellar Network #222

@mftee

Description

@mftee

Description:
Wrap the stellar-sdk dependency into a standalone NestJS service that can anchor a document hash to the Stellar testnet/mainnet and return the transaction reference.

Tasks:

  • Create src/stellar/stellar.module.ts and stellar.service.ts
  • Implement anchorHash(hash: string): Promise<{ txHash: string, ledger: number }> using stellar-sdk: build and submit a manageData operation with the document hash as memo or data entry
  • Read STELLAR_SECRET_KEY, STELLAR_HORIZON_URL, STELLAR_NETWORK from ConfigService
  • Implement verifyHash(hash: string): Promise<boolean> — query Horizon to check if a hash has been anchored
  • Export StellarService for use in other modules

Acceptance Criteria:

  • anchorHash submits a transaction to Stellar testnet and returns a valid tx hash
  • verifyHash returns true if the hash exists on-chain, false otherwise
  • Network errors are caught and thrown as typed NestJS exceptions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions