I have been hyper-focused to get my wife as excited as I am about all that is crypto and DeFi. It’s a long I have been hyper-focused to get my wife as excited as I am about all that is crypto and DeFi. It’s a long haul, but she is indeed coming around. As part of this journey, I’m walking through parts of the ecosystem and reviewing all that makes it up. As a good base of knowledge, I want(ed) her to know the idea of a smart contract, Ethereum, to be exact.
Here is a better explanation of what I’ll do below. If you’d like to continue reading, please do. But beforehand, please remember this: “smart contracts can become scam contracts if written by smart people, and dumb contracts if written by dumb people.”
A smart contract is only a script. That script is immutable. And these immutable scripts exist on the blockchain. The scripts store data. And the scripts have functions that can be called.
You can interact with these immutable scripts that store data on the blockchain by calling a function that’s read-only. These read-only functions can be called on any Ethereum node to ‘do something’ with the data.
If you wanted to do anything beyond read the data, perhaps modify it, you can. To do that you must send a transaction and pay gas fees.
Smart contracts are (mostly) immutable. After the contract is deployed, the code cannot be changed beyond a few exceptions:
- The code can be written to destroy itself by calling a destructor function. Becoming invalid.
- The code can be ‘upgraded’ and modular in so far a new one can point to the old contract but with new functionality.
It’s important to understand that smart contracts may not be smart at all. The code can be poorly written. Smart contracts could have admins on the back end of them. There is also malicious code out there that can wreck them.
Lastly, smart contracts don’t understand what’s happening outside in the big blue world, and they don’t know you arrived at your destination or if your wire transfer went through. There is something called an Oracle that are trusted sources that update the blockchain’s state based on things happening outside the blockchain.