5.1 Understanding Smart Contracts - Video Tutorials & Practice Problems
Video duration:
6m
Play a video:
Welcome back. We're now going to talk about smart contracts. Now the key thing about smart contracts, is that it's one of the key technologies that's powering this whole blockchain revolution that people talk about. And in this lesson I'm actually going to dive into smart contracts. So you understand exactly what they are and why they are so relevant. So let's first talk about smart contracts. We go back to two parties let's say the two parties want to actually engage in a contractual obligation whether it's actually to buy a property or they want to actually do some sort of agreement that if somebody does something some sort of payment will be instituted. So these types of situations, usually require having a third party say, for example, if you're selling a house or if you're selling some sort of other property or you need to execute some sort of contract that if something gets done someone will get paid a certain amount. You also need an Escrow. Like you may want to put some payments in Escrow. That's a third party that holds the payment and the payment is only issued when the other person completes that task. So all of these things usually require a third party. These third parties constitute as I mentioned, lawyers, brokers, Escrows. So this third party function in the case of a smart contract is unnecessary because that third party is actually replaced with a smart contract. And this is a smart contract that both parties can agree upon and work. This specific smart contract eliminates that third party and is written in computer code. Now the entire agreement of what needs to get done needs to be programmed into a smart contract. And that smart contract will run autonomously and make sure that every single element that's written into that contract is followed along. And then upon successfully achieved some sort of payment may be issued or some sort of other smart contract may be triggered. What I'm saying is that a smart contract is a set of business rules. That are built in a way that it's written in computer code and it runs autonomously and both parties are agreeing upon that. You do not need a third party. Now what's important about these smart contracts is that they are front loaded, front loaded means that you need to put everything into the smart contract to take into consideration other things. So for example, what if somebody breaks the contract? Or what if somebody does some sort of thing different from what the contract States. All of these things need to be taken into consideration before you issue the specific smart contract. Because once a smart contract is set in motion, there's no way to stop it because if you stopped it, you render it null and void. You're basically stopping the smart contract from performing. This smart contract needs to run autonomously without any interference from outside, as a result you need to put into account all sorts of things into the contract. Well, what if somebody does not fulfill their obligations? You need to build that in what would happen then, right. What to the funds that instead of sending to an Escrow they're actually being kept in a smart contract. All of these things need to be built into the smart contract. So I state that as being front-loaded. Now to go further let's define a smart contract smart contracts, also known as smart code or smart property are computer protocols that can act as a contract. A smart contract can handle autonomously the enforcement and fulfillment of a contract without needing a third party to oversee that the contract is executed. Okay. So let's define that specifically and talk further into the qualities of a smart contract. When it comes to a smart contract, you need to have two or more parties. And I position the state. What a party is. It doesn't necessarily have to be humans. It could actually be an organization or it can even be other smart contracts. A smart contract is basically a set of rules that can have two or more parties. And those rules need to engage and work with these parties that are in place. These parties as I mentioned, they don't need to be human beings. They could be other smart contracts but these smart contracts require two or more parties. Furthermore, it has to be more than just sending virtual currency. So if I'm going to be sending you Bitcoin then that really doesn't need a smart contract. Bitcoin already does that. But if you build a smart contract that says you will receive X amount of Bitcoin based upon a certain set of steps, then that could be a smart contract because if you achieve a certain task or if you deliver something then, the issuance of Bitcoin will happen. That could be a smart contract. The entire process needs to be automated. That is you need to be able to hand over the control of it to the smart contract because this smart contract needs to work autonomously. So this automation component is essential to a smart contract. Additionally, it needs to be disintermediated. There cannot be, and there should be no sort of third party that triggers some sort of action on the smart contract. The smart contract has to have business logic built in to achieve whatever it's programmed to do autonomously that is without the services of a third party this intermediated, and it needs to be immutable. Every single step of that smart contract will be recorded on blockchain. And as a result, the stuff will be permanent and immutable. And finally it needs to be trustless. You need to know that once that smart contract is activated you do not need any type of third party interaction to ensure that that contract happen. The contract owns its trust. It takes care of itself autonomously and performs its actions. So there are many different types of smart contracts but as we build this course, I want to focus on token smart contracts first, because it's going to tee up a lot of lessons we're going to talk about. Now a token smart contract is a type of smart contract which is built on a smart contract platform such as a Ethereum in order to create digital tokens. Now these digital tokens can be exchanged securely over the internet, and we're going to talk about digital tokens and how token smart contracts are used in many business applications as we go into the next lesson.