What are Smart Contracts in Crypto? (4 Examples + Animated)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever heard of kickstarter it's where when you have an idea but you don't have the money you basically make a page and show off your idea in hopes that other people donate to your project for example i might have an idea for a book that explains cryptocurrency ideas and concepts well i'd create a page and say that i have a goal of getting one thousand dollars in donations in turn for people donating i'll give out a book to everyone who donates at least ten dollars so i run the campaign and it takes around a week and i come up with thirteen hundred dollars in donations kickstarter will hold that money for me and since i reached my goal of one thousand dollars it'll give me all of the money that has been donated however if i didn't reach the one thousand dollar goal because for example my grandma didn't donate or something then i wouldn't get anything and all that money would be returned to the people that donated it a smart contract is exactly like this it's a piece of code that does something if something else happens a lot of people call it if this then that the most common smart contracts are written on the ethereum network using something called solidity so let's go over some examples of purposes of smart contracts you could write a piece of code that says if you give me five ethereum in turn i will give you 20 basic attention tokens if you have at least 100 000 subscribers by the end of the year 20 ethereum will be added to your account and if the temperature is over 95 degrees for more than four days in a row this year farmer john's account will receive 100 000 as crop insurance now it would be really easy to write a smart contract where people could donate ethereum to a certain address and then if that contract address reached a certain point maybe say 500 ethereum then we could give each donor a portion of an online work such as an artistic nft or access to read an online book or even join a community the purposes of smart contracts are endless but when it comes to smart contracts there are two main things that you need to know that makes them beneficial to everyone number one they are immutable this means they cannot change so you remember how i said some people call them if this than that it's because most smart contracts do something when they get triggered they are basically just code on the blockchain that gets ran and once it's on the blockchain it can never be changed now the downside of this you might be thinking is that if there is a bug or the code is inefficient it will be a bug and it will be inefficient forever however if you wanted to you could just create a new smart contract and tell people not to use the old one in fact this happens very often the second thing you need to know is that they are distributed this means there's no discrepancies you can't hire a lawyer and be like that wasn't our agreement these smart contracts are an agreement between a few parties online that can be automatically executed if certain conditions are met smart contracts are a piece of code designed to remove human error and issues in fact you couldn't hire a lawyer even if you wanted to the code is on a bunch of computers around the world in fact anyone if they wanted to could see your smart contract and how you participated with it so now we have financial agreements that nobody can argue because they are code they don't change and everybody has access to them now you might not understand what the power of technology like this is but to help you get the hang of it let's go over some examples number one a flash loan what if i told you that you could borrow 10 million dollars with no money down well on the ethereum network you absolutely can but only if you write a smart contract that pays it back in the exact same minute that it is borrowed that's right you can borrow millions of dollars to do something for you on the ethereum network if you know how to code it so here's the catch all of the money must be paid back so you may be wondering why would we want to do this well imagine you could buy some dogecoin for 50 cents on coinbase and then sell it for 55 cents on gemini you could theoretically borrow 10 million dollars and buy a whole bunch of dogecoin on coinbase and then sell it to gemini and then pay back the original loan of 10 million dollars with some interest this is called a flash loan and some guy made 360 000 in a few minutes by creating one of these that did pretty much the example that i just described here's the kicker the smart contract can check itself it can run a simulation of what you programmed and it can see if what you told it to do would actually be able to pay back the lender after it does the code and if it can do that if it can immediately pay back the lender it runs the code and you can borrow those funds to do whatever you want to do you could never do this with traditional finance but you can on the blockchain next up we have number two which is insurance did you know you can create an entire insurance company with just a few smart contracts we would just write something simple like this if farmer john gives us two thousand dollars and if it is more than 95 degrees for four days in a row in missouri pay farmer john ten thousand dollars so this is basically insurance farmer john can be sure that if his crops die from a heat wave the smart contract will know that it happened due to temperature changes and pay him out his 100 000 insurance now you might be asking how the heck does a smart contract a piece of code know what the temperature in missouri is well with the help of something called oracles so oracles are helpful tools to any smart contract essentially they are a trusted source that gives real-world information to anything on the blockchain that requests it now oracles can get confusing so we'll leave those for another video you just need to know they send real world data to a smart contract now another question you might be wondering is where does the initial one hundred thousand dollars come from well you'd have to imagine that investors who wanted to start that insurance company would have to pool their money together to be able to front it in fact they would have to lock it up in that smart contract whenever farmer john buys it they cannot do anything with those funds until the end of the summer because at that moment the smart contract owns that money then at the end of the summer if the insurance has not been paid out to farmer john the initial investment of one hundred thousand dollars plus farmer john's two thousand dollar premium get paid back to the investors now insurance could be and probably is going to be a very profitable use of smart contracts number three we have token switching so when it comes to smart contracts one of the most useful things that you can do is create a pool of money with two different tokens you write smart contracts to allow traders to switch out one token for another token and as one increases in volume you increase the price of the other token this way you keep steady value in the pool this is roughly how a decentralized exchange works and if you're curious what that is you can check out our recent video on something called uniswap that video explains it beautifully you can write a smart contract that says if you give me 20 apples i'll give you 30 coconuts except the apples and coconuts are ethereum and basic attention token so a smart contract can allow you to switch tokens token switching opens up a whole new world for day traders or investors that want to get into a specific coin that isn't currently on a major exchange like coinbase instead they could buy a coin that is available and then use the decentralized exchange to swap those tokens and lastly our last example of a useful reason to have a smart contract is to buy a house so if you haven't already you should watch our videos on nfts because you need to understand those and their purpose to get this example so imagine you took the house or the apartment that you're living in and you took the deed and you put it on the blockchain it's not owned by you anymore or the bank in fact it's owned by whoever has the deed on the blockchain there might be a day where we can use a smart contract to buy and sell a house instead of going through the usual process that takes weeks you know advertising the house securing the funding using escrow getting insurance and the dreaded closing you could just send an offer right on the blockchain and within minutes the other person can accept or deny if they accept you immediately own the new deed but the other person immediately has your payment now this would be very useful for anyone wanting to get into the real estate market but are stopped by the high fees or even banks who want to have a higher profit margin on their mortgages imagine if you could buy and sell a house as quickly and easily as you can buy and sell a stock with blockchain that would be possible so as we end this video we hope that you've learned something valuable from it and if you have consider leaving a like to reward our hard work and possibly subscribing to see more awesome cryptocurrency and decentralized finance explainer videos like this thank you guys so much for watching and we hope to see you in the next video
Info
Channel: Whiteboard Crypto
Views: 521,785
Rating: undefined out of 5
Keywords:
Id: pyaIppMhuic
Channel Id: undefined
Length: 8min 9sec (489 seconds)
Published: Sun May 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.