Software Models: The Vending Machine, The Slot Machine.

in #tauchain4 years ago

The Vending Machine Model

Nick Szabo the inventor of the smart contract concept mentioned that the concept of "smart contract" is based on a model which he claim descended from the humble vending machine. In my opinion this is true and can be generalized because software in general (at least a lot of examples off the top of my head) can be thought of as vending machines. In fact when I write code and model software in my own head for the most part the model I use is that of the vending machine. To put it into more technical terms a vending machine is a finite state machine.

To provide an illustration:

Input: (user chooses an option from the menu)
Options List (a set of variables to determine the state) presented to user.
Conditions: If this then that, etcs
Output: (user receives an output based on the option they chose from the menu)

The option list can just be the acceptable commands sent to the smart contract or the vending machine. The vending machine requires payment before a selection is considered valid. Valid input would be paid input in the vending machine model. The conditions would be depending on what the user selects from the options list so for example if the user selects option A then the subroutine or function associated with option A is executed. This if then would apply to the whole list of variable options of course.
The output would depend on what option the user chose and would be the result of the subroutine or function. So as you can see software in general has input, has options for the user to choose from, and has some output. Smart contracts basically are the same but in general a smart contract has a limited number of possible states and this is important to remember when thinking about something like decidability.

Now if we think of a more complex vending machine model we could for example create a decentralized exchange smart contract which just like a vending machine would work in a very similar way. If your software is decidable then it makes it easier to model and easier to think about because you can map out all possible states from the beginning design phase.

The Slot Machine Model

The Slot Machine is basically a type of vending machine but it's designed in such a way to be fun, to be sticky, to be addictive. The Slot Machine shows the power of game theory and aligned incentives. As we know, the secret sauce of the Slot Machine is intermittent reinforcement. It is this too which is behind the dashboard, the daily feed, the email box, the notifications, the likes economy, and many other examples we see on social media. The incentives create the UX, which works by rewarding players of the game by applying gamifaction. Sometimes it's done in multiple levels, sometimes it's a singular level, but this is a key element to UX.

The Vending Machine model may help people to think about how to design or write a smart contract. The Slot Machine Model may help people to think about how to do UX. Models in general help people to create new things based on outlines from already known old things.

References

  1. https://blog.acolyer.org/2018/03/20/designing-secure-ethereum-smart-contracts-a-finite-state-machine-approach/
Sort:  

To listen to the audio version of this article click on the play image.

Brought to you by @tts. If you find it useful please consider upvoting this reply.

Coin Marketplace

STEEM 0.32
TRX 0.11
JST 0.034
BTC 66384.36
ETH 3272.25
USDT 1.00
SBD 4.27