You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/smart-contracts/index.md
+15-25Lines changed: 15 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,19 +6,13 @@ lang: en
6
6
7
7
# Introduction to smart contracts {#introduction-to-smart-contracts}
8
8
9
-
Smart contracts are the fundamental building blocks of [Ethereum applications](/dapps/). They are computer programs stored on the blockchain that allow converting traditional contracts into digital parallels. Smart contracts are very logical - following an if this then that structure. This means they behave exactly as programmed and cannot be changed.
9
+
Smart contracts are the fundamental building blocks of Ethereum's application layer. They are computer programs stored on the blockchain that follow "if this then that" logic, and are guaranteed to execute according to the rules defined by its code, which cannot be changed once created.
10
10
11
-
Nick Szabo coined the term "smart contract". In 1994, he wrote [an introduction to the concept](https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html) and, in 1996,[an exploration of what smart contracts could do](https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2.html).
11
+
Nick Szabo coined the term "smart contract". In 1994, he wrote [an introduction to the concept](https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html), and in 1996 he wrote[an exploration of what smart contracts could do](https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart_contracts_2.html).
12
12
13
-
Nick Szabo envisioned a digital marketplace built on these automatic, cryptographicallysecure processes. A place where transactions and business functions can happen trustlessly — without intermediaries. Smart contracts on Ethereum put this vision into practice.
13
+
Szabo envisioned a digital marketplace where automatic, cryptographically-secure processes enable transactions and business functions to happen without trusted intermediaries. Smart contracts on Ethereum put this vision into practice.
14
14
15
-
## What are contracts? {#what-are-contracts}
16
-
17
-
You're probably thinking: _"I'm not a lawyer! Why would I care about contracts?"_. For most people, contracts bring to mind needlessly long terms and conditions agreements or boring legal documents.
18
-
19
-
Contracts are just agreements. That is, any form of agreement can be encapsulated within the conditions of a contract. Verbal agreements or pen-and-paper contracts are acceptable for many things, but they aren't without flaws.
20
-
21
-
### Trust and contracts {#trust-and-contracts}
15
+
### Trust in conventional contracts {#trust-and-contracts}
22
16
23
17
One of the biggest problems with a traditional contract is the need for trusted individuals to follow through with the contract's outcomes.
24
18
@@ -28,47 +22,43 @@ Alice and Bob are having a bicycle race. Let's say Alice bets Bob $10 that she w
28
22
29
23
This silly example illustrates the problem with any non-smart agreement. Even if the conditions of the agreement get met (i.e. you are the winner of the race), you must still trust another person to fulfill the agreement (i.e. payout on the bet).
30
24
31
-
## Smart contracts {#smart-contracts}
32
-
33
-
Smart contracts digitize agreements by turning the terms of an agreement into computer code that automatically executes when the contract terms are met.
34
-
35
25
### A digital vending machine {#vending-machine}
36
26
37
27
A simple metaphor for a smart contract is a vending machine, which works somewhat similarly to a smart contract - specific inputs guarantee predetermined outputs.
38
28
39
29
- You select a product
40
-
- The vending machine returns the amount required to purchase the product
41
-
- You insert the correct amount
42
-
- The vending machine verifies you have inserted the correct amount
43
-
- The vending machine dispenses the product of choice
30
+
- The vending machine displays the price
31
+
- You pay the price
32
+
- The vending machine verifies that you paid the right amount
33
+
- The vending machine gives you your item
44
34
45
35
The vending machine will only dispense your desired product after all requirements are met. If you don't select a product or insert enough money, the vending machine won't give out your product.
46
36
47
37
### Automatic execution {#automation}
48
38
49
-
One of the most significant benefits smart contracts have over regular contracts is that the outcome is automatically executed when the contract conditions are realized. There is no need to wait for a human to execute the result. In other words: smart contracts remove the need for trust.
39
+
The main benefit of a smart contract is that it deterministically executes unambiguous code when certain conditions are met. There is no need to wait for a human to interpret or negotiate the result. This removes the need for trusted intermediaries.
50
40
51
-
For example, you could write a smart contract that holds funds in escrow for a child, allowing them to withdraw funds after a specific date. If they try to withdraw the funds before the specified date, the smart contract won't execute. Or, you could write a contract that automatically gives you a digital version of a car's title when you pay the dealer.
41
+
For example, you could write a smart contract that holds funds in escrow for a child, allowing them to withdraw funds after a specific date. If they try to withdraw before that date, the smart contract won't execute. Or you could write a contract that automatically gives you a digital version of a car's title when you pay the dealer.
52
42
53
43
### Predictable outcomes {#predictability}
54
44
55
-
The human factor is one of the biggest points of failure with traditional contracts. For example, two individual judges may interpret a traditional contract in different ways. Their interpretations could lead to different decisions getting made and disparate outcomes. Smart contracts remove the possibility of different interpretations. Instead, smart contracts execute precisely based on the conditions written within the contract's code. This precision means that given the same circumstances, the smart contract will produce the same result.
45
+
Traditional contracts are ambiguous because they rely on humans to interpret and implement them. For example, two judges might interpret a contract differently, which could lead to inconsistent decisions and unequal outcomes. Smart contracts remove this possibility. Instead, smart contracts execute precisely based on the conditions written within the contract's code. This precision means that given the same circumstances, the smart contract will produce the same result.
56
46
57
47
### Public record {#public-record}
58
48
59
-
Smart contracts are also useful for audits and tracking. Since Ethereum smart contracts are on a public blockchain, anyone can instantly track asset transfers and other related information. You can check to see that someone sent money to your address, for example.
49
+
Smart contracts are useful for audits and tracking. Since Ethereum smart contracts are on a public blockchain, anyone can instantly track asset transfers and other related information. For example, you can check to see that someone sent money to your address.
60
50
61
51
### Privacy protection {#privacy-protection}
62
52
63
-
Smart contracts can also protect your privacy. Since Ethereum is a pseudonymous network (your transactions are tied publicly to a unique cryptographic address, not your identity), you can protect your privacy from observers.
53
+
Smart contracts also protect your privacy. Since Ethereum is a pseudonymous network (your transactions are tied publicly to a unique cryptographic address, not your identity), you can protect your privacy from observers.
64
54
65
55
### Visible terms {#visible-terms}
66
56
67
-
Finally, like contracts, you can check what's in a smart contract before you sign it (or otherwise interact with it). Better yet, public transparency of the terms in the contract means that anyone can scrutinize it.
57
+
Finally, like traditional contracts, you can check what's in a smart contract before you sign it (or otherwise interact with it). A smart contract's transparency guarantees that anyone can scrutinize it.
68
58
69
59
## Smart contract use cases {#use-cases}
70
60
71
-
So, smart contracts are computer programs that live on the blockchain. They can execute automatically. You can track their transactions, predict how they act and even use them pseudonymously. That's cool. But what are they good for? Well, smart contracts can do essentially anything that other computer programs do.
61
+
Smart contracts can do essentially anything that computer programs can do.
72
62
73
63
They can perform computations, create currency, store data, mint NFTs, send communications and even generate graphics. Here are some popular, real-world examples:
0 commit comments