Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

audit: swap-fee math silently contributes 0 ppk for proofs on keysets unknown to the wallet's view (PoC reproduced; fix in gonuts-tollgate)

Open
#832 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
payments, security

Research direction

The bug is in feesForProofs in wallet/wallet.go of the gonuts-tollgate fork (around lines 1934-1944), which adds 0 ppk for proofs whose keyset id is neither active nor in inactiveKeysets. The below-fee refusal in merchant.go (around line 1539) depends on that figure. Start by reproducing with proofs carrying unknown keyset ids, then choose refuse or worst-case counting. Done means an unknown keyset never yields a silent zero fee. The fork is not on this tracker and the design choice is open, so confirm the approach with maintainers first.

Written by the indexing model from the issue text.

Description

From the 2026-10-09 Cashu audit. PoC reproduced against fork d7591d2. Fork-first fix, tracked here (issues disabled on the fork).

Finding

Fork wallet/wallet.go feesForProofs (≈:1934-1944): a proof whose keyset id is neither the active keyset nor in inactiveKeysets adds 0 ppk silently — no error, no refusal.

cashu.Proofs{{Id:"00rotated-away",…},{Id:"00never-seen",…}} → feesForProofs = 0, nil

Path

When the mint's keyset listing prunes/hides the keyset a token's proofs carry (hostile mint, aggressive rotation), the wallet underestimates the fee → the below-fee refusal (merchant.go:1539) never fires → the swap consumes the whole note. Same family as #752's fee edges.

Minimal fix

Unknown keyset in the fee path = refuse (or count worst-case), never silently zero. CWE-682. Severity MEDIUM-LOW (precondition: mint stops listing a still-swappable keyset).

Cross-refs: #703, #752.

Dominant language
Go
Stars
12
Forks
14
Avg merge
1d 5h
Merged PRs (30d)
239

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenTollGate/tollgate-module-basic-go

All issues in OpenTollGate/tollgate-module-basic-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.