View Issue Details

IDProjectCategoryView StatusLast Update
0007498Talerexchange API (HTTP specification)public2022-12-05 15:53
Reporteroec Assigned Tooec  
PrioritynormalSeveritymajorReproducibilityalways
Status feedbackResolutionopen 
Product Versiongit (master) 
Summary0007498: Incoherent calculation of fees during withdraw
DescriptionWith the latest wallet webextension (commit 3577227cc0ff0f9e0c422ae34c4407d88e98ec21) there is an inconsistency with the transaction fee calculation:

A withdraw amount of '10' leads to an transaction fee of '-0.13'.
A (higher) withdraw amount of '10.01' leads to a transaction fee of (only) '-0.01'.

Is this the result of a miscalculation or the fee-structure of the denominations?
Steps To ReproduceA)
1. On the withdraw form, I enter '10' as the value.
2. On the next dialog, I see '-0.13' as the transaction fee.

B)
1. On the withdraw form, I enter '10.01' as the value.
2. On the next dialog, I see '-0.01' as the transaction fee.
Additional Information- exchange config attached.
TagsNo tags attached.

Activities

oec

2022-11-28 14:19

developer  

c.conf (5,030 bytes)   
# This file is in the public domain.
#

[PATHS]
# Persistent data storage for the testcase
TALER_TEST_HOME = test_exchange_api_home/
TALER_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/${USER:-}/taler-system-runtime/

[taler-exchange-secmod-rsa]
# Reduce from 1 year to speed up test
LOOKAHEAD_SIGN = 24 days

[taler-exchange-secmod-eddsa]
# Reduce from 1 year to speed up test
LOOKAHEAD_SIGN = 24 days
# Reduce from 12 weeks to ensure we have multiple
DURATION = 14 days

[taler]
# Currency supported by the exchange (can only be one)
CURRENCY = EUR
CURRENCY_ROUND_UNIT = EUR:0.01

[auditor]
BASE_URL = "http://auditor.taler:8083/"

# HTTP port the auditor listens to
PORT = 8083

[exchange]

TERMS_ETAG = 0
PRIVACY_ETAG = 0

# HTTP port the exchange listens to
PORT = 8081

# Master public key used to sign the exchange's various keys
MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG

# How to access our database
DB = postgres

# Base URL of the exchange. Must be set to a URL where the
# exchange (or the twister) is actually listening.
BASE_URL = "http://exchange.taler:8081/"

# How big is an individual shard to be processed
# by taler-exchange-expire (in time).  It may take
# this much time for an expired purse to be really
# cleaned up and the coins refunded.
EXPIRE_SHARD_SIZE = 300 ms

EXPIRE_IDLE_SLEEP_INTERVAL = 1 s


[exchangedb-postgres]
CONFIG = "postgres:///talercheck"

[auditordb-postgres]
CONFIG = "postgres:///talercheck"

# Sections starting with "exchange-account-" configure the bank accounts
# of the exchange.  The "URL" specifies the account in
# payto://-format.
[exchange-account-1]
# What is the URL of our account?
#PAYTO_URI = "payto://x-taler-bank/bank.taler/42?receiver-name=42"
PAYTO_URI = "payto://iban/SANDBOXX/DE159593?receiver-name=Exchange+Company"
# ENABLE_CREDIT = YES

[exchange-accountcredentials-1]
WIRE_GATEWAY_URL = "http://bank.taler:9081/42/"

[exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)?
PAYTO_URI = "payto://x-taler-bank/bank.taler/2?receiver-name=2"
ENABLE_DEBIT = YES
ENABLE_CREDIT = YES

[exchange-accountcredentials-2]
WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
WIRE_GATEWAY_URL = "http://bank.taler:9081/2/"

[bank]
HTTP_PORT = 9081

# Enabled extensions
[exchange-extension-age_restriction]
ENABLED = YES
# default age groups:
#AGE_GROUPS = "8:10:12:14:16:18:21"

# Sections starting with "coin_" specify which denominations
# the exchange should support (and their respective fee structure)
[coin_eur_ct_1]
value = EUR:0.01
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.00
fee_deposit = EUR:0.00
fee_refresh = EUR:0.01
fee_refund = EUR:0.01
CIPHER = RSA
rsa_keysize = 1024

[coin_eur_ct_10]
value = EUR:0.10
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
CIPHER = RSA
rsa_keysize = 1024

[coin_eur_1]
value = EUR:1
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
CIPHER = RSA
rsa_keysize = 1024

[coin_eur_5]
value = EUR:5
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
CIPHER = RSA
rsa_keysize = 1024

[coin_eur_10]
value = EUR:10
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
CIPHER = RSA
rsa_keysize = 1024

[coin_eur_ct_1_age_restricted]
value = EUR:0.01
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.00
fee_deposit = EUR:0.00
fee_refresh = EUR:0.01
fee_refund = EUR:0.01
rsa_keysize = 1024
age_restricted = YES
CIPHER = RSA

