Smart Contract: a brief introduction
January 13, 2023
Learn what a smart contract is, how it works on the blockchain and scheduling with Solidity. An introductory guide to the world of digital contracts.

Underlying the operation of smart contracts is the blockchain.
It is now commonplace to mention the name blockchain in a wide variety of contexts, from everyday life to involving major issues of political and international value.
However, reference is often made to a technology that is poorly understood, hostile to most and surrounded by a veil of mystery.
Index
- Blockchain, what is the basis of operation?
- Beyond the blockchain: Cryptocurrencies and Smart Contracts
- What languages to program a Smart Contrct?
- The Future of Digital Contracts
Blockchain, what underlies the operation of digital contracts?
Blockchain belongs to the so-called DLTs, or Distributed Ledger Technologies. These technologies put into practice the concept of ledger, i.e., a distributed ledger, and have the following properties:
- anonymous, the identity of participants is anonymous or pseudo-anonymous;
- unanimous, all participants in the network agree on the validity of each record saved within it;
- timestamped, each transaction is associated with its own timestamp;
- immutable, each record on the chain is irreversible and cannot be changed;
- distributed, all nodes, that is, participants in the network, have a copy of the ledger, the register, to ensure complete transparency;
- programmable, the blockchain is programmable through the creation of smart contracts.

Centralized vs. decentralized structure
Blockchain lays its foundation in older times when crucial information was kept track of through written form in records.
The latter consist of structured data written on the basis of predetermined rules. The register can then be consulted and used whenever it is desired to obtain confirmation by consulting the information it contains.
Beyond the blockchain: Cryptocurrencies and Smart Contracts
All the mentioned features are of fundamental importance for the proper functioning of a blockchain. Thanks to these peculiarities we have witnessed the birth of the infamous virtual currencies or cryptocurrencies, first among them: Bitcoin.
The operation of digital currencies is based, once again, on cryptography and decentralized peer-to-peer technologies that enable the exchange of virtual currencies between wallets.
The main crypto coins currently in circulation are: Bitcoin, Bitcoin Cash, Ripple, Ethereum, Litecoin, Tether, BNB, Dogecoin. Other less famous ones such as Dash, Stellar Lumens, Solana.
The list could go on and on... CoinMarketCap is the most referenced cryptocurrency price tracking website in the world and currently tracks 8958 different cryptocurrencies.

Bitcoin was the first decentralized cryptocurrency in history. It was born primarily with the aim of revolutionizing financial transactions with the goal of making them: transparent, fast and fraud-proof.
On the other hand, however, born by Vitalik Buterin in 2013, Ethereum has revolutionized the world of cryptocurrencies by enabling, in addition to financial exchanges, the development and scheduling of digital contracts.
But this is not the only revolution of the Ethereum Foundation, which in 2022 made the transition to the Proof-of-Stake (PoS) validation system: The Merge.
The real innovation is that the validator, i.e., the miner in the Proof-of-Work context, validates a new block added to the blockchain and receives as a reward the transaction fees contained in that block. The validator is chosen randomly from among all the nodes in the network, and the chances of him being chosen increase dramatically as the number of tokens he possesses increases.
The energy consumption by PoS is glaring since the network nodes no longer have to compete with each other to win tokens resulting from solving the new blocks in the chain.
How Ethereum Smart Contracts Work
Smart contracts are programs stored on a blockchain that are executed when predetermined conditions are met. Typically they are used to automate the execution of an agreement. This allows all participants to be immediately certain of the outcome, without the involvement of any third-party intermediary.
To function, smart contracts follow simple "if/when...then..." instructions executed by a computer network when the conditions of the contract have been met and verified. These actions could include releasing funds to the parties involved in the contract, sending notifications or issuing a ticket. The blockchain will update when the transaction is completed, so it cannot be changed and only authorized parties can see the results.
What languages to use to program a Smart Contrct?
The smart contract can be programmed by a developer, although increasingly organizations using blockchain for business are providing templates, web interfaces and other online tools to simplify the development and structure of smart contracts.
There are multiple programming languages for writing a smart contract first and foremost Solidity. It is a high-level object-oriented language designed to run on the Ethereum Virtual Machine (EVM). It is influenced by C++, Python and JavaScript, is statically typed, supports inheritance, libraries and complex user-defined types among other features. With Solidity one can create contracts for managing voting, crowdfunding, blind auctions, and multi-signature wallets.
Other languages currently in vogue for the creation and deployment of smart contracts are Vyper, created on a python basis, Yul and DAML.
Introduction to programming with Solidity
Below is a short code snippet in Solidity that represents a simple smart contract that can be executed on the Ethereum EVM.

Smart Contract Code Snippet in Solidity
Trust in the smart contract can be better established if source code is available. Since making source code available always involves legal issues related to copyright, the Solidity compiler encourages the use of SPDX license identifiers. Each source file should begin with a comment indicating its license, and in our case the defined license is MIT, one of the best-known open-source licenses.
The second line of code in the contract provides the pragma solidity directive that locally to the contract file itself tells the compiler which version of the Solidity compiler is to be used for source code analysis and validation against the keywords used.
Next we find the typical keyword found in many programming languages namely constructor which generically allows us to instantiate and initialize variables that we will need during the execution of our smart contract.
The creator of the smart contract writes the variable message, of our example, the first and only time during the deployment phase of the contract itself. The value contained by message can later be varied through the call to the setMessage function by those who wish to use the contact and exchange information with it.
After the constructor has been executed, the final contract code is stored on the blockchain. This code includes all public and external functions and all functions that are reachable via function calls.
The Future of Digital Contracts
The universe of smart contracts is constantly evolving and with languages like Solidity. Innovation never ceases to surprise us, and the future still promises many breakthroughs in the world of decentralized programming and digital transactions.
Thank you for accompanying us on this adventure into the world of smart contracts and blockchain.
To further explore the world of blockchain, cryptocurrencies and decentralized technologies, feel free to follow us on the Ulixe blog.. You will find updates and insights on these fascinating topics.






