View Issue Details

IDProjectCategoryView StatusLast Update
0007492Talerwallet-corepublic2023-01-26 21:53
ReporterChristian Grothoff Assigned ToFlorian Dold Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityurgentSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.9.1Fixed in Version0.9.1 
Summary0007492: wallet is still bad at arithmetic and looses money
DescriptionWe withdrew 0.0001 BTC.
Wallet receives 0.00099992 BTC after fees (OK, I guess).
I do a push payment over 0.00000002 BTC. No fees are shown. Usual fees are 1 satoshi, so this shouldn't cost much either.
New balance shows as 0.00099974. Given that the push payment shows as 2 satoshi cost, I had expected to see 99990 Satoshi.
I guess there MIGHT have been fees of 16 satoshi (deposit, refresh), but I had no prior indication that I'd have high fees here.

So either the fees are still not shown properly for p2p payments, or the wallet is still bad at math ;-).
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Windfisch

2022-12-19 01:48

reporter   ~0019515

The same happens when withdrawing 13.37 moneyz. The wallet tries to withdraw 13.36999999 instead. This smells like a floating point rounding error. For money, fix point arithmetics should be used instead.

Christian Grothoff

2022-12-19 08:17

manager   ~0019516

Last edited: 2022-12-19 08:27

The wallet never uses floating point, but it could be related to fees.

Christian Grothoff

2022-12-19 08:27

manager   ~0019517

Just analyzed this. Florian and I believe what happened is (simplified):
- imagine 4 satoshi are left to be withdrawn.
- wallet withdraws 2 satoshi with a 1 satoshi withdraw fee. The remaining satoshi CANNOT be withdrawn, as the withdraw fee is 1 satoshi.

The wallet could have
- withdrawn twice 1 satoshi paying 2 satoshi in withdraw fees. But the result would have been generally less useful, as each satoshi has a 1 satoshi deposit fee, so they are both worthless for merchants (and not more useful than the 2 satoshi piece, except for merchants that want a payment of 1 satoshi while covering the 1 satoshi deposit fee). So the wallet actually made the right choice here.

To avoid user confusion, we suggest that in the future a residual amount that is less than the withdraw fee plus coin value is hidden in the UX by adding this 'loss' to the fee that is being shown to the user.

Windfisch

2022-12-19 12:16

reporter   ~0019518

This happens not only for Bitcoin (never tried), but also for the KUDOS test setup on exchange.demo.taler.net, as well as my test setup on exchange.taler.windfis.ch (which will go down soon-ish).

Try selecting the exchange.demo.taler.net exchange and withdraw 13.37 KUDOS, you will get:

"Withdraw: 13.3 Kudos"

"Selected Amount: 13.36999999 KUDOS"

"Fees: -0.0699999 KUDOS"

Something very similar happens with 133.7 KUDOS

sebasjm

2022-12-19 18:05

developer   ~0019520

It would be nice to have a test case for that.

Windfisch, could you share the denomination configuration?
I could not reproduce your case on demo.taler.net, but seems complete logic.

Withdraw 13.3 KUDOS
Transaction fees -0.1 KUDOS
Total 13.2 KUDOS

Withdraw 13.37 KUDOS
Transaction fees -0.07 KUDOS
Total 13.30 KUDOS

Florian Dold

2022-12-20 09:08

manager   ~0019521

The wallet internally never uses floating point numbers, but always fixed-point arithmetic.

The issue must be either with the UI (i.e. conversion to float when rendering the amount) or come from the denomination configuration (and maybe some weird denomination selection done by the wallet).

@Windfish: As Sebastian said, the denomination configuration would be very helpful. Also, which wallet are you using?

Florian Dold

2023-01-13 01:16

manager   ~0019647

We now have a test for the withdrawal fees (taler-harness run-integrationtests withdrawal-fees).

Also, p2p push payments should now show the total cost properly to the initiator.

For p2p pull payments, we have 0007579 open.

Issue History

Date ModifiedUsernameFieldChange
2022-11-23 10:22Christian GrothoffNew Issue
2022-11-23 10:22Christian GrothoffStatusnew => assigned
2022-11-23 10:22Christian GrothoffAssigned To => Florian Dold
2022-12-19 01:48WindfischNote Added: 0019515
2022-12-19 08:17Christian GrothoffNote Added: 0019516
2022-12-19 08:27Christian GrothoffNote Added: 0019517
2022-12-19 08:27Christian GrothoffNote Edited: 0019516
2022-12-19 12:16WindfischNote Added: 0019518
2022-12-19 18:05sebasjmNote Added: 0019520
2022-12-20 09:08Florian DoldNote Added: 0019521
2023-01-13 01:16Florian DoldStatusassigned => informing
2023-01-13 01:16Florian DoldResolutionopen => fixed
2023-01-13 01:16Florian DoldNote Added: 0019647
2023-01-23 21:25Christian GrothoffFixed in Version => 0.9.1
2023-01-26 21:53Christian GrothoffStatusinforming => closed
2023-04-13 18:36Florian DoldCategorywallet (TS core) => wallet-core