Skip to content

Audit forensic bridge: make export re-check the CIDs it anchored (Audit Trail, testnet) #426

Closed

Description

@Eras256

Fix examples/audit-forensic-bridge/ so its export step actually re-checks what the bridge anchored. Today pnpm export verifies nothing against the hosted agent (the README documents this as a known limit since #425):

  • src/export.ts reads the Reporting anchors export and expects a cid and hash per row. That export no longer returns CIDs (a CID belongs to whoever anchored it): each row now has only anchored_at, source and network, so there is nothing to fetch.
  • It hashes the whole IPFS document and compares that with content_sha256, which is the hash of the record inside it. Even with a CID, every anchor would be flagged as tampered.

The webhook half (POST /webhook → anchorAuditRecord() with an optional signature) already works and stays as it is. Thanks to @Santia2004 for the original example (#69).

Done when:

  • src/server.ts appends each anchored CID (with its contentSha256 and attestedBy, when present) to a local log file, for example anchors.jsonl, git-ignored.
  • pnpm export reads that log and checks every CID with the existing verifier, npx nirium-cli@latest verify <cid> --json, then prints a report: how many verified, how many failed, and why for each failure. No hand-rolled hashing of the IPFS document.
  • Running the example against the testnet node works end to end: two events posted to /webhook, both CIDs reported as verified.
  • A tsconfig.json is added so the example is picked up by the Examples Typecheck workflow, and it passes.
  • The README's "Limit" section is replaced with how export works now.

How to use Audit Trail here (client only):

  • Anchor through the published SDK (anchorAuditRecord()) against the testnet node (https://nirium-agent.fly.dev, free, no API key). Do not change any Nirium package in this PR.
  • Anchor a hash or a small non-personal record, never raw personal data: IPFS content can't be deleted.
  • Sign with your own Stellar key (STELLAR_SECRET_KEY, statement nirium-audit-v1:<sha256>), and use a tag that starts with wave11-.
  • Verify with the existing nirium-cli verify; do not build a new verifier.
  • The README must say what a receipt proves and what it doesn't: the record hasn't changed since it was anchored and who signed it, not that its content is true, and anchoredAt is the Nirium node's clock, not a ledger time.

Evidence (required):

  • Your own stellar:testnet key (never one someone gave you, never committed).
  • The two CIDs in the README, each passing nirium verify, and the pnpm export output pasted.
  • Tests run without network: mock the nirium-cli call and cover a verified record, a changed record that fails, and an invalid signature that fails.
  • A short demo video in the PR description: a screen recording of 2 minutes or less. Say whether we may share it on Nirium's channels, with credit to you.

Out of scope: changing the Reporting export or any Nirium package, building a new verifier, Soroban registries, and receipts that only repeat a transaction's payer, payee or amount.

Drafted with Claude (Opus 5.5) and reviewed by @Eras256.

Activity

  1. paulpeter32-coder commented on Nov 21, 2026

    @paulpeter32-coder

    @paulpeter32-coder has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

    Hi maintenance please can I get assigned

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @paulpeter32-coder to this issue.

  2. storm-beyndtech commented on Nov 21, 2026

    @storm-beyndtech
    Contributor

    @storm-beyndtech has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

    Happy to take the export re-check. I'll keep a local log of the CIDs the bridge anchors, have export verify each one with the published CLI, and print a short report of what passed or failed, then update the example README. I'll run it end to end on testnet and can turn this around quickly.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @storm-beyndtech to this issue.

  3. drips-wave commented on Nov 21, 2026

    @drips-wave

    Congratulations, @storm-beyndtech! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

    🧑‍💻 @storm-beyndtech: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  4. grantfox-oss commented on Nov 22, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @storm-beyndtech's PR #439 was approved and merged by @M0nsxx.

    🏆 @storm-beyndtech: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (484 total points). Track your full progress on GrantFox.

    👏 Great work, @storm-beyndtech! Keep contributing to nirium-protocol.

  5. drips-wave commented on Nov 22, 2026

    @drips-wave

    This issue has been completed by @storm-beyndtech as part of the Stellar Wave Program's 11th Wave 🥳

    😎 @storm-beyndtech: You earned 100 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions