Skip to content

feat(examples): monthly contractor payroll dry-run and replay guard - #498

Open
krsnak wants to merge 6 commits into
nirium-protocol:mainfrom
krsnak:bounty/456
Open

krsnak wants to merge 6 commits into
nirium-protocol:mainfrom
krsnak:bounty/456

Conversation

@krsnak

@krsnak krsnak commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Implements examples/payouts-payroll-dry-run/ for Nirium Payouts monthly independent-contractor payroll on Stellar testnet: validated CSV, signing-free dry run, locally payer-signed XDR with strict recipient/amount/fee checks, and fail-closed month-level duplicate protection.

Validation

  • npm run typecheck — PASS.
  • npm test — 6/6 offline tests PASS, including tampered XDR, excessive fees, duplicate month, and ambiguous submission.
  • Own-key dry run — PASS, 2 recipients / 2.5000000 XLM, SHA256 digest ceacea123986595db08c9251db270716c4c4c5810724b0e67938b5aecb163580.
  • REAL NIRIUM TESTNET PAYOUT COMPLETED, using the contributor's own funded payer account and locally signed transaction. Run ID: payroll-2026-11-ceacea123986.
  • On-chain verified: Stellar Expert testnet transaction cc5bd7be4707…edfb. Stellar Horizon independently confirmed successful transaction and exactly two native XLM payments, 1.0000000 XLM to C-001 and 1.5000000 XLM to C-002, totaling 2.5000000 XLM. Source account matches the contributor's payer. Submitted 2026-11-23 18:33:57 UTC.
  • Receipt CID: QmTnncskA1Pe6o3yVLfE3Boi8hu2oRWGNZnE3XUdwX1VhU.
  • Dry-run and real-run line items and SHA256 plan digest match exactly. Both outputs and Stellar Expert links are in the example README.
  • Duplicate prevention verified against the real completed local ledger: same-month re-execution rejected without any Payouts API/client calls (PAYOUT_CLIENT_CALLS 0). The ledger remained completed; no second payment was broadcast.
  • Testnet keys, signed transaction ledger, and API key remain outside tracked source; no secret values committed.

Remaining evidence / maintainer review

Video sharing permission: Not granted for Nirium's external channels at this time. Maintainers may use the attached recording solely to review this contribution; ask the contributor before reposting it with credit.

The earlier one-hour JWT auth blocker was resolved by generating a legitimate Nirium API key and verifying an authenticated request.

AI-assisted contribution disclosed in commit trailer: Co-Authored-By: GPT-6 <noreply@openai.com>.

Closes #456

Co-Authored-By: GPT-6 <noreply@openai.com>
@drips-wave

drips-wave Bot commented Nov 23, 2026

Copy link
Copy Markdown

@krsnak 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

@krsnak

krsnak commented Nov 23, 2026

Copy link
Copy Markdown
Author

Demo recording (36 seconds): signing-free dry run followed by the real Nirium Payouts testnet batch (2.5 XLM to two recipients), with the successful run ID and Stellar Expert transaction hash visible. Independently verified transaction: https://stellar.expert/explorer/testnet/tx/cc5bd7be470702994fe271da30577edd40d3426afa8fbaed343c7e858be8edfb

Zaznam.obrazovky.2026-11-23.v.19.33.46.mov

Video sharing permission: review use only; external redistribution on Nirium channels is not authorized.

@krsnak
krsnak marked this pull request as ready for review November 23, 2026 18:43

@Eras256 Eras256 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted review (Claude)

The payout cc5bd7be is successful on Horizon testnet: two XLM payments (1 and 1.5) from your own account GCUV5CMM, matching the dry run. The duplicate-month guard, the offline tests and the video are there, and CI is green. Two small things:

  1. The title still says [WIP]. If it's ready, please remove it.
  2. nirium-cli verify QmTnncsk... returns verified: false because that receipt has no signature (hash-only, signature absent). Please don't present it as a verified receipt in the README. Either say it's an unsigned record or drop the line, since the issue doesn't require a receipt.

@krsnak krsnak changed the title feat(examples): monthly contractor payroll dry-run and replay guard [WIP] feat(examples): monthly contractor payroll dry-run and replay guard Nov 27, 2026
@krsnak

krsnak commented Nov 27, 2026

Copy link
Copy Markdown
Author

Thanks for the review, @Eras256. Both requested updates are addressed: the [WIP] suffix has been removed, and commit f2e98dd clarifies in the example README that the receipt CID is an unsigned hash-only record (verified: false due to the absent signature), distinct from the independently verified Stellar testnet transaction. The offline tests (6/6), TypeScript typecheck and git diff --check pass. No payout was repeated. The PR is ready for final review; please approve when satisfied.

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 monthly contractor payroll with Payouts and a dry run, on testnet

2 participants