These are chat archives for ethersphere/orange-lounge

20th
Oct 2017
holisticode
@holisticode
Oct 20 2017 19:09
@homotopycolimit @zelig for waivers, the text says:
Suppose thatthe last cheque B cashed was ci[...], and that the last cheque cashed had serial number i
Is it not the case that actually, formally, the last cheque cashed MUST have serial number n instead of i? Because every new cheque actually invalidates any previous one, and thus only the latest can be cashed ?
Or am I missing something
holisticode
@holisticode
Oct 20 2017 19:15
ah maybe not: at the point of cashing ci, it is the latest, but then ci+1 can be issued
holisticode
@holisticode
Oct 20 2017 19:28
what would need amendment though is that if B cashes in cheque i, then the Sum at ti is 0 (zero) - thus
"This process can be repeated multiple times until the cumulative total is brought back to ti."
should say ">"This process can be repeated multiple times until the cumulative total is brought back to ti+1." no?
Aron
@homotopycolimit
Oct 20 2017 20:33
no
if I hold cheques 5, 6, 7, 8, and 9 from you, I can in theory cash in cheque number 7.
Yes I know that 9 is the latest and that 9 supersedes 7, but the contract doesn't know (can't know) how many outstanding cheques there are
So I could send in number 9 or I could send in number 7 and then 9 or 7 and then 8 and then 9.
holisticode
@holisticode
Oct 20 2017 20:35
hmmm but that is what the serial number is for?
Aron
@homotopycolimit
Oct 20 2017 20:36
As for reducing the total .... if the last cheque sent in was c_i, and the cumulative payout is t_i then we cannot go below t_i again
so if I hold further cheques (up to n, was it?) then we can keep adding waivers until the total has dropped back down to t_i. At that point we are even and no further reduction in debt is possible.
the serial number tells you which cheque comes after which other cheque.
holisticode
@holisticode
Oct 20 2017 20:37
exactly - so the contract knows how many cheques it issued
Aron
@homotopycolimit
Oct 20 2017 20:37
I can send in 7, then 8 and then 9 but I cannot send in 4
the contract does not issue cheques
the owner of the chequebook issues cheques
holisticode
@holisticode
Oct 20 2017 20:38
that's right
but if you send 7, then the cumulative sum of 9 becomes incorrect
Aron
@homotopycolimit
Oct 20 2017 20:40
no
it stays correct
you are misunderstanding something.
if I cash number 7 or hold on to it... .that doesn't change number 8 or 9 ...
holisticode
@holisticode
Oct 20 2017 20:42
yes I am confused
say 7 has cumulative of 20, then 8 with amount 5 gets a new cumulative of 25, 9 with amount 8 a new cumulative of 33
so cheque 9 says "cumulative 33"
then I cash in 7 which said 20
so the balance is 13
so if I come with cheque 9 which says 33....?
Aron
@homotopycolimit
Oct 20 2017 20:44

at the end of every day I write you a note saying how much I owe you.
Monday: I owe you 12.
Tuesday: I owe you 22
Wednesday: I owe you 36
Thursday: I owe you 55.
etc..

You can always go to my bank and ask them to pay you. If you go on Tuesday, they will pay you 22.

If you go again on Thursday they will pay you 33 (that is 55-22).

It doesn't matter when you go to the bank, they will always pay you what you are owed at that time.

So even though I sent you a note that says I owe you 55, it really only meant 33 because I had already paid 22 on Tuesday. But it doesn't really matter.... that's what we mean by cumulative totals on the cheques.

Now suppose that you went to my bank on Tuesday. You got 22.
Suppose also that on Friday, I do work for you and you should pay me 10 for it. Instead of paying me 10 you instead write the note: On Friday Aron owes me 45 (down from 55, see?).... and we can keep doing that:
Saturday 39
Sunday 28
... we can do it until we hit 22. We can't go below 22 because you were already paid out the 22.... The 22 is our zero.

That's what I meant by saying: we can keep doing this until the total is brought back to t_i

holisticode
@holisticode
Oct 20 2017 20:49
yes I understand that
but can I go Tuesday and ask for 12?
Aron
@homotopycolimit
Oct 20 2017 20:49

so if I come with cheque 9 which says 33....?

you will be paid 33 - 20 = 13

holisticode
@holisticode
Oct 20 2017 20:50
in other words, the moment I cash in the balance goes to zero
Aron
@homotopycolimit
Oct 20 2017 20:50

but can I go Tuesday and ask for 12?

You can go on Tuesday and hand in Monday's note and get 12.
Then you can hand in Tuesday's note and get another 10.

