[Ripple] 리플 합의 알고리즘 시작

cybergangster·2022년 7월 6일
0

미분류

목록 보기
4/10
post-thumbnail

[2020. 1. 15. 13:40]
요 며칠을 알바에- 감기에- 뭐에- (사실 별거 안 했지만) 심신이 망가질 대로 망가져서 해야 할 일들도 다 미뤄두고 있었다가 오늘에서야 정신을 그나마 차렸다.

아무래도 지금 사는 집이 나랑 안 맞는 것 같아 요즘 집을 열심히 알아보는 중인데 과연 언제쯤 옮길 수 있을련지... 겁도 많고 그래서 하숙집으로 옮겼던 건데 지금 사는 집으로 이사한 이후부터 흉흉한 일도 많이 일어나고 거-의 안 꾸던 악몽부터 시작해서 건강이 정말 눈에 띄게 안 좋아졌다.

-라는 핑계 아닌 핑계를 시작으로 리플 합의 알고리즘 시작 - !


00. 리플?

리플은 분산 장부 기술을 기반으로 한 실시간 결제 시스템/프로토콜이다.

2020년 1월 15일 오전 11시 46분을 기준으로 상태는 이 정도- 떨어지는 거만 보다가 오랜만에 확인했는데 오르고 있으니 기분이 참 묘하다.

리플은 현재 합의 알고리즘 백서만 공개한 상태인데, Abstract 부분만 봐도 충분한 것 같다. 디테일은 필요하면 찾아보는 걸로.


01. 너무 긴 대기시간

While several consensus algorithms exist for the Byzantine Generals Problem, sepcifically as it pertains to distributed payment systems, many suffer from high latency induced by the requirement that all nodes within the network communicate synchronously. In this work, we present a novel consensus algorithm that circumvents this requirement by utilizing collectively-trusted subnetworks whithin the larger network. We show that the "trust" required of these subnetworks is in fact minimal and can be further reduced with principled choice of the member nodes. In addition, we show that minimal connectivity is required to maintain agreement throughout the whole network. The result is a low-latency consensus algorithm which still maintains robustness in the face of Byzantine failures. We present this algorithms in its embodiment in the Ripple Protocol.

- The Ripple Protocol Consensus Algorithms-Abstract, Ripple Labs Inc, 2014

대충 해석을 해보자면 비잔틴 장군 문제를 해결하기 위한 몇몇 합의 알고리즘이 존재하지만, 분산 장부 시스템에서의 경우 네트워크에 있는 모든 노드가 동기적으로 커뮤니케이션하기 때문에 긴 대기시간 발생 문제가 있다는 것이고, 리플은 이를 해결하기 위한 해결책이라는 것 같다. (여기서 communicate synchronously, 동기적 커뮤니케이션, 동기적 처리란 코드를 순서대로 처리한다는 뜻, 반대로 비동기적-은 코드를 동시에 처리한다는 뜻)


02. 신뢰받는 서브 네트워크

While several consensus algorithms exist for the Byzantine Generals Problem, sepcifically as it pertains to distributed payment systems, many suffer from high latency induced by the requirement that all nodes within the network communicate synchronously. In this work, we present a novel consensus algorithm that circumvents this requirement by utilizing collectively-trusted subnetworks whithin the larger network. We show that the "trust" required of these subnetworks is in fact minimal and can be further reduced with principled choice of the member nodes. In addition, we show that minimal connectivity is required to maintain agreement throughout the whole network. The result is a low-latency consensus algorithm which still maintains robustness in the face of Byzantine failures. We present this algorithms in its embodiment in the Ripple Protocol.

- The Ripple Protocol Consensus Algorithms-Abstract, Ripple Labs Inc, 2014

리플 합이 알고리즘의 핵심은 바로 trusted subnetworks-신뢰받는 서브 네트워크이다. 모든 노드가 합의에 참여하는 것이 아닌 큰 네트워크에서 신뢰받는, 즉 선택받은 믿을 수 있는 노드들만이 합의 과정에 참여한다.


03. 줄어드는 신뢰, 최소한의 연결성

While several consensus algorithms exist for the Byzantine Generals Problem, sepcifically as it pertains to distributed payment systems, many suffer from high latency induced by the requirement that all nodes within the network communicate synchronously. In this work, we present a novel consensus algorithm that circumvents this requirement by utilizing collectively-trusted subnetworks whithin the larger network. We show that the "trust" required of these subnetworks is in fact minimal and can be further reduced with principled choice of the member nodes. In addition, we show that minimal connectivity is required to maintain agreement throughout the whole network. The result is a low-latency consensus algorithm which still maintains robustness in the face of Byzantine failures. We present this algorithms in its embodiment in the Ripple Protocol.

- The Ripple Protocol Consensus Algorithms-Abstract, Ripple Labs Inc, 2014

