I asked, ‘what is smart contract?’ he said he knows, Do you believe him? because I don’t!
I am talking about my dad here, I want to believe him but his actions just leave a myriad of doubts in my head. It’s my dad though which may trigger bias so I will leave you folks to answer this question for me as I take you through how the events unfolded.
As my job interview with a blockchain-based start-up drew closer, I found myself plagued by doubts about the practical applications of blockchain technology, particularly when it came to smart contracts. Despite hearing a lot about their potential benefits, I wasn’t sure if smart contracts were really as revolutionary as they were being made out to be.
Until this point, I had been struggling to wrap my head around the science behind blockchain technology. Here’s the thing, it wasn’t that I couldn’t comprehend it, but rather, I couldn’t bring myself to believe it. Terms like ‘decentralization,’ ‘distributed ledger,’ ‘cryptography,’ ‘self-executing,’ and ‘immutability’ all seemed like parts of a well-crafted, but ultimately fictional narrative.
My dad suggested that I accompany him to his next chess game, as a way to help me improve my understanding of a smart contract. However, I couldn’t help but wonder whether he genuinely believed I could learn from watching him play, or if it was just another of his ploys to show off his own prowess and revel in victory once again.
During his prime, he had won numerous amateur competitions, and although he boasted about them as if he were a world champion, his experience did teach us at an early age how to play the game. There were some merits to his invite though as this tournament was unique, all the competitors were to face off against an AI robot named Rex. In addition, the chess board was directly linked to the blockchain, and a smart contract had been programmed into Rex’s AI system.
What is Smart Contract? The Lesson Begins
The location where the players went to play their chess game was nothing as I had imagined. It was a remote, dimly lit room, with a single table in the middle and absolute silence all around. The AI robot sat in the centre of the room, looking ominous and waiting to be activated. It created tension but this was how my dad liked to play — in total silence.
He drew the white pieces and the robot was assigned the black pieces through a random selection. With a nervous breath, I sat down, eagerly waiting for the game to begin. Despite my father’s intention to teach me about smart contracts, I was too engrossed in the game of chess to think about anything else. As he hit the timer, the robot sprang to life, and the game commenced.
My dad wasted no time in going on the offensive, starting the game with an aggressive move by pushing his pawn to e4, clearly aiming to gain control of the centre. The robot quickly responded by moving its pawn to c5, showing that it was ready to fight back.
It was a brilliant response from Rex, controller of the black pieces, to the opening by my dad who had white. In chess, the strategy Rex employed to counter is called the Sicilian defence as black immediately challenges whites’ control of the centre.
At this point, I realized why the smart contract had chosen the Sicilian defence. Smart contracts are designed to be flexible and serve different purposes, and in this case, the contract had preset rules for responding to specific moves made by the opponent. It became clear that the name “smart contract” is appropriate because it is not a static contract, meaning that it is not fixed or unchanging.
Instead, it can be designed with a predictive algorithm that can respond to various types of moves played by an opponent. This is different from a static contract, which would have been locked into a particular strategy, such as the Scandinavian defence, that could have led to early losses of pawns for black. The smart contract is designed to take the best course of action based on the situation at hand.
The silence in the room was deafening as the two tactical masters continued to make their moves, each increasing in complexity as they both vied for an advantage. After some time, Rex had established a strong attacking formation in the centre with pawns on e6, d6, and c5. In addition, he had strategically placed his rooks and bishops on one side of the board while his knights and queen were positioned on the other, indicating a plan to also advance through the flanks.
Rex’s strategic placement of pieces left my dad reeling, requiring him to act fast to find a counter. He retreated his knight and bishop to c3 and g4 respectively, maintaining a solid defence and waiting for Rex’s advance to lose momentum before striking back.
It was the three-pronged attack strategy used by Rex and in chess, is indeed a formidable approach as it puts pressure on the opponent from different angles, making it difficult for them to defend against all three at once.
The caveat though is that in the event that two of the attacks are successfully countered then the third attack is reeled in so that you can re-strategise. If an opponent chooses to focus on one front, they risk being exploited from other areas of the board. When they attempt to launch a counterattack, they may also leave weaknesses in their defence that can be taken advantage of. Therefore, effectively countering a three-pronged attack requires a highly skilled and coordinated response.
Once again, I had a realization that drew a parallel between the three-pronged attack in chess and the if/when statements that a smart contract can execute. Think of the three-pronged attack now as that of a company trying to grow its revenue through three different initiatives.
This is a snippet of how it will be programmed on the smart contract:
- The smart contract is programmed to track the three strategies the company has decided to launch to grow its revenue: A, B, and C.
- If way A fails, the smart contract will move on to way B
- If ways A and B fail, the smart contract will not act upon ways C and instead will require a new strategy.
- The smart contract uses if/when statements to check the status of each initiative and execute the appropriate actions.
These statements will be automatically executed when certain conditions are met, without the need for human intervention. This is how Rex is able to execute its strategies expertly, due to the dynamic statements programmed into its smart contract.
Rex’s three-pronged attack was proving to be effective, and my dad was struggling to hold his ground on the board. In an act of desperation to alter the course of the game, my dad did the unthinkable. He picked up his pawn on the 2nd rank and placed it on the 8th rank to convert it to a queen.
In chess, the pawn’s movement is limited to one square at a time, except during its first move, when it can move two squares. However, somehow my dad made it take 6 steps at a go. In blunt terms, for those who may still be guessing, he tried to play a fast one on Rex.
Ole! Ole!! Ole!!! — An African word meaning criminal — began to ring out from Rex, raising the alarm for the attempt to cheat. Quickly, he repositioned the pawn back to its original square to stop the alarm. With guilt all over his face, he tried to slide past it as he looked at me and asked me to get him his glasses. “Dad, you are already wearing them!” I replied.
“Oh, true that” he muttered. It was a weak attempt to save face but with all that resolved, the game must go on.
Yes yes, he tried to cheat, we have all tried to at some point when the going gets tough but once again, it demonstrated to me another key hallmark of a smart contract.
Allow me to explain, a smart contract is essentially defined by its code, which outlines the conditions and actions that can be executed in response to specific events. The very essence of a smart contract is that it is transparent and immune to corruption.
What the smart contract does is it verifies the validity of each chess move made and prompts the player to make a valid move if the move is invalid. This same concept can apply to voting in an election, where the smart contract tallies the votes and prevents any official from inputting a wrong number. If an official attempts to input a wrong number, the smart contract will reject it and raise an alarm.
The Zing Moment
As the game neared its end, Rex had managed to place a rook on the seventh rank, also known as a “pig,” which gave him control over the board and the ability to capture any pieces in its path. Within a few moves, Rex had achieved checkmate, ending the game and securing his victory over my dad.
My dad appeared devastated, and it was hard to tell what hurt him more: his pride being wounded or losing the bet he made by staking his signed golf ball on the game. As he looked around and saw that only I was present with Rex, which had now shut down, he gave me a small wink, and I knew exactly what that meant. We opened Rex, extracted its memory, and wiped it clean so that no one could check the true outcome of the match, or so we thought.
We approached the competition arbiter and informed him of Rex’s pseudo malfunction, but he rejected our claim and declared that my dad had lost. In a typical fashion of an old African man, my dad grabbed the arbiter tight by the neck and insisted that he had won. After a heated exchange and presentation of clear evidence, my dad finally acknowledged that he did actually lose.
I wondered tentatively how they knew we lost as they were so adamant about it and then once again the realisation hit me. The pressure of the moment had gotten to us both and we had forgotten one of the core principles of a smart contract built on a blockchain.
A smart contract is usually implemented on a decentralised blockchain network, which ensures that the contract is transparent, secure and tamper-proof. This means that try as we may, the scores had already been recorded on a distributed network of nodes as they were executed, with no single point of record but rather multiple ones.
The experience was dreamlike for me, as I finally understood the hype around blockchain and smart contracts. It left me feeling newly enamoured and ready to ace my upcoming job interview. The key takeaway was that
“A smart contract is a self-executing program typically stored on a blockchain that automates actions when predetermined conditions are met. Their major characteristics are that they are transparent, secure, and tamper-proof.”
After the heated argument, my dad pulled me aside and revealed that he had intentionally put on a show to showcase the power of a smart contract and its practical applications. Hmmm, I had my doubts about his motives, but I’ll leave it to you to decide.
So I ask again, do you believe him?