[coin_eur_ct_10_age_restricted]
value = EUR:0.10
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
age_restricted = YES
CIPHER = RSA

[coin_eur_1_age_restricted]
value = EUR:1
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
age_restricted = YES
CIPHER = RSA

[coin_eur_5_age_restricted]
value = EUR:5
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
age_restricted = YES
CIPHER = RSA

[coin_eur_10_age_restricted]
value = EUR:10
duration_withdraw = 7 days
duration_spend = 2 years
duration_legal = 3 years
fee_withdraw = EUR:0.01
fee_deposit = EUR:0.01
fee_refresh = EUR:0.03
fee_refund = EUR:0.01
rsa_keysize = 1024
age_restricted = YES
CIPHER = RSA
c.conf (5,030 bytes)   

sebasjm

2022-11-28 15:58

developer   ~0019485

Well, I see that if you wire transfer 10.01, the exchange will give you 1 coin of 10 with the fee of 0.1 (as seen in the config)

If you wire transfer 10, it will discount 0.01 for every coin used an that will depend on the configuration.

I don't see any bug here.

oec

2022-11-28 16:20

developer   ~0019486

Last edited: 2022-11-28 16:38

Here is why this is broken, IMHO:

1. A user enters '10' to receive an amount of '10' because he/she needs that much.
2. On the next dialog page the user sees that he/she won't receive '10' but only '9.87' due to fees of '0.13'
3. But the user wants _10_ not, 9.87, so goes back and enters '10.13' instead, to include the fees.
4. But now, surprisingly, the result is '10.11' and the fees seem to be _lower_ for a _higher_ amount.

As a user I find this incoherent. Why should the user care about the demonination-structure and additive model for fees in the exchange?

I think the following are potential, orthogonal solutions:

a) Add to the withdraw form an option to either _include_ or _exclude_ the fees in the amount to be withdrawn. That way, the user wouldn't be confused in first place.

b) Change the fee mechanism for withdraw in the exchange to be based on the total _amount_ to be withdrawn, not the particular _denominations_ needed for that amount.

oec

2022-11-28 16:34

developer   ~0019487

Last edited: 2022-11-28 16:34

... c) Make the fees for denomations additive: D1 = N*D2 => fee(D1) = N*fee(D2). The auditor can check that, too.

Christian Grothoff

2022-12-05 10:34

manager   ~0019496

Well, let's see about (c):
1) Obviously, the lowest possible fee must be the lowest denomination, let's say that is 0.01 KUDOS.
2) Then for a 0.01 KUDOS coin, the deposit fee must be 0.01 KUDOS.
3) By your math, the fee for a coin of value X must then be X.
Consequently, you can only pay fees, but never merchants. See the problem?

oec

2022-12-05 14:22

developer   ~0019498

Not if the fee(v) = q*v with 0 < q << 1 and we only round up to D_0 at the end of the calculation, no?

However, I agree that (b) and (c) don't discourage the withdrawal of many small denominations.

Christian Grothoff

2022-12-05 14:35

manager   ~0019499

There are more problems with (c): the fees end up either too low for our business model (where microtransactions are where we can make real profits), or too high to be competitive with traditional payment systems for larger amounts. Imagine q=1%. Then for a 1cent transaction, you may make too little profit. But for a 1000 EUR transaction, your fee is already insanely high. Logarithmic fees are actually good for Taler, it makes us competitive in all markets.

oec

2022-12-05 15:53

developer   ~0019500

That leaves option a) above.

Issue History

Date Modified Username Field Change
2022-11-28 14:19 oec New Issue
2022-11-28 14:19 oec Status new => assigned
2022-11-28 14:19 oec Assigned To => sebasjm
2022-11-28 14:19 oec File Added: 2022-11-28-141823_715x727_scrot.png
2022-11-28 14:19 oec File Added: 2022-11-28-141747_681x742_scrot.png
2022-11-28 14:19 oec File Added: c.conf
2022-11-28 15:58 sebasjm Note Added: 0019485
2022-11-28 15:58 sebasjm Assigned To sebasjm => oec
2022-11-28 16:20 oec Note Added: 0019486
2022-11-28 16:20 oec Assigned To oec => sebasjm
2022-11-28 16:22 oec Assigned To sebasjm => Christian Grothoff
2022-11-28 16:22 oec Category wallet (WebExtensions) => exchange API (HTTP specification)
2022-11-28 16:34 oec Note Added: 0019487
2022-11-28 16:34 oec Note Edited: 0019487
2022-11-28 16:38 oec Note Edited: 0019486
2022-12-05 10:34 Christian Grothoff Note Added: 0019496
2022-12-05 10:35 Christian Grothoff Assigned To Christian Grothoff => oec
2022-12-05 10:35 Christian Grothoff Status assigned => feedback
2022-12-05 14:22 oec Note Added: 0019498
2022-12-05 14:35 Christian Grothoff Note Added: 0019499
2022-12-05 15:53 oec Note Added: 0019500