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: docs/learn/bitcoin-ethereum-cardano.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,17 +24,17 @@ The contract logic can be summarized as:
24
24
25
25
## Bitcoin
26
26
27
-
Bitcoin is the first ever blockchain, and pioneered the Unspent Transaction Output (UTXO) model.
27
+
Bitcoin pioneered the Unspent Transaction Output (UTXO) model.
28
28
29
-
Bitcoin is notable for not allowing Turingcomplete smart contracts. This means that arbitrary logic cannot be expressed by Bitcoin smart contracts.
29
+
Bitcoin is notable for not allowing Turing-complete smart contracts. This means that arbitrary logic cannot be expressed by Bitcoin smart contracts.
30
30
31
31
Though Bitcoin doesn't support attaching datums to UTXOs, the notion of *state* still exists. The *state* of a Bitcoin smart contract is what value sits at which addresses at any given time (ie. the valid set of UTXOs).
32
32
33
33
Bitcoin transactions evolve the *state* of a Bitcoin smart contract.
34
34
35
35
If all possible states of a Bitcoin smart contract are known in advance, then all possible transactions can be created in advance as well, and pre-signed by the contract parties.
36
36
37
-
Which transactions are valid depends on the logic of each address. Bitcoin script logic typically consists of:
37
+
Which transactions are valid depends on the script logic of each address. Bitcoin script logic typically consists of:
38
38
39
39
- Relative or absolute time-locks
40
40
- Required signatures
@@ -59,7 +59,7 @@ If the year passes, Bob can submit the 2nd redeeming transaction.
59
59
60
60
## Ethereum
61
61
62
-
Ethereum came after Bitcoin and is the first blockchain with a Turingcomplete on-chain runtime environment, called the Ethereum Virtual Machine (EVM).
62
+
Ethereum came after Bitcoin and is the first blockchain with a Turing-complete on-chain runtime environment, called the Ethereum Virtual Machine (EVM).
63
63
64
64
EVM smart contracts are simpler than (E)UTXO smart contracts, because *state* mutations are performed directly, instead of perfoming validation and transaction building as two separate processes.
65
65
@@ -83,13 +83,13 @@ The `cancel` function takes Charlie's signature as an argument. If the signature
83
83
84
84
The `redeem` function doesn't take any arguments, and checks that one year has passed and that `tx.origin` is equal to Bob's address. The tokens will then be withdrawn to Bob's address.
85
85
86
-
> Note: the ERC-20 `withdraw` function only allows withdrawals from the `msg.sender` address, which corresponds to address of the vesting contract.
86
+
> Note: the ERC-20 `withdraw` function only allows withdrawals from the `msg.sender` address, which corresponds to the address of the vesting contract.
87
87
88
88
## Cardano
89
89
90
90
Cardano uses the EUTXO model and is similar to Bitcoin. But Cardano's EUTXO model isn't a superset of Bitcoin's UTXO model because it doesn't support unlock scripts and misses relative time-locks.
91
91
92
-
Cardano does however allow creating Turingcomplete lock scripts called *validators*. This means that the unlock logic can be part of the validator, and can be triggered depending on which redeemer arguments are passed in when spending UTXOs.
92
+
Cardano does however allow creating Turing-complete lock scripts called *validators*. This means that the unlock logic can be part of the validator, and can be triggered depending on which redeemer arguments are passed in when spending UTXOs.
93
93
94
94
Pre-creating and signing all possible transactions, though offering better privacy, is inconvenient. It is much easier to use Cardano's EUTXO model, which allows Alice to send the tokens directly to an appropriate validator.
95
95
@@ -103,7 +103,7 @@ The Helios implementation of the basic vesting contract:
103
103
```helios
104
104
spending vesting
105
105
106
-
import { get_current_input, tx } from ScriptContext
0 commit comments