Smart contracts for beginners, explained (in 6 minutes) | Cryptopedia

Jackson Dumont explains smart contracts as code on the blockchain that automatically executes when conditions are met. They're distributed and trustless, but coding errors can cause major hacks, like the 2016 Ethereum hard fork that required a network-wide fix.
Chapters
Smart contracts are code on the blockchain that execute when specific conditions are met. For example, I send bitcoin to the contract and the contract automatically sends me ether. Boom. Simple as that. Of course, that's a very basic example, but what makes smart contracts so innovative are that they are built on blockchain technology. I'm Jackson Dumont, director of video production at Cointelegraph, and I'm here today to give you a concise explanation of of what smart contracts are and how they work. No matter if this is your first time here or you're coming from another video, please consider hitting that like button and subscribing to our channel so we can get one step closer to educating the masses about crypto. You can think of smart contracts as digital if then statements. To reword my earlier example, If I send 10 bitcoin to the contract, then I will receive a price equivalent amount of eth. This is essentially how decentralized exchanges work, like Uniswap or Sushiswap. But let's say I want to make that transaction on a centralized exchange like Binance instead of a decentralized exchange. What's the difference? Well, when you make that transaction on Binance, you have to trust that Binance will complete the transaction. Binance is the middleman or the third party of that transaction. The likelihood of the transaction executing depends on how much you trust Binance. Smart contracts eliminate the need for a middleman because instead of being run on a company server, they're run on a decentralized blockchain network. This increases the likelihood of smart contract executing because the network is not controlled by a single entity. Blockchain networks are instead maintained by anonymous nodes spread out all over the world. This important distinction gives smart contracts seven key features distributed. Each node in a blockchain network stores all the data for the network. You can think of nodes as small servers that are constantly pinging each other to make sure they all have the exact same data. This data includes smart contracts which are replicated and distributed to all nodes in the network. This is the process that guarantees a smart contract on the network will execute. Deterministic. This goes back to the if then property I was talking about earlier. Smart contracts only perform the actions they were designed to. Given the requirements are met, the code gives them rigidity. The outcome will always be the same, no matter who executes them. You could be Darth Vader or Rumpelstiltskin. Smart contract don't care. No matter who interacts with it. The rules and results are the same. Autonomous smart Contracts don't need to be operated. Once they are deployed on the blockchain, they run on their own. Users can interact with the contract and once the conditions of the contract are met, the contract will automatically execute. In most cases though, if a smart contract isn't triggered, it will stay dormant and won't perform any action. Immutable Once smart contracts are deployed, they can't be changed. However, if the creator of the contract includes a function called self destruct in the code, they are able to delete the smart contract in the future and replace it with a new one. However, if the function isn't included in the code beforehand, they won't be able to delete it. Therefore, we can say that smart contracts provide tamper proof code. Customizable smart contracts can be coded in many different ways to create decentralized applications or dapps. The examples we looked at earlier were only the most basic. There are now DApps for investing, gaming, voting, crowdfunding, payments, insurance and much much more. The use of smart contracts are only limited by our own creativity. Trustless if you want to interact with someone else through a smart contract, you don't have to know who they are. You don't even have to trust them. And it doesn't matter because you know that the code and the blockchain technology ensures that the interaction happens and is accurate, transparent. You can see the code for the smart contracts. If the blockchain is public, then the contracts will be too. This makes it much easier to check the safety and security of the contract. This all sounds great, but there are still some drawbacks. Perhaps the biggest issue is still the human element. Code needs to be written by humans and humans make mistakes. We leave vulnerabilities and bugs in the code, often unintentionally, but sometimes intentionally. That can be exploited by hackers and bad actors. When you couple these flaws with immutability, there can be nasty situations involving unchangeable faulty code. One such situation was so disastrous that it caused Ethereum to hard Fork in 2016 because it was the only way to return users their stolen funds. And there is also the question of just how much impact smart contracts will have. Some believe this technology will replace and automate a great part of our commercial and bureaucratic systems. However, critics say that there will be situations where centralized servers are better because they are easier and cheaper to maintain and tend to present a higher efficiency in terms of speed and cross network communication. That being said, smart contracts are already being used by many banks and insurance organizations in their daily operations. The technology is here and being tested in real world scenarios. If the current trend continues, it won't be long until it becomes a part of our everyday lives and routines. If you want an even deeper explanation of smart contracts, check out our Cryptopedia article here. And thanks for sticking with us to the end. If you enjoyed the video, be sure to like it and leave us a comment below. And don't forget to subscribe to our channel. The Cointelegraph Cryptopedia is your guide to the chaotic space of blockchain and cryptocurrencies. Sam.










