Investigate: swap path rejects fee-less small tokens — CU107 'Outputs are required and must be an array' (1-sat single-proof V3)
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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)
- Lab: OpenWrt VM 10.99.99.1, backend merchant mode (1 sat/step, 30 MiB steps), testnut.cashu.exchange.
- Mint 1 sat, single proof, V3 (
HttpMinter.mint(1)from PRTAlib/cashu.py). - Submit through the portal (or raw-body POST
text/plainto:2121). - Observe CU107 + mint error above;
logreadshows 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
- Where exactly are swap outputs constructed on the receive path (merchant.Fund → wallet swap)? Gonuts vs backend code?
- Is there a fee/reserve computation that ignores
input_fee_ppkor assumes a minimum? - 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.)
- Should the backend pre-check
amount ≤ keyset feeand 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: 0on all keysets - Full session log and portal error snapshot available in PRTA PR #114/#115 validation notes (2026-09-18)
- Ngôn ngữ chính
- Go
- Star
- 12
- Fork
- 14
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 220
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenTollGate/tollgate-module-basic-go
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
OpenTollGate/tollgate-module-basic-go#833 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenTollGate/tollgate-module-basic-go#822 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
OpenTollGate/tollgate-module-basic-go#813 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
OpenTollGate/tollgate-module-basic-go#804 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
go-battery needs an ndsctl on PATH: TestPurchaseSessionGuardHoldsThroughTheOutcomeUnknownWindow fails on bare hosts (passes with stub)Có thể đã có người làm @Amperstrand đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenTollGate/tollgate-module-basic-go#726 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của OpenTollGate/tollgate-module-basic-go
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
siyuan-note/siyuan#20353 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
attributes-natural-language "en-US" is rejected by PAPPL >= 1.4.12 printers (RFC 8011 requires lowercase)Có thể đã có người làm @ChrisEdgington đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
OpenPrinting/ipp-usb#140 ·
-
Discriminator mapping keys are listed in a random orderCó thể đã có người làm @reuvenharrison đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Idle compaction monitors LIST the replica every tick when the newest destination file spans more than one TXIDCó thể đã có người làm @pishuv đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
benbjohnson/litestream#1563 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
triage needed
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày