S creates sets price, maxNumOfRenegotiations, securityDeposit1 (k1 for short) and securityDeposit2 (k2 for short)
B joins and sends price + k1
S accepts B and sends k2
B concludes and withdraws k1
S concludes and withdraws k2 + price
3a. B rejects and offers newPrice (renegotiationsCount++)
4aa. S concludes and withdraws newPrice + k2
5aa. B concludes and withdraws price - newPrice + k1
4ab. S rejects and offers newPrice2 (renegotiationsCount++)
5ab. B concludes and withdraws price - newPrice2 + k1
6ab. S concludes and withdraws newPrice2 + k2
if renegotiationsCount > maxNumOfRenegotiations
(renegotiationsCount+3)a. S/B rejects - system confiscates k1 and k2
(renegotiationsCount+4)a. S concludes and withdraws price
(renegotiationsCount+5)a*. B concludes
Scenario:
3a. B rejects and offers newPrice (renegotiationsCount++) 4aa. S concludes and withdraws newPrice + k2 5aa. B concludes and withdraws price - newPrice + k1
4ab. S rejects and offers newPrice2 (renegotiationsCount++) 5ab. B concludes and withdraws price - newPrice2 + k1 6ab. S concludes and withdraws newPrice2 + k2
if renegotiationsCount > maxNumOfRenegotiations (renegotiationsCount+3)a. S/B rejects - system confiscates k1 and k2 (renegotiationsCount+4)a. S concludes and withdraws price (renegotiationsCount+5)a*. B concludes
Custom properties: price, securityDeposit1, securityDeposit2, maxNumOfRenegotiations, renegotiationsCount