10 Haziran 2015 Çarşamba

Blockchain Consensus Algoritmaları

Giriş
Blockchain aslında Distributed Ledger'in bir gerçekleştirimi. İnsanlar Blockchain kelimesini kullansalar dahi aslında kastedilen şey Distributed Ledger. Açıklaması şöyle.
It is crucial to understand that people often don't mean 'Blockchain' when they say 'Blockchain'. What they actually mean is 'Distributed Ledger Technology' (DLT).
Hedera Hashgraph
Hedera Hashgraph bir başka Distributed Ledger gerçekleştirimi

Distributed Ledger Technology (DLT)
Özellikleri şöyle
- Decentralized database
- Managed by various participants. No central authority acts as an arbitrator or monitor
- Distributed log of records, greater transparency
- Fraud and manipulation more difficult, more complicated to hack the system
Blockchain
Özellikleri şöyle
Blockchain is nothing else but a DLT with a specific set of features
- Shared database – a log of records – but in this case, shared using blocks that form a chain
- Blocks are closed by a type of cryptographic signature called a 'hash'; the next block begins with that same 'hash', a kind of wax seal
- Hashing verifies that the encrypted information has not been manipulated and that it can't be manipulated
Blockchain Kavramları
Açıklaması şöyle.
- A blockchain is either permissionless (i.e., public and accessible by everyone, like Bitcoin) or permissioned (using a group of companies or consortium).

- Different consensus algorithms exist, including Proof-of-Work (POW), Proof-of-Stake (POS), or voting systems.

- Blockchain uses global consensus across all nodes. In contrary, DLT can build the consensus without having to validate across the entire Blockchain

- A Blockchain is a growing list of records, called blocks, linked using cryptography. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data.
Blockchain Block Time
Açıklaması şöyle
The block time is a Unix epoch time when the miner started hashing the header (according to the miner). Must be strictly greater than the median time of the previous 11 blocks. Full nodes will not accept blocks with headers more than two hours in the future according to their clock.
Örnek
Bir örnek şöyle
Event         Time
Last block mined         08:00
Median time of last 11 blocks 07:00
Current time on my clock 11:00
Time on block arriving now 12:59

Rule                 Result
(12:59 - 11:00) < 2         OK
12:59 > 07:00         OK

Consensus Algoritmaları
Consensus Algoritmaları dağıtık sistemlerde kullanılıyor. Bir liderin seçilmesi kuralına dayalı. Lidere orchestrator, coordinator gibi isimler de verilebilir.

Sorgular ya da shared state lidere gönderilir.

Bu tür algoritmalarda yükün lidere verilmesi yani load-balancing değil daha çok fault tolerance önemlidir.

Proof of Work Algoritması
Bitcoin bu algoritmayı kullanıyor. Açıklaması şöyle.
This consensus algorithm being exponentially expensive, and resource intensive
Açıklaması şöyle.
PoW is a simple work-around to a coordination problem that was previously thought to be unsolvable. It sort of "cheats" by providing an economic solution to a distributed systems challenge, by introducing a real cost as a disincentive to unwanted behavior as well as using a reward system both to bootstrap itself and to incentivize security. The advantages of Bitcoin's PoW system include that the group of block authors is truly open to anyone with computational resources, that the system converges on one ground-truth because there is a real cost in producing a competing chaintip, and that it is simple enough for its security model to be well understood.
PoW istenilen hash çıktısını sağlayan nonce değerinin hesaplamanın zor olmasından kaynaklanıyor.  Açıklaması şöyle
A Bitcoin block contains a handful of fields

- Version
- Previous block hash
- Merkle root
- Time stamp
- Difficulty bits
- Nonce

...
Proof of work, in this simplified scenario, is accomplished by adding all of those numbers together and finding a nonce that results in the hash being 000. ...

Instead, Bitcoin uses SHA256. SHA256 has a couple of advantages which stem from its being a cryptographic hash function; the big three are that 
- calculating the SHA256 hash of a given value is "cheap" 
- but generating a value that will produce a given SHA256 hash is hard, 
- and that tiny changes in the input will produce large changes in the output (the avalanche effect).

Proof of State Algoritması
Açıklaması şöyle.
PoS is more similar to the approaches that were pursued before the publication of Bitcoin. PoS is naturally divergent as there is no real cost in staking. The "Nothing at Stake problem" allows stakers to work on multiple chaintips and only publish the next block from the chain most favorable to them. There are different ways of approaching the vastly different security model of PoS.
Gossip About Gossip and Virtual Voting Protocol Algoritması
Açıklaması şöyle.
To achieve consensus, Hashgraph uses the 'Gossip about Gossip' and 'Virtual Voting' mechanisms.

How the ‘Gossip about Gossip’ protocol works, below is the illustration to help you develop a clear understanding of the methodology. Say point A (Alice) randomly calls B (Marry) to inform her about an incident. Marry then records the information and creates an event. At random, a person, let’s say Bob makes a new event to commemorate the synchronized event.

Similarly, the network goes on, and the events are created in an acyclic graph that goes only upward. Each person randomly chooses another person and circulates the information across each node of the network. The acyclic graph, aka Hashgraph, is connected with cryptographic hashes, and the transactions are recorded in cryptographic timestamps.
Açıklaması şöyle.
Both the Hashgraph and blockchain technology employ different consensus mechanisms. Blockchain commonly uses proof-of-work and proof-of-stake consensus algorithm. Whereas Hashgraph opts for a different methodology, as stated above, it uses 'Virtual Voting' to carry out a flawless network consensus.

Hiç yorum yok:

Yorum Gönder