원칙에 입각한 선택으로 필요로 하는 신뢰가 줄어들고, 최소한의 연결로 전체 네트워크를 유지하겠다는 것...


04. 시간 단축

While several consensus algorithms exist for the Byzantine Generals Problem, sepcifically as it pertains to distributed payment systems, many suffer from high latency induced by the requirement that all nodes within the network communicate synchronously. In this work, we present a novel consensus algorithm that circumvents this requirement by utilizing collectively-trusted subnetworks whithin the larger network. We show that the "trust" required of these subnetworks is in fact minimal and can be further reduced with principled choice of the member nodes. In addition, we show that minimal connectivity is required to maintain agreement throughout the whole network. The result is a low-latency consensus algorithm which still maintains robustness in the face of Byzantine failures. We present this algorithms in its embodiment in the Ripple Protocol.

- The Ripple Protocol Consensus Algorithms-Abstract, Ripple Labs Inc, 2014

그래서 뭐 대충 비잔틴 문제를 적절히, 견고하게 유지하면서 대기 시간을 줄이겠다는 그런 뜻.


05. 기술적인 문제

이전 글에서 살짝 언급한 리플 프로토콜에서 세 가지 카테고리로 분류한 기술적인 문제에는 정확성, 동의, 활용성이 있다.

Correctness, 정확성은 올바른 거래와 위조된 거래의 차이를 식별하는 것이다. 돈이 100원 밖에 없는데 1000원 송금하려고 하는 게 말도 안 되듯, 가장 기본적이고, 근본적이고 중요한 문제...

Agreement, 동의는 전 세계적인 하나의 신뢰, 즉 하나의 장부를 갖는다는 것이다. 각각의 거래는 개별적으로는 문제가 되지 않지만 두 거래를 동시에 처리하는 건 문제가 된다. 예를 들어, 나한테는 1000원이 있고, 500원짜리 거래와 700원짜리 거래를 한다고 했을 때, 이 500원짜리 거래와 700원짜리 거래는 문제가 되지 않는다. 이해했을 거라 믿고... 근데 이 두 거래를 동시에 처리하는 건 문제가 된다. 잔고에 1000원 밖에 없는데 도합 1200원짜리 거래를 처리하려고 하면... (양아치) 이중 지불 문제가 발생한다. 리플은 UNL(unique node list)을 통하여 트랜잭션이 각각 이루어지게 하는데, 이는 모든 장부가 동일하기 때문에 가능하다.

마지막으로 Utility, 활용성은 분산 지불 시스템의 유용성, 즉 시스템 지연시간과 관련이 있다. 아무리 정확성과 동의가 보장된다 하여도 느리면 지불 수단으로서의 가치가 떨어질 것이다. 이 부분은 리플 프로토콜의 굉장히 큰 장점이라 할 수 있다.


06. 합의의 목표

여기서 리플 알고리즘의 목표는 리플 프로토콜에 의해 사용되는 합의 알고리즘이 각 장부의 종료 시점에서 합의를 이루어야 한다는 것, 혹여나 비잔틴 장애에 직면한 상황에서도 알려진 확률로만 이루어지는 것이다. 네트워크의 각 노드는 UNL에 있는 노드들로부터 제안된 트랜잭션들에게만 투표를 할 거고, 각 노드들은 아마 각기 다른 UNL을 설정했을 것이기 때문에 UNL의 일원이 누군지에 상관없이 모든 노드 사이에서 오직 한 가지 합의만이 이루어지 것이다. 이는 네트워크 내의 '포크'를 막는다. 즉, 장부가 하나로 유지되게 한다.
(+) 리플 프로토콜은 비잔틴 장애를 20%까지 허용한다. 10명 중 2명이 악의적이어도 프로토콜은 정상 작동...


07. 주절주절

리플이 정말 신기하고- 막 그랬던 건 블록이 없기 때문도 있었다. 비트코인의 장부는 트랜잭션 바구니 블록을 계속 연결하는 방식이지만 리플의 장부는 트랜잭션을 계속 추가하는 방식이다. 이 장부에는 블록이 없고 그냥 장부 자체가 몇 초였더라, 무튼 몇 초마다 업데이트된다. 그래서 장부 관련 용어가 다양하다. 장부, 열린 장부, 닫힌 장부, 최종 장부... 으아악, 머리는 쉽게 터지지 않는다는 걸 깨닫고 관자놀이 눌러가며 이해하려고 애썼다.

언제 올릴지는 모르겠지만 다음에 쓸 리플 합의 알고리즘, 마지막 포스팅이 끝나면 졸프 주제를 조금 구체화해볼까 한다.

그리고 2월 전에 리플 오버뷰 좀 보고... 비트코인 끝내고... 책 좀 읽는 게 목표... 실습은 언제 해보나...


0개의 댓글