stellard icon indicating copy to clipboard operation
stellard copied to clipboard

Restore Partial Payments

Open itsseanbennett opened this issue 10 years ago • 9 comments

Partial payments have their use in the network.

They are important for returning funds, and are useful for arbitrage traders.

Please consider re-introducing them, with an important change: I propose every transaction have a "DeliveredAmount" in the metadata, and we prompt developers to use this field instead of the 'Amount' field signed by the sender.

itsseanbennett avatar Oct 12 '14 02:10 itsseanbennett

You can calculate the payment client side. This doesn't need to be in the protocol.

jedmccaleb avatar Oct 12 '14 02:10 jedmccaleb

There may have been significant changes to markets/account balances/trust lines between the time you request information (to make the calculations), and the time your payment is submitted.

It's a really nice feature for when it is acceptable to have some of the payment go through, and not have to make any calculations beforehand / worrying about state changing before your transaction goes through.

itsseanbennett avatar Oct 12 '14 03:10 itsseanbennett

have you ever used it?

jedmccaleb avatar Oct 12 '14 03:10 jedmccaleb

No, my attention was never brought to them before. However, I am proposing this again since I see a use for them, and indeed I will implement them if they return.

itsseanbennett avatar Oct 12 '14 03:10 itsseanbennett

Hi, Jed. I use it. It is really useful to do arbitrage traders. I also run the RippleFox gateway. So I suggest you to keep the feature and add a flag to account. It may call "AcceptPartialPayment", just as "rippling" feature. Of course, it should be default disabled.

liangran avatar Oct 12 '14 06:10 liangran

I don't think it should be allowed to request for a transfer of an amount that is bigger that the current balance. This should always fail, even if it is a partial payment. The user always knows the minimum amount that his wallet has so a partial payment should always succeed if he keeps the transfer amount inside these limits.

xekoukou avatar Oct 12 '14 12:10 xekoukou

Hi all, I totally agree people should not send an amount that is bigger than the current balance. The 'Partial Payment' should not be used like this. However, all you are talking about is about the payment in the same currency, like USD to USD.

The case we need 'Partial Payment' is when people do 'convert' or send 'USD' use 'CNY'. Image that you want to convert 10 USD using CNY. Before your payment, you may find 10 USD available. However, someone may fill 5 USD when you submit the payment. You can still get 5 USD if you set 'Partial payment' flag. If no 'partial payment', you get nothing but a fail transaction.

liangran avatar Oct 13 '14 02:10 liangran

@liangran @xekoukou That doesn't make any sense. Imagine a Bitcoin gateway is issuing me Bitcoins. Because they're a gateway, they're almost certain to have a large negative balance. Are you saying they shouldn't be able to issue any Bitcoins?

Say a new currency is introduced, "FOO". Everybody's "FOO" balance is zero because the currency hasn't been introduced yet. Are you saying nobody should be able to send any "FOO" at all? If so, how could you ever have new currencies?

It is perfectly routine to send assets nobody yet holds. That's how new assets get created.

JoelKatz avatar Oct 13 '14 03:10 JoelKatz

@JoelKatz Well, yes. it is not exactly the balance you check. To be more precise, if the people trust you for "a" coins and you trust them for "b" coins, then if your balance is "c", you can transfer at maximum "c+a" coins. We would simply check whether the request of the partial payment is smaller than this.

The actual amount transferred might change significantly or even exchanged with another currency. That doesn't matter. What we gain from this is that for a hacker to misuse such a feature, he would need to "have" that amount of coins.

We check the first hop of the path, because the user already knows the maximum amount of coins he can transfer/exchange.

edit: Unfortunately , this is easily circumvented.

xekoukou avatar Oct 13 '14 07:10 xekoukou