Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Investigate: swap path rejects fee-less small tokens — CU107 'Outputs are required and must be an array' (1-sat single-proof V3)

オープン
#752 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Amperstrand がすでに取り組んでいます。

2026年10月8日 から。

  • #780 @Amperstrand による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
backend, payments

調査の方向性

Start by tracing the receive path from merchant.Fund to the wallet swap and locating where swap outputs are constructed; the issue does not name files or tests. Compare fee/reserve handling with the mint’s reported input_fee_ppk and determine whether a real wallet can reproduce the failure. Done means identifying the cause and establishing whether this is a user-facing bug or a test-tooling artifact, with an appropriate response for affected payments.

索引モデルが issue の本文から書いたものです。

説明

Migrated from Amperstrand/tollgate-module-basic-go#95 as part of the fork retirement — OpenTollGate/tollgate-module-basic-go is the single source of truth; the fork issue carries the original discussion and any lab evidence. Retirement plan: see the tracking issue linked in the migration comment there.]

What happened

During PR validation on the QEMU virtual lab (ai-legion, OpenWrt 24.10.1 VM, testnut mint), a fee-less 1-sat V3 token (single proof, keyset 008e808b89acc141) was submitted through the captive portal. Client-side validation passed ("Valid Cashu token / 1 sat / You will receive 30.00 MiB"), then payment failed with:

Payment failed — #CU107
Payment processing failed: could not swap proofs: Outputs are required and must be an array

The error text is the mint's NUT-03 response — the swap request reached testnut with an empty/missing outputs array.

A fee-buffered token (11 sats minted, mirroring physical-router-test-automation/scripts/mint-token/main.go's feeBuffer = 10) succeeds through the identical path, as do 4-sat tokens (multiple proofs).

Repro (lab)

  1. Lab: OpenWrt VM 10.99.99.1, backend merchant mode (1 sat/step, 30 MiB steps), testnut.cashu.exchange.
  2. Mint 1 sat, single proof, V3 (HttpMinter.mint(1) from PRTA lib/cashu.py).
  3. Submit through the portal (or raw-body POST text/plain to :2121).
  4. Observe CU107 + mint error above; logread shows the swap failure.

Is it fees? — evidence both ways (needs a dig)

For the fee hypothesis: the failure boundary so far is amount/proof-count dependent (1 sat fails, 4/11 sats pass), which smells like a fee reserve being subtracted before outputs are constructed (outputs = amount − fee; fee ≥ amount → empty array). The Gonuts-era mint-token tool explicitly carries feeBuffer = 10 "because of fees".

Against: testnut's /v1/keysets reports input_fee_ppk: 0 for all keysets (including active 008e808b89acc141). If the mint charges nothing, a fee-based explanation requires a locally computed reserve (wallet-side heuristic, not the mint's advertised fee) — or the empty-outputs bug is something else entirely (e.g. single-proof denomination split edge in the swap-output construction).

Questions for whoever digs in

  1. Where exactly are swap outputs constructed on the receive path (merchant.Fund → wallet swap)? Gonuts vs backend code?
  2. Is there a fee/reserve computation that ignores input_fee_ppk or assumes a minimum?
  3. Can a real wallet produce a token that hits this? (If yes → user-facing bug, needs a clean error like "token amount below network fee"; if no → close as test-tooling artifact.)
  4. Should the backend pre-check amount ≤ keyset fee and return a proper CU-code instead of surfacing the mint's raw 400?

Environment

  • Backend: deployed on lab VM, gonuts-tollgate (version unconfirmed — binary undated; this repro predates any fresh-main deployment)
  • Mint: testnut.cashu.exchange (Nutshell-CF/0.0.1), input_fee_ppk: 0 on all keysets
  • Full session log and portal error snapshot available in PRTA PR #114/#115 validation notes (2026-09-18)
主要言語
Go
スター
12
フォーク
14
平均マージ
1日 6時間
マージ済み PR(30日)
217

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenTollGate/tollgate-module-basic-go のほかの issue

OpenTollGate/tollgate-module-basic-go の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。