Skip to content

Harden refunds, top-up settlement and chain checks - #11

Merged
opeblow merged 3 commits into
mainfrom
harden/verified-refunds-paged-scans
Nov 11, 2026
Merged

opeblow merged 3 commits into
mainfrom
harden/verified-refunds-paged-scans

Conversation

@opeblow

@opeblow opeblow commented Nov 11, 2026

Copy link
Copy Markdown
Owner

What this changes

  • Refunds are closed only with a refund transaction verified on-chain (bond wallet, BONDOUT memo, paying wallet, full amount); one refund closes one order.
  • Top-ups settle only on the agent's own full payment, so nobody can mark one paid with a few NIM and the memo.
  • Payment detection, the bond book and the proof count page through the whole history instead of the last 50/500 transactions.
  • Stricter confirmation checks, orders lock only a rate under 10 minutes old, agents shown offline after 12 idle hours, offline toggle fixed, rate-limit IP from trusted headers, wallet lookups no longer return bank details.

How I tested it

  • npm run lint && npm run typecheck && npm run build
  • npm run test:e2e against the mock node (107 checks passed)
  • Confirmed the public mainnet node returns executionResult, confirmations, blockNumber and supports startAt paging
  • Tried it inside Nimiq Pay

🤖 Generated with Claude Code

contributor and others added 3 commits November 11, 2026 11:05
…olvent

- Closing a report as "refunded" now needs the refund's transaction hash.
  NimPoint checks it on-chain: paid from the bond wallet, with the agent's
  BONDOUT memo, to the wallet that really paid, covering the NIM sent.
  One refund can close one order only.
- Payment detection pages back through the recipient's history to the
  order's creation, instead of only the last 50 transactions. The bond
  book and the public chain count page the same way (no 500 cap).
- All agents share one bond wallet: if their deposits exceed what it
  really holds, every bond is scaled down by the same factor.
- Mock node supports startAt paging; e2e covers refund checks, the bond
  drop after a refund, and a payment behind 120 newer transactions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LgM2HJTJrXqRMuo7gBcNHw
A top-up was marked arrived by any payment to the customer with the
order memo, of any size. Now only the agent's wallet (or its Nimiq Pay
HTLC) sending at least the quoted NIM settles it. Later payments count
as overpayments only when they come from the same sender. Two new e2e
checks: a stranger's payment and a short agent payment are both ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LgM2HJTJrXqRMuo7gBcNHw
… screen

- A transaction counts only when the node reports executionResult true
  and a block; missing fields mean no. The memo is read from recipient
  data only.
- The last good rate is still shown for up to 6h, but an order only
  locks a rate under 10 minutes old.
- Agents are shown offline after AGENT_IDLE_HOURS (default 12) without
  the console open. Fixes the offline toggle in production: Upstash
  returns '0' as the number 0, so the flag was never seen as off.
- Rate-limit IP comes from Vercel's own headers (or the last proxy hop).
- Wallet lookups no longer return any bank details.
- The order page shows the on-chain refund, with a link.
- The passcode screen says what NimPoint is and that the passcode is
  only a screen lock. README updated: passcode, CBN rules of
  5 Nov 2026, agent presence, rate freshness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LgM2HJTJrXqRMuo7gBcNHw
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nimpoint Ready Ready Preview Nov 11, 2026 7:10pm UTC

@opeblow
opeblow merged commit ebe5618 into main Nov 11, 2026
6 checks passed
@opeblow
opeblow deleted the harden/verified-refunds-paged-scans branch November 15, 2026 16:29
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.

3 participants