-
Notifications
You must be signed in to change notification settings - Fork 15
Concrete usage samples
We will try to describe some usages of Open UDC.
The topic of the samples below will be : "A man buy some bread in a bakery. What happens ?"
The man is paying with a mobile phone, and is disconnected from the network.
- A good man. He wants some bread and has enough money on his mobile phone.
- The baker is connected to the network
The man ask for a bread. It costs 8 oUDC. The man has one piece of 8 oUDC. He makes the transaction with the baker.
The baker receives one signed transaction from the man. Its added to the baker transactions historic, and synchronized on the network.
The man receives one signed transaction from the baker. Its added to the man transaction historic.
When the man goes home, he synchronizes his transaction historic on the network.
- A good man. He wants some bread. He has 2 pieces : one of 2 oUDC, and one of 4 oUDC.
- The baker is connected to the network. He actually has only a piece of 2 oUDC.
- The bread costs 5 oUDC.
The man ask for a bread and pays.
The baker ask for a change on the network. He gives 2 oUDC and receives 2*1 oUDC. 3 transactions are given to the baker, signed by the changer. And 3 transactions are also given to the changer, signed by the baker.
The baker gives two signed transaction to the man for the 2+4 oUDC. And so do the man.
The baker gives a signed transaction to the man for the 1 oUDC. And so do the man.
- A bad man. He wants to cheat with the system, so that he can pay 2 times with his money. (Double Money Spending problem)
- The baker is connected to the network.
- There is a barman selling beers, and he is connected to the network
The man ask for a bread, and pays. He makes the transaction with the baker.
The baker receives one signed transaction from the man. Its added to the baker transaction historic and synchronized on the network.
The man receves one signed transaction from the baker. Its added to the man transaction historic.
The man cheats with his transaction historic and deletes the last transaction.
The man now wants to buy a beer with the same money used for the bread. As he deleted the transaction with the baker to his historic, the money is still on his mobile phone.
He ask the barman for a beer. He makes the transaction with the barman.
The barman receives the transaction from the man. Its added to the barman transaction historic. He synchronizes his historic on the network.
The bad man is caught. The pieces used for the transaction are detected as double cause the baker has already declared a transaction with these pieces.
- A good man.
- A baker. He has no connection to the network in his bakery.
The man ask for a bread and pay. A transaction is made between the man and the baker.
The baker cannot synchronize the transaction for now. He trusts in the man, and will wait for being at home. He will synchronize the transaction at this moment.
- A bad man. He wants to cheat with the system, and pay a beer and a bread with the same money.
- A baker. He is connected to the network.
- A barman. He has no connection to the network in his bar.
The man ask for a bread and pay. A transaction is made between the man and the baker.
The baker synchronizes the transaction with the network.
The man deletes the last transaction from his historic.
The man go to the bar, and ask for a beer. He pay with the same money as he paid the baker.
But the barman cannot synchronize the transaction with the network. He trusts in the man, and wait for being at home to synchronize the transaction.
When he is at home, he synchronizes the transaction. ERROR ! The money was spend to pay the baker ! The transaction is canceled. Only justice can act now.