Skip to content

feat(example): add Discord/Telegram moderation log bot with Nirium receipts (#381) - #473

Open
harshsoul wants to merge 1 commit into
nirium-protocol:mainfrom
harshsoul:feat/example-moderation-log-381
Open

harshsoul wants to merge 1 commit into
nirium-protocol:mainfrom
harshsoul:feat/example-moderation-log-381

Conversation

@harshsoul

Copy link
Copy Markdown

Summary

Fixes #381

Adds examples/build-moderation-log/: a moderation audit log bot for Discord or Telegram communities that anchors every moderation decision on the Nirium Audit Trail (Stellar testnet).

Zero PII Privacy Guarantee

IPFS records are permanent and cannot be deleted. To guarantee compliance with data privacy standards:

  • User IDs are salted and SHA-256 hashed.
  • Moderator IDs are salted and SHA-256 hashed.
  • Message Content is salted and SHA-256 hashed.
  • Zero raw PII leaves the bot or gets anchored to IPFS. Only cryptographic hashes and action types are anchored.

Moderation Decisions Anchored

Includes 5 canonical moderation action types:

  1. warn
  2. mute
  3. message_removal
  4. kick
  5. ban

What a Receipt Proves (and What It Doesn't)

  • What it proves:
    • Immutability: The moderation decision has not been rewritten, backdated, or deleted after the fact.
    • Attribution: The moderation action was signed with the server/community's authorized Stellar key.
  • What it does NOT prove:
    • Justification: Anchoring does not prove the user actually broke server rules.
    • Clock Authority: The anchoredAt timestamp reflects the Nirium node's system clock, not a consensus ledger time.

Verification & Testnet Evidence

5 live testnet actions anchored to https://nirium-agent.fly.dev/api/audit/log:

Action Record ID Live IPFS Receipt CID
warn mod-warn-101 QmUrJezMWZw15CF8tsj4ZW7917oxi18sTCYqkrgrrMHChS
mute mod-mute-102 QmSZaccongZ7trqq1LvH7BTfVx7uRLx8atd5uD9VT2pFEd
message_removal mod-del-103 QmQci6hVcRAX8GX4hN5LCHi5RPqqramQkf3N1Gw5FMxQZa
kick mod-kick-104 QmY6fcPmTDKJc2Pt6AGyZQd1mAnvfGi49QVho1PqRrHaoc
ban mod-ban-105 QmRem2Trtiy1uwqKzc6ahR6cxRLL3WLt5GFE1Y6KLnidNq

Verification command:

npx nirium-cli verify QmUrJezMWZw15CF8tsj4ZW7917oxi18sTCYqkrgrrMHChS

/check <id> Command & Tamper Resistance

  • Verifying stored action:
    npm run check -- mod-ban-105
    # [OK] Moderation action mod-ban-105 verified against receipt QmRem2Tr...
  • If a rogue moderator or database admin edits a stored record reason:
    npm run check -- mod-ban-105
    # [TAMPER DETECTED] Computed hash does not match anchored receipt!

Offline Test Suite

5 unit tests pass completely offline (mocked network):

npm test
# 5 passing (168ms)

Demo Video & Permissions

  • Screen recording demonstrating the bot logging actions, /check verification, and tamper detection.
  • Permission: Nirium may share the demo recording and screenshots on Nirium's community channels with credit to @harshsoul.

@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@harshsoul Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build with Nirium: a moderation log bot for Discord or Telegram, every decision with a receipt (Audit Trail, testnet)

1 participant