holisticode
@holisticode
Oct 20 2017 20:50
or not?
Aron
@homotopycolimit
Oct 20 2017 20:50
what is "the balance" in that sentence?
holisticode
@holisticode
Oct 20 2017 20:50
the "real" debt if you want
Aron
@homotopycolimit
Oct 20 2017 20:51
The chequebook remembers how much you have already gotten paid.
The real debt is something only you and I know. The chequebook does not.
If I give you a cheque covering all my debts and then you cash it; then yes, the real debt is zero.
If you go to my chequebook contract with a cheque and cash it... who is to say if the real debt is now zero? We just don't know. Was it the newest cheque? Was it an old one? Does it matter?
holisticode
@holisticode
Oct 20 2017 20:54
ok - my confusion arose from thinking that the cumulative amount on the cheque would be binding
in fact - why put it there at all if it doesn't affect what gets paid out?
Aron
@homotopycolimit
Oct 20 2017 20:55
You can hold a cheque from me that says 55, but if you try to cash it, you only get 33
why put what there? the cumulative total? because it's the only thing that makes sense to put there.
otherwise you'd have to cash every single cheque individually... and that is precisely what we want to avoid.
holisticode
@holisticode
Oct 20 2017 20:56
oh so there's no "face" value?
Aron
@homotopycolimit
Oct 20 2017 20:57
Value == face value (on cheque) - already paid out amount (stored in the contract)
So in the example above, the value is 55 - 33
i.e. you get 22.
and if you go and cash in Wednesday's cheque, then the new value of Thrusday's cheque becomes 55 - 36
but it's still the same cheque :)
holisticode
@holisticode
Oct 20 2017 20:59
and in you example above:
Wednesday: I owe you 36
Thursday: I owe you 55.
The cheque on Thursday says 55, not 19
?
also, couldn't a malicious B challenge A saying that his cheque says 55 are owed, although 22 had been paid out already?
holisticode
@holisticode
Oct 20 2017 21:04
I mean the 22 payout is on-chain, but it needs then a reference to the cheque or something as a proof for A that she did payout 22 to B during that exchange
Aron
@homotopycolimit
Oct 20 2017 21:07
cheques contain the \emph{cumulative} total amount ever credited to the beneficiary. The total cumulative amount that has been cashed out is stored in the contract for each beneficiary. When a new cheque is submitted, the contract ignores cheques with amount equal to or less than the stored total, but it will transfer the difference if it receives a cheque with a higher total.
A's chequebook contract remembers the 22 paid to B.
And further cheque with B as the beneficiary will pay out 22 less than the face value.
When that cheque is cashed, the new total is stored (overriding the 22)
holisticode
@holisticode
Oct 20 2017 21:13
ok thanks!
holisticode
@holisticode
Oct 20 2017 21:23
what does this exactly mean though:
. Upon receiving a cheque cashing request, the contract must wait to allow theother party in question to submit potentially missing information about cancelled cheques or reducedtotals.
wait for how much? what closes this delay period?
what happens during this period? Any further rules like "no new cheques can be emitted" or "no new cashing requests allowed" or the like?
Aron
@homotopycolimit
Oct 20 2017 21:37
In the case without "waivers", there is no delay period. You can send in a cheque and get paid in one transaction.
However, if we have waivers, then you could have cheques for 22, then 36, then 55 and then 51(!).....
and because the totals can go down we need a way to prevent you claiming the 55, when you should only be claiming 51.
So what happens is that you send in a cheuque... If it really was the more recent cheque, you can get your payout after the delay is over. 24hours? 48hours?
but(!) if you try to cash in the 55 when the latest cheque has 51, then (because it's on the blockchain I can see that happening) I send in the 51 (which you signed)
that is what the delay period is needed.
holisticode
@holisticode
Oct 20 2017 21:44
ok so the delay period kicks in after a first "waiver" is sent in, i.e. a cheque with lower claim
holisticode
@holisticode
Oct 20 2017 21:59
is the following correct: when B reaches the payment threshold to B, B issues a cheque to A, and the balance is reset to zero immediately?
Or only when the cheque has been paid? Or when is the balance reset exactly?
Aron
@homotopycolimit
Oct 20 2017 23:10

that's the swap balance. the internal accounting of who owes whom.
On that internal level, if I send you a cheque, we're back to zero.

but you can still hold on to cheques or cash them as you see fit.

holisticode
@holisticode
Oct 20 2017 23:12
yes I referred to the internal accounting, sorry for jumping around - ok that's also clear now, thanks
Another question: since the owner of the chequebook issues cheques, and not the contract, there is a potential error in that the issuer could put a wrong cumulative amount into the cheque which will be sent
I guess we treat that the same way as you would enter a wrong cheque amount by hand in a physical-world cheque
The "ultimate" reality is the contract of course, but this could be a source of confusion maybe
Thanks @homotopycolimit for your patience explaining, sometimes I am a bit slow