Consensus Algorithms

--- title: 'Consensus Algorithms' author: 'Hun Im' date: 2024-09-12T13:30:13+09:00 category: ['POSTS'] tags: ['Blockchain'] og_image: "/images/gamer.png" keywords: ['Blockchain'] --- ### Types of Major Consensus Algorithms 1. Proof of Work (PoW) * Description: A method where network participants compete to solve very complex mathematical problems to create blocks. The node that solves the problem first earns the right to add a new block. * Examples: Bitcoin, Ethereum (pre-2.0). * Pros: High security and operates in a decentralized network without centralized authority. * Cons: Extremely high energy consumption and slow transaction speeds. 2. Proof of Stake (PoS) * Description: A method where nodes obtain the right to create blocks based on the amount of cryptocurrency they hold (stake). The more stake, the higher the chance to add a new block. * Examples: Ethereum (2.0), Cardano, Polkadot. * Pros: Energy efficient and faster block generation compared to PoW. * Cons: Potential centralization by nodes with large stakes. 3. Delegated Proof of Stake (DPoS) * Description: Users elect a set number of delegates who are responsible for creating blocks. These representatives are chosen by network participants through voting, and they perform block verification and generation tasks. * Examples: EOS, Tron, Steem. * Pros: Faster transaction speeds than PoS and energy efficiency. * Cons: Risk of centralization due to reliance on a small number of elected nodes. 4. Proof of Authority (PoA) * Description: A small, trusted group of validators are responsible for creating blocks. These validators must be verified as trustworthy within the network and are responsible for adding blocks. * Examples: VeChain, certain private blockchains. * Pros: Very fast and operates efficiently in a trusted environment. * Cons: High likelihood of centralization and reliance on a small group of validators. 5. Delayed Proof of Work (dPoW) * Description: Provides an additional security layer by using the hash power of an existing PoW blockchain to secure a secondary chain. The secondary chain leverages the security of the primary PoW chain. * Example: Komodo. * Pros: Utilizes the security of existing PoW blockchains while increasing efficiency. * Cons: Dependency on an existing PoW chain. 6. Byzantine Fault Tolerance (BFT) * Description: A method to address the Byzantine Generals Problem, allowing the system to continue functioning correctly even if some nodes act maliciously or fail to respond. * Examples: Hyperledger, Tendermint. * Pros: Provides high security and ensures reliable outcomes even with untrustworthy nodes. * Cons: More complex than PoW or PoS and may slow down as the network grows. 7. Practical Byzantine Fault Tolerance (PBFT) * Example: Hyperledger Fabric. * Features: Requires more than half of the network nodes to reach the same state for consensus. 8. QBFT (Quorum-based Byzantine Fault Tolerance) * Description: QBFT is a consensus algorithm in the BFT family that requires the approval of more than half of the nodes in the network to reach consensus. Developed to maintain both security and efficiency while tolerating Byzantine faults, it is an evolution of the PBFT algorithm. * Example: Used in Hyperledger Besu, it is known to be well-suited for enterprise blockchains. * Pros: Even if malicious nodes are present, the network can securely reach consensus as long as there is a majority of trustworthy nodes. It also does not consume as much energy as PoW and can process transactions quickly. * Cons: As the network size grows, communication costs for consensus increase, which may degrade performance. The larger the number of nodes, the slower the network becomes. QBFT is primarily used in enterprise blockchain environments, where it balances Byzantine fault tolerance with performance and scalability. 9. Hybrid Consensus Algorithm * Example: Decred. * Features: Combines two or more consensus algorithms to maximize stability and efficiency. 10. Raft Algorithm * Description: Raft operates as a leader-based consensus algorithm in distributed systems to maintain consistency across multiple nodes. The leader handles client requests and replicates logs to follower nodes to maintain consistency. If the leader fails, a new leader is elected through voting. * Examples: Etcd, Consul. * Pros: Simple structure, easy to understand and implement, and fast, stable leader election and log replication. * Cons: Since the structure relies on the leader, frequent leader changes may degrade performance, and recovery time is needed if the leader fails. 11. Tendermint: * Example: Cosmos. * Features: A BFT-based algorithm that achieves fast and stable consensus. Often combined with PoS for use. ### Other Consensus Algorithms * Federated Byzantine Agreement (FBA): Used by Ripple and Stellar. * Leased Proof of Stake (LPoS): Used by Waves. * Proof of Burn (PoB): A method where a certain amount of cryptocurrency is burned to gain the right to create blocks.
Β 
--- title: 'ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜' author: 'μž„ν›ˆ' date: 2024-09-12T13:30:13+09:00 category: ['POSTS'] tags: ['Blockchain'] og_image: "/images/gamer.png" keywords: ['Blockchain'] --- ### μ£Όμš” ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜ μ’…λ₯˜ 1. μž‘μ—… 증λͺ… (Proof of Work, PoW) * λ„€νŠΈμ›Œν¬ μ°Έμ—¬μžλ“€μ΄ 맀우 λ³΅μž‘ν•œ μˆ˜ν•™μ  문제λ₯Ό ν•΄κ²°ν•˜λŠ” κ²½μŸμ„ 톡해 블둝을 μƒμ„±ν•˜λŠ” λ°©μ‹μž…λ‹ˆλ‹€. 이 문제λ₯Ό λ¨Όμ € ν•΄κ²°ν•œ λ…Έλ“œκ°€ μƒˆλ‘œμš΄ 블둝을 μΆ”κ°€ν•  ꢌ리λ₯Ό μ–»κ²Œ λ©λ‹ˆλ‹€. * μ˜ˆμ‹œ: λΉ„νŠΈμ½”μΈ, 이더리움(2.0 이전). * μž₯점: λ³΄μ•ˆμ„±μ΄ λ†’κ³ , μ€‘μ•™ν™”λœ κΆŒν•œ 없이 νƒˆμ€‘μ•™ν™”λœ λ„€νŠΈμ›Œν¬μ—μ„œ λ™μž‘ κ°€λŠ₯. * 단점: μ—λ„ˆμ§€ μ†Œλͺ¨κ°€ 맀우 크고, 처리 속도가 느릴 수 있음. 2. μ§€λΆ„ 증λͺ… (Proof of Stake, PoS) * μ„€λͺ…: λ…Έλ“œκ°€ λ³΄μœ ν•œ μ•”ν˜Έν™”νμ˜ μ–‘(μ§€λΆ„)에 따라 블둝 생성 κΆŒν•œμ„ μ–»λŠ” λ°©μ‹μž…λ‹ˆλ‹€. 지뢄이 λ§Žμ„μˆ˜λ‘ μƒˆλ‘œμš΄ 블둝을 μΆ”κ°€ν•  ν™•λ₯ μ΄ λ†’μ•„μ§‘λ‹ˆλ‹€. * μ˜ˆμ‹œ: 이더리움(2.0), μΉ΄λ₯΄λ‹€λ…Έ(Cardano), 폴카닷(Polkadot). * μž₯점: μ—λ„ˆμ§€ 효율이 λ†’κ³ , PoW에 λΉ„ν•΄ 블둝 생성 속도가 빠름. * 단점: 지뢄이 λ§Žμ€ λ…Έλ“œμ— μ˜ν•œ 쀑앙화 κ°€λŠ₯μ„±. 3. μœ„μž„ μ§€λΆ„ 증λͺ… (Delegated Proof of Stake, DPoS) * μ„€λͺ…: μ‚¬μš©μžκ°€ 일정 수의 λŒ€ν‘œμžλ₯Ό μ„ μΆœν•˜κ³ , 이 λŒ€ν‘œμžλ“€μ΄ 블둝을 μƒμ„±ν•˜λŠ” λ°©μ‹μž…λ‹ˆλ‹€. λŒ€ν‘œμžλŠ” λ„€νŠΈμ›Œν¬ μ°Έμ—¬μžλ“€μ˜ νˆ¬ν‘œμ— μ˜ν•΄ μ„ μ •λ˜λ©°, 이듀이 블둝 검증과 생성 μž‘μ—…μ„ μˆ˜ν–‰ν•©λ‹ˆλ‹€. * μ˜ˆμ‹œ: EOS, 트둠(Tron), μŠ€νŒ€(Steem). * μž₯점: PoS에 λΉ„ν•΄ 더 λΉ λ₯Έ 처리 속도λ₯Ό μ œκ³΅ν•˜λ©°, μ—λ„ˆμ§€ 효율이 μ’‹μŒ. * 단점: μ„ μΆœλœ μ†Œμˆ˜μ˜ λ…Έλ“œμ— μ˜ν•΄ 쀑앙화될 κ°€λŠ₯성이 있음. 4. κΆŒν•œ 증λͺ… (Proof of Authority, PoA) * μ„€λͺ…: μ‹ λ’°ν•  수 μžˆλŠ” μ†Œμˆ˜μ˜ κ²€μ¦μžκ°€ 블둝을 μƒμ„±ν•˜λŠ” λ°©μ‹μž…λ‹ˆλ‹€. κ²€μ¦μžλŠ” λ„€νŠΈμ›Œν¬ λ‚΄μ—μ„œ μ‹ λ’°ν•  수 μžˆλŠ” 인물둜 인증된 μƒνƒœμ—¬μ•Ό ν•˜λ©°, 이듀이 블둝을 μΆ”κ°€ν•˜λŠ” 역할을 ν•©λ‹ˆλ‹€. * μ˜ˆμ‹œ: VeChain, 일뢀 프라이빗 블둝체인. * μž₯점: 맀우 λΉ λ₯΄κ³ , μ‹ λ’°ν•  수 μžˆλŠ” ν™˜κ²½μ—μ„œ 효율적으둜 λ™μž‘. * 단점: μ€‘μ•™ν™”λ˜μ–΄ μžˆμ„ κ°€λŠ₯성이 λ†’κ³ , μ†Œμˆ˜μ˜ κ²€μ¦μžμ—κ²Œ 의쑴. 5. μ§€μ—°λœ μž‘μ—… 증λͺ… (Delayed Proof of Work, dPoW) * μ„€λͺ…: λΈ”λ‘μ²΄μΈμ˜ λ³΄μ•ˆμ„ κ°•ν™”ν•˜κΈ° μœ„ν•΄ κΈ°μ‘΄ PoW λΈ”λ‘μ²΄μΈμ˜ ν•΄μ‹œλ₯Ό μ‚¬μš©ν•˜μ—¬ μΆ”κ°€ λ³΄μ•ˆ λ ˆμ΄μ–΄λ₯Ό μ œκ³΅ν•˜λŠ” λ°©μ‹μž…λ‹ˆλ‹€. 즉, 보쑰 체인이 μ£Όμš” PoW 체인의 λ³΄μ•ˆμ„ λΉŒλ €μ™€ ν™œμš©ν•˜λŠ” ν˜•νƒœμž…λ‹ˆλ‹€. * μ˜ˆμ‹œ: Komodo. * μž₯점: κΈ°μ‘΄ PoW λΈ”λ‘μ²΄μΈμ˜ λ³΄μ•ˆμ„±μ„ ν™œμš©ν•˜λ©΄μ„œλ„ νš¨μœ¨μ„±μ„ λ†’μž„. * 단점: κΈ°μ‘΄ PoW 체인에 μ˜μ‘΄μ„±μ΄ 있음. 6. λΉ„μž”ν‹΄ μž₯μ•  ν—ˆμš© (Byzantine Fault Tolerance, BFT) * μ„€λͺ…: λΉ„μž”ν‹΄ μž₯κ΅° 문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•œ λ°©μ‹μœΌλ‘œ, λ„€νŠΈμ›Œν¬ λ‚΄ 일뢀 λ…Έλ“œκ°€ μ•…μ˜μ μΈ ν–‰μœ„λ₯Ό ν•˜κ±°λ‚˜ μ‘λ‹΅ν•˜μ§€ μ•ŠλŠ” μƒν™©μ—μ„œλ„ μ‹œμŠ€ν…œμ΄ μ •μƒμ μœΌλ‘œ λ™μž‘ν•  수 있게 ν•©λ‹ˆλ‹€. * μ˜ˆμ‹œ: Hyperledger, Tendermint. * μž₯점: 높은 λ³΄μ•ˆμ„±μ„ μ œκ³΅ν•˜κ³ , λ„€νŠΈμ›Œν¬ λ‚΄μ—μ„œ μ‹ λ’°ν•  수 μ—†λŠ” λ…Έλ“œκ°€ μžˆλ”λΌλ„ μ‹ λ’°ν•  수 μžˆλŠ” κ²°κ³Όλ₯Ό 얻을 수 있음. * 단점: PoWλ‚˜ PoS에 λΉ„ν•΄ λ³΅μž‘ν•˜λ©°, λ„€νŠΈμ›Œν¬κ°€ 컀질수둝 속도가 느렀질 수 있음. 7. μ‹€μš© λΉ„μž”ν‹΄ μž₯μ•  ν—ˆμš© (Practical Byzantine Fault Tolerance, PBFT): * μ‚¬μš© μ˜ˆμ‹œ: Hyperledger Fabric * νŠΉμ§•: λ„€νŠΈμ›Œν¬ λ‚΄μ—μ„œ 과반수 μ΄μƒμ˜ λ…Έλ“œκ°€ λ™μΌν•œ μƒνƒœμ— 도달해야 ν•©μ˜κ°€ 이루어짐. 8. QBFT (Quorum-based Byzantine Fault Tolerance) * μ„€λͺ…: QBFTλŠ” λΉ„μž”ν‹΄ μž₯μ•  ν—ˆμš©(Byzantine Fault Tolerance, BFT) κ³„μ—΄μ˜ ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜ 쀑 ν•˜λ‚˜λ‘œ, λ„€νŠΈμ›Œν¬ λ‚΄μ˜ λ…Έλ“œλ“€μ΄ ν•©μ˜μ— λ„λ‹¬ν•˜κΈ° μœ„ν•΄ 과반수 μ΄μƒμ˜ λ…Έλ“œμ˜ μŠΉμΈμ„ μš”κ΅¬ν•˜λŠ” λ°©μ‹μž…λ‹ˆλ‹€. λΉ„μž”ν‹΄ μž₯μ• λ₯Ό ν—ˆμš©ν•˜λ©΄μ„œλ„ λ„€νŠΈμ›Œν¬μ˜ μ•ˆμ „μ„±κ³Ό νš¨μœ¨μ„±μ„ μœ μ§€ν•˜λ €λŠ” λͺ©μ μ—μ„œ κ°œλ°œλ˜μ—ˆμŠ΅λ‹ˆλ‹€. PBFT(Practical Byzantine Fault Tolerance) μ•Œκ³ λ¦¬μ¦˜μ—μ„œ λ°œμ „λœ ν˜•νƒœμž…λ‹ˆλ‹€. * μ˜ˆμ‹œ: Hyperledger Besuμ—μ„œ μ‚¬μš©λ˜λ©°, 주둜 κΈ°μ—…μš© 블둝체인에 μ ν•©ν•œ μ•Œκ³ λ¦¬μ¦˜μœΌλ‘œ μ•Œλ €μ Έ μžˆμŠ΅λ‹ˆλ‹€. * μž₯점: λ„€νŠΈμ›Œν¬ λ‚΄ μ•…μ˜μ μΈ λ…Έλ“œκ°€ μžˆλ”λΌλ„, 과반수의 μ‹ λ’°ν•  수 μžˆλŠ” λ…Έλ“œκ°€ 있으면 μ•ˆμ „ν•˜κ²Œ ν•©μ˜μ— 도달할 수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ, PoW처럼 μ—λ„ˆμ§€ μ†ŒλΉ„κ°€ 크지 μ•ŠμœΌλ©°, λΉ λ₯Έ νŠΈλžœμž­μ…˜ μ²˜λ¦¬κ°€ κ°€λŠ₯ν•©λ‹ˆλ‹€. * 단점: λ„€νŠΈμ›Œν¬ 규λͺ¨κ°€ 컀질수둝 ν•©μ˜μ— ν•„μš”ν•œ 톡신 λΉ„μš©μ΄ μ¦κ°€ν•˜μ—¬ μ„±λŠ₯이 μ €ν•˜λ  수 μžˆμŠ΅λ‹ˆλ‹€. λ…Έλ“œ μˆ˜κ°€ λ§Žμ•„μ§ˆμˆ˜λ‘ λ„€νŠΈμ›Œν¬μ˜ 처리 속도가 느렀질 수 μžˆμŠ΅λ‹ˆλ‹€. QBFTλŠ” λΉ„μž”ν‹΄ μž₯μ•  ν—ˆμš©μ„ 기반으둜 ν•˜λ©΄μ„œλ„ μ„±λŠ₯κ³Ό ν™•μž₯성을 μœ μ§€ν•˜λ €λŠ” μ•Œκ³ λ¦¬μ¦˜μœΌλ‘œ, 주둜 μ—”ν„°ν”„λΌμ΄μ¦ˆ 블둝체인 ν™˜κ²½μ—μ„œ μ‚¬μš©λ©λ‹ˆλ‹€. 9. ν˜Όν•© ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜ (Hybrid Consensus): * μ‚¬μš© μ˜ˆμ‹œ: Decred * νŠΉμ§•: 두 κ°€μ§€ μ΄μƒμ˜ ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜μ„ κ²°ν•©ν•˜μ—¬ μ•ˆμ •μ„±κ³Ό νš¨μœ¨μ„±μ„ κ·ΉλŒ€ν™”. 10. Raft μ•Œκ³ λ¦¬μ¦˜ * μ„€λͺ…: RaftλŠ” λΆ„μ‚° μ‹œμŠ€ν…œμ—μ„œ μ—¬λŸ¬ λ…Έλ“œκ°€ μΌκ΄€λœ μƒνƒœλ₯Ό μœ μ§€ν•  수 μžˆλ„λ‘ 리더 기반 ꡬ쑰둜 λ™μž‘ν•˜λŠ” ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜μž…λ‹ˆλ‹€. 리더가 ν΄λΌμ΄μ–ΈνŠΈ μš”μ²­μ„ μ²˜λ¦¬ν•˜κ³ , κ·Έ 둜그λ₯Ό νŒ”λ‘œμ›Œ λ…Έλ“œμ— λ³΅μ œν•˜μ—¬ 일관성을 μœ μ§€ν•©λ‹ˆλ‹€. 리더가 μž₯μ• κ°€ λ°œμƒν•˜λ©΄ μƒˆλ‘œμš΄ 리더가 νˆ¬ν‘œλ₯Ό 톡해 μ„ μΆœλ©λ‹ˆλ‹€. * μ˜ˆμ‹œ: Etcd, Consul. * μž₯점: ꡬ쑰가 κ°„λ‹¨ν•˜κ³  μ΄ν•΄ν•˜κΈ° μ‰¬μ›Œ κ΅¬ν˜„μ΄ μš©μ΄ν•˜λ©°, 리더 μ„ μΆœκ³Ό 둜그 λ³΅μ œκ°€ λΉ λ₯΄κ³  μ•ˆμ •μ μž…λ‹ˆλ‹€. * 단점: 리더에 의쑴적인 ꡬ쑰이기 λ•Œλ¬Έμ— 리더가 자주 λ³€κ²½λ˜λ©΄ μ„±λŠ₯이 μ €ν•˜λ  수 있고, 리더 μž₯μ•  μ‹œ 볡ꡬ μ‹œκ°„μ΄ ν•„μš”ν•©λ‹ˆλ‹€. 11. Tendermint: * μ‚¬μš© μ˜ˆμ‹œ: Cosmos * νŠΉμ§•: BFT 기반으둜 λΉ λ₯΄κ³  μ•ˆμ •μ μœΌλ‘œ ν•©μ˜λ₯Ό λ‹¬μ„±ν•˜λŠ” μ•Œκ³ λ¦¬μ¦˜. PoS와 κ²°ν•©ν•˜μ—¬ μ‚¬μš©. ### 기타 ν•©μ˜ μ•Œκ³ λ¦¬μ¦˜ * Federated Byzantine Agreement (FBA): λ¦¬ν”Œ, μŠ€ν…”λΌμ—μ„œ μ‚¬μš©. * Leased Proof of Stake (LPoS): μ›¨μ΄λΈŒ(Waves)μ—μ„œ μ‚¬μš©. * Proof of Burn (PoB): νŠΉμ • μ–‘μ˜ μ•”ν˜Έν™”νλ₯Ό μ†Œκ°ν•˜μ—¬ 블둝 생성 κΆŒν•œμ„ μ–»λŠ” 방식.