Skip to content

[SC-08] Anchor asset history on-chain — verification endpoint and verified badges #1120

Description

@yusuftomilola

Overview

The audit module (contracts/assetsup/src/audit.rs) keeps an immutable on-chain event trail — the strongest trust story AssetsUp has over competitors ("your audit log cannot be silently edited"). Nothing surfaces it.

What to Build

  1. Backend ([SC-01] extension): mirror key web2 history events (created, transferred, status changed — align with [SC-02]'s scope) to the on-chain audit log via the queue; store the resulting tx hash on the corresponding AssetHistoryEvent row ([BE-08] entity gains a nullable chainTxHash)
  2. Verification endpoint: GET /api/assets/:id/history/verify — for each mirrored event, re-read the on-chain record and report verified | mismatch | not-anchored
  3. Frontend: the asset history timeline shows a "verified on-chain" badge per anchored event, with a tooltip (tx hash, ledger, link to Stellar Expert); an asset-level summary chip ("12/14 events anchored"); a "verify now" action that calls the verification endpoint and renders results
  4. Degrades invisibly when Stellar is not configured — no badges, no errors

References

  • Contract: contracts/assetsup/src/audit.rs
  • Blocked by [SC-01], [SC-02], [BE-08]

Acceptance Criteria

  • Mirrored events carry a tx hash and render the badge with a working explorer link
  • Verification endpoint detects a genuine match (and a simulated mismatch in tests/demo)
  • Chain unavailability never breaks the history tab
  • Events created while Stellar was down are anchorable retroactively (re-anchor job or endpoint)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions