Introduce
In this series, I'm going to summarize Solana based on the contents of the Solana whitepaper.
Also I’m gonna write about what is POH and basic solan network architecture.
Korean language
이 시리즈에서는 Solana white paper에 적혀 있는 내용을 바탕으로 정리할 예정입니다.
또한 현재 글에서 Solana Network의 기본 구조와 POH가 무엇인가에 대해서 간략하게 정리할 예정입니다.
Network Architecture
In the Solana network, assuming it is in a non-partitioned state, only one Leader can exist at any given time. The Leader is elected by a Proof-of-Stake (POS) algorithm and is rotated among other nodes. The candidates for Leader nodes are all verifier nodes. In summary, all candidate nodes, which are the verifiers, can be elected by the POS algorithm one at a time, taking turns.
The transaction flow on Solana network below:
- The Leader node on the Solana network collects transaction data from users and other nodes.
- Using Solana's Proof-of-History (PoH) mechanism, the Leader node organizes these transactions into a particular order..
- The Leader node then broadcasts the ordered transactions to the other verifier nodes on the network.
- If the transactions and their ordering are verified by the other nodes, the Leader's block is approved and added to the Solana network.
Korean language
Solana network에서 Leader역할을 하는 노드는 한번에 하나만 선출될 수 있습니다.Leader 노드는 모든 verifier 노드들이 돌아가면서 POS 알고리즘에 의해서 일정 시간마다 선출됩니다. 이렇게 선출된 Leader 노드와 verifier 노드들이 Solana network에서 Transcation을 처리하는 방법은 다음과 같습니다.
1. Solana network에 있는 Leader 노드는 다른 노드들과 client로 부터 transaction data를 수집합니다.
2. Leader 노드는 수집된 transaction들을 POH를 이용해서 Transaction을 특정 순서로 정렬합니다.
3. Leader 노드는 이렇게 정렬된 transaction들을 네트워크의 다른 verifier 노드들로 broadcast합니다.
4. verifier node들의 검증을 최종적으로 통과하면 Leader노드의 블록은 최종 승인되어 네트워크에 등록됩니다.
PoH(Proof of History)
Proof of History is the sequence of computation that can provide the way of verify order of two events by using cryptography. It means that PoH doesn’t give the absolute timestamp of transactions. But It can provide the relational timestamp for Solana network. In essence, the PoH mechanism can prove order of transaction on Solana network.
It works by using cryptographically secure function that output cannot be predict. The PoH function execute sequentially use input ,which is output Immediately before. And the PoH record the function executed count and it’s result. That’s the essential part that PoH convert time to data. Additionally, PoH append transaction data with timestamp and use it as next input value of PoH function. It make possible PoH grant the timestamp to transaction data.
Korean language
Proof of History (PoH)는 이벤트의 시간 순서를 암호화 방법을 사용하여 검증할 수 있게 하는 개념입니다. PoH는 트랜잭션에 대한 절대적인 타임스탬프를 제공하지 않지만, Solana 네트워크 내에서는 상대적인 타임스탬프를 제공하여 트랜잭션의 순서를 결정할 수 있게 합니다.
PoH 메커니즘은 예측할 수 없는 출력을 생성하는 암호학적으로 안전한 함수를 통해 작동합니다. PoH 함수는 순차적으로 실행되며, 한 계산의 출력을 다음 계산의 입력으로 사용합니다. 이 순차적인 실행과 함수의 실행 횟수와 그 결과의 기록은 PoH가 시간을 데이터로 변환하는 데 핵심적인 역할을 합니다.
더욱이, PoH는 현재 타임스탬프와 트랜잭션 데이터를 포함하여 다음 PoH함수에 새로운 입력값으로 넣기에, 트랜잭션 데이터에 타임스탬프를 할당할 수 있게 합니다. 이 과정은 Solana 네트워크에서 트랜잭션의 순서를 검증하는 것을 가능하게 합니다.
So what is PoH Sequence really?
Solana's Proof of History (PoH) concept involves generating a sequential record of computational hashes, which essentially forms a unique, verifiable passage of time. This is achieved through a continuous hashing of the previously generated hash.
Korean language
Solana의 Proof of History (PoH) 개념은 연속적인 컴퓨팅 해시 기록을 생성함으로써 고유하고 검증 가능한 시간 경과를 형성하는 것을 포함합니다. 이것은 이전에 생성된 해시를 반복적으로 해싱하면서 시간의 흐름을 표현할 수 있습니다.
To simplify, here is the sequence:
- Start with an initial value (for example, a random string) and hash it. This produces the first hash (hash1).
- Then, take hash1, use it as an input to the same hash function to generate the next hash (hash2).
- Repeat the process, each time using the last hash generated as the input for the next. This creates a series of hashes (hash1, hash2, hash3, ..., hashN).
Each hash in this sequence is unique and depends on the previous one, forming a verifiable sequence or 'history' of computations. In simpler terms, that PoH can be translated as time in the form of a sequence, and it can be used as a clock. This is an important aspect of Solana's Proof of History.
The security of this process relies on the properties of cryptographic hash functions, which are designed to be collision-resistant, meaning it's extremely unlikely (near impossible with a secure hash function) that two different inputs will produce the same hash output. This ensures the uniqueness of each hash in the sequence.
To summarize once again, by creating a record of hashes in this way, Solana is able to translate time into
cryptographically verified data, which forms an integral part of its blockchain architecture.
Try to understand follow the image below
Korean language
간략한 순서를 나열하면 다음과 같습니다.
1. 초기값을 임의의 문자열로 설정하고 해시를 진행하면, 첫번째 hash값이 나오게 됩니다. (hash1)
2. hash1 값을 입력으로 hash를 진행해서 다음 hash값을 만듭니다.(hash2)
3. 이 과정을 반복해서 각 과정의 hash값이 다음 hash의 입력값으로 사용합니다. 이렇게 해서 일련의 hash set을 만듭니다. (hash1, hash2, hash3, ..., hashN).
각 해시는 고유하며 이전 해시에 의존하여 검증 가능한 시퀀스 또는 '기록'을 형성합니다. 간단하게 설명하면 PoH는 시간을 일련의 문자열로 변환할 수 있고, 이렇게 변환된 문자열은 시계로써 사용될 수 있습니다. 이 개념은 Solana의 PoH에서 매우 중요한 부분입니다.
Solana에서 해시 함수의 특성 덕분에, 암호화가 보장되며 이때 사용하는 함수는 해시 충돌 방지 설계되어 있습니다. 이는 두 가지 다른 입력이 동일한 해시 출력을 생성할 가능성이 극히 낮음(안전한 해시 함수를 사용할 경우 거의 불가능)을 의미하며, 이는 시퀀스의 각 해시의 고유성을 보장합니다.
다시 한번 정리하자면, 이러한 해시 기록을 생성함으로써 Solana는 시간을 암호학적으로 검증된 데이터로 변환할 수 있으며, 이는 solana에서 굉장히 중요한 의미를 가집니다.
아래 사진을 참고하면서 이해해 보세요!
How can PoH Sequence use to timestamp transactions?
In Solana, to timestamp transaction by using PoH mechanism, It use transaction data and immedate before hash value both as input to generate PoH sequence. To explain in more detail, they using combine function to combine piece of data and current hash. It takes as input of the next hash function. It makes, the next hash value relies on current hash and specific data , which can be the parts of transaction data.
Because of the reasons mentioned earlier, hash rely on before hash and transaction data, It can works as transaction timestamp.
Korean language
Solana에서는 PoH(Proof of History) 메커니즘을 사용하여 트랜잭션에 타임스탬프를 부여합니다. 이를 위해 트랜잭션 데이터와 직전 해시 값을 함께 사용하여 PoH 시퀀스를 생성합니다. 자세히 설명하면, 특정 데이터와 현재 해시를 결합하는 함수를 사용합니다. 이 함수는 다음 해시 함수의 입력으로 사용됩니다. 이렇게 함으로써 다음 해시 값은 현재 해시와 특정 데이터(예: 트랜잭션 데이터의 일부)에 의존하게 됩니다.
앞서 언급한 이유로 해시 값은 이전 해시와 트랜잭션 데이터에 의존하므로, 트랜잭션 타임스탬프로서 작동할 수 있습니다.
For example
First event (or some transaction data) combine with hash335 for using as input of 336th hash unction. It makes hash values thereafter depends on transaction data ,that inserted on 336th function. Assume the second event emit on 600th hash, it merged with hash599 to use 600th hash function.
In this case, the hash 599th rely on first event data. It’s the reason that PoH sequence with event data can be use timestamp of transaction. It force order of transaction by relation of PoH hash sequence.
Once again, I want to emphasize that PoH doesn’t provide absolute time. But it can set the order of transaction by using this mechanism on total Solana network.
The picture below is a diagram of inserting data into PoH.
Korean language
첫 번째 이벤트(또는 일부 트랜잭션 데이터)는 hash335와 결합하여 336번째 해시 함수의 입력으로 사용됩니다. 이로 인해 이후의 해시 값은 336번째 함수에 삽입된 트랜잭션 데이터에 의존하게 됩니다. 예를 들어, 두 번째 이벤트가 600번째 해시에서 발생한다고 가정해보겠습니다. 그렇다면 두 번째 이벤트는 hash599와 병합되어 600번째 해시 함수에 사용될 것입니다.
이 경우, 599번째 해시는 첫 번째 이벤트 데이터에 의존합니다. 이것이 PoH(Proof of History) 시퀀스가 이벤트 데이터와 함께 트랜잭션의 타임스탬프로 사용될 수 있는 이유입니다. PoH 해시 시퀀스의 관계에 따라 트랜잭션의 순서를 강제하기 때문입니다.
한 번 더 강조하고 싶은 점은 PoH(Proof of History)가 절대적인 시간을 제공하지 않는다는 것입니다. 그러나 이 메커니즘을 사용하여 전체 Solana 네트워크에서 트랜잭션의 순서를 설정할 수 있습니다. PoH는 각 트랜잭션의 상대적인 순서를 정의하는 데 사용됩니다. 이를 통해 트랜잭션들 사이에 일정한 시간적 순서가 형성되며, 이는 Solana 네트워크에서 트랜잭션을 처리하고 상호작용하는 데 도움을 줍니다. 그러나 PoH 자체는 절대적인 시간을 제공하지 않으므로, 실제 세계 시간을 대체하는 것은 아닙니다.
아래 그림은 Solana Network에서 data가 삽입되는 과정을 나타낸 모식도 입니다
Verification of PoH
The picture below is a diagram of how can verify the PoH in multicore.
In Solana, PoH can be verified on multicore. the verifier only needs to check the order relationship of the PoH sequence is correct. This is the reason that the PoH verify can be execute on multicore.
For example,
Core 1 just verify index 200 to index 300 sequence. and core 2 verify index 300 to index 400. All this process can be concurrently. In Solana, nodes often use the GPU (it has many cores) for verify this hash function , hence they use CUDA.
This is the expected time of verify sequence :
Korean language
Solana에서는 PoH(Proof of History)를 멀티코어에서 검증할 수 있습니다. 검증자는 PoH 시퀀스의 순서 관계가 올바른지만 확인하면 됩니다.
예를 들어서 Core 1은 인덱스 200부터 인덱스 300까지의 시퀀스를 확인하고, Core 2는 인덱스 300부터 인덱스 400까지 확인합니다. 이 모든 과정은 동시에 진행될 수 있습니다. Solana에서 노드들은 이 해시 함수를 확인하기 위해 GPU를 주로 사용하며, 이를 위해 CUDA를 사용합니다.
바로 위의 사진은 검증까지 걸리는 시간에 대한 기닷값입니다.
Outro
In this article, I talked about the the basic concept of PoH and network structure. In next article, I’m gonna talk about the Solana Horizontal scaling and the method that solana network can maintain the consistent even though scale up horizontally.
Korean language
이 글에서는 기본적인 solana network 구조와 PoH의 기본적인 개념에 대해서 설명했습니다. 다음 글에서는 이어서 Horizontal scaling이 solana 에서 어떻게 가능한지, 그리고 그럼에도 불구하고 일관성이 유지되는 이유에 대해서 설명하겠습니다.
Reference
[2] Solana Docs