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
we see that the blockchain system consists of users with wallets containing keys, transactions that are propagated across the network, and miners who produce (through competitive computation) the consensus blockchain, which is the authoritative ledger of all transactions.
11
+
We see that the blockchain system consists of users with wallets containing keys, transactions that are propagated across the network, and miners who produce (through competitive computation) the consensus blockchain, which is the authoritative ledger of all transactions.
8
12
9
13
A blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data (generally represented as a Merkle tree, where data nodes are represented by leaves). The timestamp proves that the transaction data existed when the block was created. Since each block contains information about the previous block, they effectively form a chain (compare linked list data structure), with each additional block linking to the ones before it. Consequently, blockchain transactions are irreversible in that, once they are recorded, the data in any given block cannot be altered retroactively without altering all subsequent blocks.
10
14
11
-
# Category
15
+
##Category
12
16
13
-
## Public Blockchain
17
+
###Public Blockchain
14
18
15
19
A public blockchain has absolutely no access restrictions. Anyone with an Internet connection can send transactions to it as well as become a validator (i.e., participate in the execution of a consensus protocol). Usually, such networks offer economic incentives for those who secure them and utilize some type of a Proof of Stake or Proof of Work algorithm.
16
20
@@ -20,7 +24,7 @@ Some of the largest, most known public blockchains are the bitcoin blockchain an
A consortium blockchain is a type of blockchain that combines elements of both public and private blockchains. In a consortium blockchain, a group of organizations come together to create and operate the blockchain, rather than a single entity. The consortium members jointly manage the blockchain network and are responsible for validating transactions. Consortium blockchains are permissioned, meaning that only certain individuals or organizations are allowed to participate in the network. This allows for greater control over who can access the blockchain and helps to ensure that sensitive information is kept confidential.
26
30
@@ -29,25 +33,25 @@ Consortium blockchains are commonly used in industries where multiple organizati
A private blockchain is permissioned. One cannot join it unless invited by the network administrators. Participant and validator access is restricted. To distinguish between open blockchains and other peer-to-peer decentralized database applications that are not open ad-hoc compute clusters, the terminology Distributed Ledger (DLT) is normally used for private blockchains.
|**Usability**| Currency, Document validations and IoT operations | Finance, supply chain and research work | Supply chain, real estate and asset ownership |
41
-
|**Performance**| Low |Very High | Very High |
45
+
|**Performance**| Low | High| Very High |
42
46
|**Decentralization**| Public | Permissioned | Permissioned |
43
47
|**Transparency / Auditability / Security**| Lack of security | Lack of transparency | Lack of auditability |
An introduction to the consensus mechanism of blockchain.
6
+
7
+
## What is consensus?
4
8
5
9
Blockchain consensus is the process by which all participants in a blockchain network reach agreement on the current state of the network. This agreement is critical for ensuring the security and integrity of the blockchain, as it ensures that all participants have a consistent view of the network and that transactions are properly validated and processed.
6
10
@@ -10,9 +14,9 @@ There are several consensus mechanisms used in different blockchain networks, in
10
14
11
15
In general, the consensus mechanism is a crucial component of any blockchain network, as it determines the security, efficiency, and decentralization of the network. A well-designed consensus mechanism is essential for ensuring the long-term success and viability of the network, and choosing the right consensus mechanism is an important decision for any blockchain project.
12
16
13
-
# Category
17
+
##Category
14
18
15
-
## PoW
19
+
###PoW
16
20
17
21

18
22
@@ -22,21 +26,21 @@ The first node to find a suitable nonce gets the bookkeeping right. After the no
22
26
23
27
Finding a nonce that meets the requirements is very difficult and requires nodes to consume a lot of computing power. With the continuous accumulation of valid blocks, malicious nodes need to consume a huge amount of computing power to overthrow the previous blocks and complete the double-spending attack.
24
28
25
-
Please read [Mining and Consensus](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc) to learn the PoW consensus details.
29
+
Please read [Mining and Consensus](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc) to learn the PoW consensus details.
26
30
27
-
## PoS
31
+
###PoS
28
32
29
-

