Want to keep learning?

This content is taken from the EIT InnoEnergy & EIT Digital's online course, Blockchain in the Energy Sector. Join the course to learn more.

Skip to 0 minutes and 12 seconds The true leap that blockchain made towards the consolidation as a disruptive force capable of affecting the world on a multi-sectorial level, was brought by the smart contracts. But what is a smart contract? It came with the realization that a decentralized ledger able to serve as platform for trading electronic cash, could perfectly be used for other kinds of data, like complex programs or non-financial records. Smart contracts are pieces of code that can be stored in a blockchain, performing complex operations. It’s software with the ability of self-executing when one or many conditions are matched.

Skip to 0 minutes and 46 seconds Smart contract is a term used to describe a computer program that is capable of facilitating, executing, and enforcing the negotiation or performance of an agreement, using blockchain technology. The entire process is automated and can act as a complement, or substitute, for legal contracts, where the terms of the contract are recorded in lines of code, as a set of instructions. For better understanding of the concept, see quoted the example that Vitalik Buterin, creator of Ethereum, used to describe the concept.

Skip to 1 minute and 17 seconds “Suppose you rent an apartment from me. You can do this through the blockchain by paying in crypto-currency. You get a receipt which is held in our virtual contract; I give you the digital entry key which comes to you by a specified date. If the key doesn’t come on time, the blockchain releases a refund. If I send the key before the rental date, the function holds it releasing both the fee and key to you and me respectively when the date arrives. The system works on the If-Then premise and is witnessed by hundreds of people, so you can expect a faultless delivery. If I give you the key, I’m sure to be paid. If you send a certain amount in Bitcoin, you receive the key. The document is automatically canceled after the time, and the code cannot be interfered by either of us without the other knowing, since all participants are simultaneously alerted.”

Skip to 2 minutes and 9 seconds But how do they really work? What are the steps to follow for effectively design a smart contract and publish it on the blockchain so it can start carrying out its functions?

Skip to 2 minutes and 20 seconds The process to be followed is the next: In first place, the contract has to be coded. The programmer has to define the outcome that will be triggered once the contract is executed, and more importantly, what conditions have to be matched in order for this to happen.

Skip to 2 minutes and 35 seconds In the previous example: IF the contract receives enough funds THEN the key to the apartment will be sent to the buyer. In second place, it has to be deployed to the distributed ledger. Once the contract is effectively published, it will be allocated in the public ledger, where it’ll be accessible for all the users of the system. Therefore, it will be ready to start sending/receiving funds. Finally, following the rules of blockchain, once the contract has been published, every execution will cause every node in the system to achieve an individual agreement of its results. The network will then be updated with a record of the results of that execution.

Skip to 3 minutes and 14 seconds These results will be written and stored in the blockchain, and from that moment single party manipulation will be impossible. All centralized systems are susceptible to be decentralized through the usage of smart contracts. Loans provided by banks, title registries, voting systems, regulatory compliance, and royalties for artists… Virtually anything that requires of a strong security, identification and privacy can be optimized by transitioning to a platform that uses smart contracts.

Skip to 3 minutes and 46 seconds Smart contracts have been used in: The energy sector, to issue payments between prosumers and consumers in ecosystems where the first ones sell their excess of energy to the second group. Peer-to-peer have a tremendous potential in decentralizing the energy sector, empowering the consumers and opening the market for competition. Insurances, cutting down administrative costs and reducing the time needed to issue the payment. Also the usage of smart contracts allows to link the software to databases and sensors measuring parameters such as wind speed or magnitude of earthquakes, data that is recorded in the blockchain and triggers the outcome of the smart contract when surpassing the determined threshold.

Skip to 4 minutes and 28 seconds Patents and copyright, A smart contract proving the ownership over something secured with copyright, like a song in the music industry, would ensure that the holder receives the royalty fee every time the content is used for commercial purposes. This is also used to secure ownership over real state. Internet of Things, In an era where everything goes towards a global interconnectivity, smart contracts are a key enabler for it. Each contract can call out data for multiple databases, and trigger if needed, the execution of other multiple contracts. Entire processes can be structured through a succession of smart contracts.

Skip to 5 minutes and 3 seconds For example, keeping track of a package that has been sent, each sensor forms its own node on a blockchain and smart contracts can record “possession” of the device to each individual sensor, and subsequent location. A barcode / NFC chip / other tracking device on the package will be read at each sensor on the way to your house. Each time it is read by a new sensor, its location is broadcasted to and agreed on by all the IoT participants on the blockchain. As each recording of the package’s location is encrypted into the blockchain in a specific order, there is no securer system for tracking packages.

Skip to 5 minutes and 39 seconds A smart contract then keeps tabs of “possession” all the way along the line, solidifying the trust of exactly where to find the package. The tremendous potential motivated that countless smart contracts started getting published in different ecosystems, most of them using different protocols and certainly different cryptocurrencies. In addition, they were written in different programming languages, creating a non-uniformous mass. The sector was calling for unification.

Smart contracts

Smart contracts are a great example to understand how blockchain can be used for many other uses than mere economic transactions.

In this video, you will learn what a smart contract is, how it operates, and some of the different applications it has.

A lesson from Grzegorz Bytniewski, FlexiDAO Co-founder, CTO.

Share this video:

This video is from the free online course:

Blockchain in the Energy Sector

EIT InnoEnergy