MultiversX Tracker is Live!

No one seems to actually know what a smart contract is, yet are trying to explain them. Here's the actual explanation of what they are.

All Cryptocurrencies

by COINS NEWS 227 Views

Smart contracts do not ensure payments went through, and they do not create decentralized casinos or banks. In fact, they offer no guarantees about decentralization whatsoever.

They CAN be used for these things, but what they really are is much simpler.

Smart contracts are immutable scripts that exist on the blockchain. They maintain a state (i.e. they store data) and they have functions that can be called. That's it.

The only way to interact with a smart contract is to call one of its functions. There are read-only functions that can be called on any Ethereum node to read some data out of the contract, and then there are functions you can call that modify data in some way, but those require sending a transaction and paying gas.

You can use this functionality to do many things, but it is important to note that they do NOT ensure anything. You can write backdoors into smart contracts. Smart contracts can have admins that have the ability to yoink all the funds out of it. There are categories of bugs that allow a malicious smart contract to attack other smart contracts if they can get that contract to call one of their functions.

Like all code, smart contracts can be written poorly or well. The guarantees come from the implementation, not the nature of smart contracts themselves. The same is true for banking software or other non-blockchain apps.

The key difference is that the code for smart contracts is (mostly) immutable. Once they are deployed, the code cannot be changed. However, there are some exceptions to note:

  • Smart contracts can be written so that they are destroyed by calling a destructor function. After that, the contract becomes invalid and can't be interacted with
  • A smart contract can be modular and call other smart contracts. You can "upgrade" one smart contract by deploying a new modular component and pointing the old contract to the new one with updated functionality.

Don't get caught up thinking that smart contracts are some amazing thing that solves all of our problems when it comes to creating safe, verified transactions. They are just code, that's it. People can still write shitty code.

EDIT: As others have pointed out, I'm speaking specifically about Ethereum smart contracts. Other blockchains could have smart contracts with different properties, but I imagine they would be mostly similar.

submitted by /u/neomatrix248
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments