View Issue Details

IDProjectCategoryView StatusLast Update
0012277Talerexchangepublic2026-11-22 09:37
Reporterbot-oec [agent]  
Implementeroec  
PriorityhighSeveritymajor 
Status implementing 
Target Version1.8 
Summary0012277: The transfer statement states the unrounded total, not the rounded amount wired; the merchant never matches such a transfer
Description`get-transfers-WTID.rst` documents `total` as the "Actual amount of the wire transfer, excluding the wire fee". The aggregator (`taler-exchange-aggregator.c`) wires `round_down(total − wire fee, CURRENCY_ROUND_UNIT)`. `GET /transfers/{wtid}` (`taler-exchange-httpd_get-transfers-WTID.c`) recomputes the total from the deposits and subtracts the wire fee, without rounding, and signs that. The client library checks the statement against this unrounded sum. The merchant backend matches a bank credit with the statement's total by equality (`pg_triggers.sql`, `merchant_transfers_insert_trigger`), so a rounded transfer is never confirmed, although the exchange paid what it should.

**Steps to reproduce:** deposit and wire fee EUR:0.01:

1. Deposit EUR:1.005, wired at once.
2. The bank receives EUR:0.98.
3. `GET /transfers/{wtid}`: expected a total of EUR:0.98, gets EUR:0.985.

The test `src/testing/test_exchange_api_wire_rounding.c` does this; it fails on master at step 3 (expects EUR:0.98, gets EUR:0.985). The test will be on branch `dev/oec/formalization-findings` on git.taler.net; a note here will name the commit.

**Proposed fix:** sign the rounded amount as `total`, and let the client library accept a total up to one rounding unit below the sum. This needs the rounding unit in `/keys`, which does not publish it today.

**Found by:** the formalization of the Taler protocols; the rule violated is (E2) in `spec/deposit.md`: the statement's `total` is the amount wired, the aggregate less the wire fee rounded down to the rounding unit.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

bot-oec [agent]

2026-11-21 10:47

reporter   ~0030677

Test: branch `dev/oec/formalization-findings` of exchange.git (git.taler.net), commit b93d7f3183db "testing: rounded wire transfers and their statement (0012277)", on master 7b658d8da.

test_exchange_api_wire_rounding_{cs,rsa}, deposit and wire fee EUR:0.01: a deposit of EUR:1.005 is wired at once, the bank receives EUR:0.98; the transfer statement (GET /transfers/{wtid}) must state that total, it states EUR:0.985.

Fails on master at track-transfer.

bot-oec [agent]

2026-11-21 11:41

reporter   ~0030688

Wallet test: branch `dev/oec/formalization-findings` of taler-typescript-core (git.taler.net), commit eb3190e5828a "harness: a merchant matches a rounded wire transfer (0012277)", on wallet-core master 908b0b1b5 with exchange master 7b658d8da; run it with `taler-harness run-integrationtests merchant-wire-rounding`.

test-merchant-wire-rounding, with currency_round_unit TESTKUDOS:0.1: a payment of TESTKUDOS:5 leaves TESTKUDOS:4.98 after the deposit and wire fees, and the exchange wires TESTKUDOS:4.9. After the merchant is told of that credit, it must expect TESTKUDOS:4.9 and confirm the transfer.

With exchange master 7b658d8da the exchange wires TESTKUDOS:4.9 (its wire_out table), but its transfer statement states TESTKUDOS:4.98: the merchant expects 4.98 and does not confirm the transfer.

bot-oec [agent]

2026-11-22 09:37

reporter   ~0030772

https://git-www.taler.net/exchange.git/log/?h=dev/oec/formalization-findings
https://git-www.taler.net/taler-typescript-core.git/log/?h=dev/oec/formalization-findings

Issue History

Date ModifiedUsernameFieldChange
2026-11-21 10:28bot-oecNew Issue
2026-11-21 10:28bot-oecImplementer => oec
2026-11-21 10:28bot-oecReviewer => Christian Grothoff
2026-11-21 10:28bot-oecRelease signed by => Christian Grothoff
2026-11-21 10:28bot-oecDeployed by => Christian Grothoff
2026-11-21 10:28bot-oecVerifier => oec
2026-11-21 10:28bot-oecCommunicator => CM_7
2026-11-21 10:47bot-oecNote Added: 0030677
2026-11-21 11:41bot-oecNote Added: 0030688
2026-11-21 16:16oecImplementeroec =>
2026-11-21 22:39Christian GrothoffImplementer => oec
2026-11-21 22:39Christian GrothoffPrioritynormal => high
2026-11-21 22:39Christian GrothoffSeverityminor => major
2026-11-21 22:39Christian GrothoffStatusnew => implementing
2026-11-21 22:39Christian GrothoffTarget Version => 1.8
2026-11-21 22:40Christian GrothoffView Statusprivate => public
2026-11-22 09:37bot-oecNote Added: 0030772