<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coinos-server.git/test/spend-budget.test.ts, branch master</title>
<subtitle>coinos server — legacy coinos.io backend (Lightning, on-chain, Liquid)</subtitle>
<id>https://git.coinos.io/coinos-server.git/atom?h=master</id>
<link rel='self' href='https://git.coinos.io/coinos-server.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/'/>
<updated>2026-08-22T15:08:04Z</updated>
<entry>
<title>nwc: enforce per-connection spend budgets + flag-gated incident containment</title>
<updated>2026-08-22T15:08:04Z</updated>
<author>
<name>Adam Soltys</name>
<email>adam@coinos.io</email>
</author>
<published>2026-08-22T15:08:04Z</published>
<link rel='alternate' type='text/html' href='https://git.coinos.io/coinos-server.git/commit/?id=0bb7ab45344068ed8ea3cc77ad9f7c2a038bb45f'/>
<id>urn:sha1:0bb7ab45344068ed8ea3cc77ad9f7c2a038bb45f</id>
<content type='text'>
Thread the remaining allowance through every spend path (pay_invoice, pay,
pay_keysend, internal transfer) as maxTotal, and have debit() assert the spend
stays within it after it reloads the invoice and captures the tip — so a
delegated NWC credential can no longer exceed its configured budget, and a
mutated tip can't slip a small-budget check and drain via the internal path.
checkBudget now returns the remaining allowance alongside any error; a blank
budget is treated as deliberately unlimited and a positive budget requires a
known renewal period.

Add operator-controlled containment for a suspected credential disclosure, all
gated behind Redis flags with no hardcoded scope:
  nwc:disabled              fail every method closed
  nwc:credential-cutoff     retire connections created before an epoch
  nwc:quarantined           block an individual disclosed connection
  nwc:guard:dormant-keysend  quarantine the first keysend on a long-idle app

Fix an ownership check that read the bare pubkey instead of app:&lt;pubkey&gt;, which
let an authenticated user overwrite another connection's config, and validate
budget/fee/renewal inputs.

Co-Authored-By: Claude Opus 4.8 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01XiwgmQKwKnRxUmVDd4xSf7
</content>
</entry>
</feed>