33
+

30
34
31
35
In the PoS consensus, nodes compete for accounting rights not by computing power but by rights (tokens). PoS also needs to calculate the hash value, but unlike PoW, it does not require continuous violent calculation to find the nonce value.
32
36
33
37
Each node only needs to calculate Hash once in each round of consensus. The more rights and interests it has, the greater the chance of meeting the Hash target and the greater the chance of obtaining bookkeeping rights. PoS is a resource-saving consensus protocol. The rights and interests defined by PeerCoin are not only related to the number of tokens, but also the coin age (Coin Age) is introduced. 100 tokens are held for two days, and the coin age is 200. The greater the chance of account rights.
34
38
35
39
Please read [Proof of stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) to learn more.
36
40
37
-
## DPoS
41
+
###DPoS
38
42
39
-

43
+

40
44
41
45
Delegated Proof-of-Stake (DPoS) aims to address some of the scalability, security, and decentralization issues associated with PoW and PoS while providing a more efficient way to reach consensus on the network.
42
46
@@ -48,17 +52,17 @@ Several nodes with the most votes from holders become the block producing nodes,
48
52
49
53
Please read [DPoS Consensus Algorithm - The Missing White Paper](https://steemit.com/dpos/@dantheman/dpos-consensus-algorithm-this-missing-white-paper) to learn more.
50
54
51
-
## PBFT
55
+
###PBFT
52
56
53
-

57
+

54
58
55
59
PBFT is a Byzantine Fault Tolerance protocol with low algorithm complexity and high practicality in distributed systems. PBFT is mainly used in consortium blockchains. PBFT contains five phases: request, pre-prepare, prepare, commit and reply. The primary node forwards the message sent by the client to the other three nodes. In the case that node 3 is crashed, one message goes through five phases to reach a consensus among these nodes. Finally, these nodes reply to the client to complete a round of consensus. PBFT guarantees nodes maintain a common state and take a consistent action in each round of consensus. PBFT achieves the goal of strong consistency, thus it is an absolute-finality consensus protocol. As mentioned before, EOS takes a combined consensus protocol.
56
60
57
-
Please read [Practical Byzantine Fault Tolerance](https://pmg.csail.mit.edu/papers/osdi99.pdf) to learn more.
61
+
Please read [Practical Byzantine Fault Tolerance](https://pmg.csail.mit.edu/papers/osdi99.pdf) to learn more.
58
62
59
-
## PoH
63
+
###PoH
60
64
61
-

65
+

62
66
63
67
Keeping track of the order of transactions is vital for cryptocurrencies. Bitcoin does this by bundling transactions into blocks with a single timestamp. Each node has to validate these blocks in consensus with other nodes. However, this process results in significant waiting time for nodes to confirm a block across the network. Solana takes a different approach called Proof of History (PoH).
64
68
@@ -72,7 +76,7 @@ PoH is not a consensus mechanism but instead, a way of shortening the time spent
72
76
73
77
Please read [Proof of History: A Clock for Blockchain](https://medium.com/solana-labs/proof-of-history-a-clock-for-blockchain-cf47a61a9274) to learn more.
@@ -82,10 +86,12 @@ Please read [Proof of History: A Clock for Blockchain](https://medium.com/solana
82
86
| Scalability | Good | Good | Good | Bad |
83
87
| Application | Public | Public | Public | Permissioned |
84
88
85
-
Please read [Analysis of the main consensus protocols of blockchain](https://www.sciencedirect.com/science/article/pii/S240595951930164X) to learn the details.
89
+
Please read [Analysis of the main consensus protocols of blockchain](https://www.sciencedirect.com/science/article/pii/S240595951930164X) to learn the details.
90
+
91
+
## References
92
+
93
+
[Analysis of the main consensus protocols of blockchain](https://www.sciencedirect.com/science/article/pii/S240595951930164X)
86
94
87
-
# Reference
95
+
[Proof of History: A Clock for Blockchain](https://medium.com/solana-labs/proof-of-history-a-clock-for-blockchain-cf47a61a9274)
88
96
89
-
-[Analysis of the main consensus protocols of blockchain](https://www.sciencedirect.com/science/article/pii/S240595951930164X)
90
-
-[Proof of History: A Clock for Blockchain](https://medium.com/solana-labs/proof-of-history-a-clock-for-blockchain-cf47a61a9274)
91
-
-[What is solana](https://academy.binance.com/en/articles/what-is-solana-sol)
97
+
[What is solana](https://academy.binance.com/en/articles/what-is-solana-sol)
A transaction refers to a contract, agreement, transfer, or exchange of assets between two or more parties. The asset is typically cash or property. Likewise, a blockchain transaction is nothing but data transmission across the network of computers in a blockchain system.
6
+
7
+
Today’s blockchain networks use two types of transaction models: the UTXO model and the Account/Balance model.
8
+
9
+
**The UTXO model** are almost similar to cash or coins, Bitcoin and many Bitcoin derivatives such as Bitcoin Cash, Zcash, Litecoin, Dogecoin, Dash, and more are UTXO chains.
10
+
11
+
**The Account/Balance model** is similar to a bank account or debit card. Ethereum, EOS, Tron, and Ethereum Classic are account-based chains.
12
+
13
+
In this section, we'll explore what these two types of transaction model are, what's the difference between them and also go through their pros and cons.
The account-based transaction model represents assets as balances within accounts, similar to bank accounts.
6
+
A transaction in the account-based model triggers nodes to decrement the balance of the sender's account and increment the balance of the receiver's account.
7
+
Ethereum uses this transaction model. See more detail of ethereum transaction, please refer to: [Ethereum Transaction](../../ethereum/concepts/transaction.md)
8
+
9
+
## How an ACCOUNT transaction works
10
+
11
+
The account model keeps track of all balances as a global state. This state can be understood as a database of all accounts, private keys, and contract-code controlled along with their current balances of the different assets on the network. Transactions are interpreted by the virtual machine in the network, and make the corresponding state changes to all accounts in the global state.
12
+
13
+

14
+
15
+
To better understand how an UTXO transaction been constructed, imagine Bob wants to pay 3.7 ETH to Alice:
16
+
17
+
1. Check if Bob has enough ETH balance (4.4 ETH) to cover the payment (3.7 ETH).
18
+
19
+
2. Send 3.7 ETH from Bob to Alice.
20
+
21
+
3. Bob's ETH balance subtract payment amount, and set to 4.4 - 3.7 = 0.7 ETH.
22
+
23
+
4. Alice's ETH balance add payment amount, and set to 7.15 + 3.7 = 10.85 ETH.
24
+
25
+
## Transaction fees
26
+
27
+
They are calculated based on the number of computations required to complete the state transition. Ethereum set out to be a world computer. Hence they decided that fees should be based on the number of computational resources consumed rather than storage capacity taken.
28
+
29
+
## Replay attack & Nonce
30
+
31
+
A replay attack is when a payee broadcasts a fraudulent transaction in which they get paid a second time. If the fraudulent transaction were to be successful, the transaction would be executed a second time - it is replayed - and the sender would be charged twice the amount they wanted to transfer.
32
+
33
+
To prevent replay attacks, each transaction in the account model has a nonce attached. A replay attack is when a payee broadcasts a fraudulent transaction in which they get paid a second time. If the fraudulent transaction were to be successful, the transaction would be executed a second time - it is replayed - and the sender would be charged twice the amount they wanted to transfer.
34
+
35
+
To combat this behavior, each account in Ethereum has a public viewable nonce that is incremented by one with each outgoing transaction. This prevents the same transaction being submitted to the network more than once.
36
+
37
+
## References
38
+
39
+
[Comparing the UTXO and Account Model](https://www.horizen.io/academy/utxo-vs-account-model/#comparing-the-utxo-and-account-model)
0 commit comments