What is a smart contract?
2 people who don't trust each other want to swap something of value.
It could be money, information, files, etc. It's self executing to remove
reliance on honesty, meaning when the conditions are met, the terms of the
agreement are automatically carried out. This contract is permanently
added to the blockchain, and cannot be changed or deleted.
10 Smart contract examples
-
Goverment voting: There have been many examples of voting corruption,
so it would be beneficial to vote on the blockchain to exchange the vote (information) to the record.
This prevents potential cheating by the government.
-
Peer-to-peer transactions. 2 people exchanging cryptocurrencies.
-
Supply chain: Having all the records transparently on the blockchain improves transparency,
because not all the parties may trust each other. Also, efficiencies in everyone being able to access
the records of what's happening. e.g where the product is.
-
Trading When an organisation trades in the financial markets on behalf of investors. Transparency
is very important here. The past is full of ponzi schemes, and hiding financial failings.
-
Lending Peer-to-peer lending of currency or assets.
-
Ownership/Tokenization Crypto tokens can be made to represent ownership of something.
You may of heard of NFTs which are 'Non Fungible Tokens'. Ths means a unique token connected to ownership of
an artwork for example.
-
Insurance Insurance is full of disputes, so smart contracts will dominate insurance in the future.
-
Copyrights Digitial copyright data stored on the blockchain.
-
Escrow Escrow is a legal arrangement in which a third party temporarily holds the money of a sale
until certain condition are met. An example is Flippa.com where websites are sold. Flippa uses to
hold the sale price of the website until the owner has transferred all the files. When it's verified,
the money is released to the seller.
-
Energy Peer-to-peer energy trading is a new idea born from blockchain. People can sell their excess
energy production from solar etc to other people without the middleman of an energy company.
Why use smart contracts?
-
Trust: Automatically carried out. Cannot be changed or deleted.
-
Remove middlemen: This can save time and cost.
-
Security: The blockchain has advanced cryptography to make hacking extremely difficult.
-
Backup: Having the information distributed over 1000's of computers, you don't have risk of
1 single database crashing and losing all the data.
Limitations of smart contracts?
Just because a record is made on the blockchain, it doesn't mean people automatically become honest.
You can't have 1 smart contract to cover your whole business logic, because the computer doesn't know
what people are physically doing. It only understand black and white digital actions like swapping a file etc.
In other words, it should require no human to push an "approve" button, because dishonesty can still occur so you
haven't solved anything. So you need to break it down into many small smart contracts so that the overall business
process is honest.
Why is blockchain so popular before it's even understood?
I believe a big factor is the novelty bias, meaning the perception that something new is better.
Then combine that with FOMO (Fear Of Missing Out). Most of the investment in cryptos that's seen a huge price increase
is speculative - not purely based on fundamental value. The blockchain is very promising, but it doesn't inherently solve
the worlds issues. It's a tool to enhance trustworthiness in everyday transactions, but it requires innovative thinking
to carry it out.
How are smart contracts better than current methods?
PRO: Decentralized, so no one can interfere or add bias to the transaction. An example is an escrow service like Upwork.
For those who aren't familiar, Upwork is a freelancer platform connecting freelancers with employers. Because this is a
centralized business, Upwork makes final decisions if a dispute arises between freelancer and employer.
I remember hiring an SEO marketer who did a terrible job and lied about what they were doing, so didn't actually complete the task.
When I disputed this with Upwork, they had a bias towards the freelancer and paid them despite not actually doing the task.
In theory, a decentralized method is unbiased.
CON: When you use the decentralized method, so there's no other people involved, there's actually no one to "police" the transaction.
A centralized method, like a company, can be beneficial if they're truly fair and don't exploit their power.
Control over information is power, and power tends to corrupt. One of best examples of a business exploiting power is Facebook.
They highly control what users see, punish them, and even influence elections.
How to audit smart contracts?
Since smart contracts cant be edited, the audit is reviewing the smart contract code
before it's published to the blockchain.
You would check:
- The functionality matches intended process.
- It needs to be a closed logic with no open ends.
- Code stability. Testing the code is free of syntax errors.
- Security issues. So vulnerability to sensitive information and interference.
- Gas fee usage. If it has unnecessary steps, it may be wasting transaction fees.
How to read smart contracts?
There are online viewers to read published smart contracts. An ethereum reader is
etherscan.io
Do smart contracts work on different blockchains?
They can, it depends on the language they're written in. For example, 'Glow' is a cross-chain smart contract language.
Cross-chain compatibility is still developing, and will become more widespread in the near future.
Are smart contracts free?
There's no direct cost of the contract itself, but there's a small cost of adding something to the blockchain.
The fee is paid in the cryptocurrency of that blockchain. So Cardano is 'ADA' coin, Etherium is 'ETH' coin.
The small fee pays for the computations. It requires computers, electricity, and many technical people in the background.
The current internet isn't free. There's a saying "if you don't pay for the product, then you are the product".
This means that "free" products like Google and Facebook pay their computational costs by using consumer data for profit -
like running targetted ads based on your data.
Are smart contracts available in all countries?
Yes, it's open to everyone. The whole idea of blockchain is that it's not controlled by big companies or governments.
It would be corrupt of a government to try restrict use of blockchain. That could only be achieving by blocking the
internet itself which would be very extreme. (This happened in Myanmar in 2021)
Can smart contracts be legally enforced?
Not directly. There's no one watching the process to 'police' it. Smart contracts work for very black & white cases of exchanging value.
E.g I'll swap you 0.1 ETH for a file. It's purely computational, and performs the action without either person 'cheating' the deal'.
So person A can't pay 0.1 ETH, then doesn't send the file.
You could however have the smart legally verified before submitting it. So the legality comes from your local laws.
There's no blockchain police or lawyers - that would actually defeat the point.
How can I make money from smart contracts?
You can build your business logic that adds value to customer's life that's made from smart contracts.
You will need to convince the customer why this is better for them with blockchain.
Some people will think it's cool just because it's on blockchain, but generally people don't care unless it directly benefits them.