‘마스터링 이더리움’ 세미나 12 14장. 합의

이번 세미나는 마지막 세미나로 ’14장. 합의’와 “부록”을 다룹니다.

 

블록체인은 합의 메커니즘을 사용해서 신뢰할 수 있는 중앙기관 없이도(탈중앙화) 진실에 대한 기록과 검증을 가능하도록 합니다.

P2P 네트워크는 탈중앙화를 구현하는 대표적인 아키텍처입니다. 블록체인의 구조와 기능은 P2P 네트워크가 가지는 근본적인 특징들로 인해 발생하는 문제들을 해결하기 위한 것입니다. 합의 메커니즘은 그러한 것들 중 가장 핵심적인 것입니다.

P2P 네트워크가 가지는 근본적인 특징들은 무엇이고 이로 인해 발생할 수 있는 문제들로 어떤 것들이 있을지 고심해 보고 논의해 봅니다. 블록체인의 주요 구성요소와 기능들을 열거해 보고 이것들을 P2P 네트워크가 해결해야 할 문제점들과 매핑해 봅니다.

 

시작 부분의 본문은 짧지만 합의에 대해 매우 깊이 있는 이야기를 하고 있습니다. 아래 인용한 원문을 여러 번 반복해서 읽어 봅니다.

  • Throughout this book we have talked about “consensus rules”—the rules that everyone must agree to for the system to operate in a decentralized, yet deterministic, manner. In computer science, the term consensus predates blockchains and is related to the broader problem of synchronizing state in distributed systems, such that different participants in a distributed system all (eventually) agree on a single system-wide state. This is called “reaching consensus.”
  • When it comes to the core function of decentralized record keeping and verification, it can become problematic to rely on trust alone to ensure that information derived from state updates is correct. This rather general challenge is particularly pronounced in decentralized networks because there is no central entity to decide what is true. The lack of a central decision-making entity is one of the main attractions of blockchain platforms, because of the resulting capacity to resist censorship and the lack of dependence on authority for permission to access information. However, these benefits come at a cost: without a trusted arbitrator, any disagreements, deceptions, or differences need to be reconciled using other means. Consensus algorithms are the mechanism used to reconcile security and decentralization.
  • In blockchains, consensus is a critical property of the system. Simply put, there is money at stake! So, in the context of blockchains, consensus is about being able to arrive at a common state, while maintaining decentralization. In other words, consensus is intended to produce a system of strict rules without rulers. There is no one person, organization, or group “in charge”; rather, power and control are diffused across a broad network of participants, whose self-interest is served by following the rules and behaving honestly.
  • The ability to come to consensus across a distributed network, under adversarial conditions, without centralizing control is the core principle of all open public blockchains. To address this challenge and maintain the valued property of decentralization, the community continues to experiment with different models of consensus. This chapter explores these consensus models and their expected impact on smart contract blockchains such as Ethereum.
  • The real purpose of mining (and all other consensus models) is to secure the blockchain, while keeping control over the system decentralized and diffused across as many participants as possible. PoW consensus is a careful balance of risk and reward that drives participants to behave honestly out of self-interest.
  • The major difference between PoS and PoW is that the punishment in PoS is intrinsic to the blockchain (e.g., loss of staked ether), whereas in PoW the punishment is extrinsic (e.g., loss of funds spent on electricity).
  • The principles and assumptions of consensus algorithms can be more clearly understood by asking a few key questions:
    • Who can change the past, and how? (This is also known as immutability.)
    • Who can change the future, and how? (This is also known as finality.)
    • What is the cost to make such changes?
    • How decentralized is the power to make such changes?
    • Who will know if something has changed, and how will they know?

부록 A. 이더리움 포크의 역사

비트코인에서 넘어오신 분들은 하드 포크 하면 새로운 블록체인이 생겨난다고 단정지어 말하시는 분들이 있는데, 이는 하드포크에 대해서 잘 못 알고 있는 것입니다. 소프트 포크와 하드 포크의 차이는 하위 호환성이 있는 업그레이드냐 아니냐의 차이일 뿐입니다. 하드 포크가 일어나도 네트워크 구성원들 사이에 합의가 원활히 이루어져 소프트웨어 업그레이드가 트러블 없이 이루어지면 새로운 블록체인이 생겨나지 않습니다.

비트코인은 의도적인 하드 포크가 거의 일어나지 않지만 이더리움에서는 업그레이드 로드맵의 일부로 계획되어 의도적인 하드 포크가 자주 일어 납니다.

이더리움 클래식은 의도치 않은 계획되지 않은 하드 포크로 구성원들 사이에 합의가 원활히 이루어지지 않아 발생한 블록체인 입니다.

하드 포크가 일어나는 또 다른 경우는 기존의 블록체인의 목표와 다른 목표를 가지고 소프트웨어를 업그레이드하고 별도의 네트워크를 구성하는 것입니다.  이건 기존의 블록체인 구성원들과 합의해서 하는 것이 아니라 그냥 자기들끼리 하는 것이니 논쟁이나 트러블이 없습니다. ‘블록 높이 몇 번째에서 하드포크했다’ 정도만 언급해 주면 됩니다. 이렇게 하는 이유는 대부분 기존 네트워크 참여자들을 쉽게 유입하려는 전략  때문입니다.

 

부록 B. 이더리움 표준

이더리움 개선은 EIP라는 이더리움 개선 제안(Ethereum Improvement Proposal)에 의해 이루어집니다. EIP는 기능의 간결한 기수 사양과 기능의 이론적 근거를 제공해야 하고, EIP 저자는 커뮤니티내에서 합의를 구축하고 반대 의견을 문서화할 책임이 있습니다.

 

부록 C. 이더리움 EVM 연산코드와 가스 소비량표준

 

부록 D. 개발 도구, 프레임워크, 라이브러리

필수적인 개발 도구인 트러플에 대해서는 “이더리움 댑 개발” 세미나에서 자세하게 다룹니다.

오픈제플린은 재사용 가능한 안전한 스마트 컨트랙트 라이브러리라고 생각하면 됩니다. 댑 개발자라면 오픈제플린 소스를 가지고 스마트 컨트랙트를 학습하시길 추천합니다. 스마트 컨트랙트로 뭘 작성해야 한다면 직접 작성하지 말고 오픈 제플린에 참고할 수 있는 것이 있는지 먼저 찾아보시기 바랍니다.

 

유용한 라이브러리

 

로컬 테스트 블록체인인 가나슈에 대해서도 “이더리움 댑 개발” 세미나에서 자세하게 다룹니다.

 

부록 E. web3.js 튜토리얼

web3.js는 이더리움 댑 개발을 위한 필수 중에 필수인 요소입니다. 이 부분도 다음 세미나에서 자세히 다룰 예정입니다.

About the Author
(주)뉴테크프라임 대표 김현남입니다. 저에 대해 좀 더 알기를 원하시는 분은 아래 링크를 참조하세요. http://www.umlcert.com/kimhn/

Leave a Reply

*