the blockchain for beginners

icon picker
consensus mechanisms

here’s the most important piece of the blockchain. this and smart contracts make it possible for builders to build on top of these different layer-one blockchains like: ethereum, solana, luna, avalache, etc.
Loading…
so what the hell is a consensus mechanism or even a smart contract? thanks for asking friend, it makes sense to tldr and then deep dive into each one’s importance.
smart contract tldr: digital agreements based on a deterministic set of rules. it’s a contract or code in the block chain in ‘If...and then’ logic. this can reach agreement between people, organizations, and more.
consensus mechanisms tldr: a way of verifying and agreeing on one piece of data in a distributed (specifically blockchain) system

so what? and what actually is happening?


so imagine you want to lend your charger to your friend. they’re the type to forget to give it back to you so you’ll always have to buy a new one. probably from the gas station... and it’s always breaking. you haven’t had an apple charger in years. you want a usb-c. enter smart contract.
before you and your friend exchange trust for charger. you ask him to open up his phone, go to rainbow, and ‘sign’ this contract. it’s an agreement saying that ‘if I lend you my charger then you promise to give it back in less than 24 hours’.
they sign. the agreement was a simple smart contract with a couple bounds. he can’t say ‘ bro you didnt specifiy’ ‘ nah you didnt even give me your charger’. the blockchain is immutable and transparent. its clear as day that they agreed.
that’s smart contracts.
a classic story for consesus mechanisms is the generals problem, here’s a great video :
In its simplest form, a number of generals are attacking a fortress and must decide as a group only whether to attack or retreat. Some generals may prefer to attack, while others prefer to retreat. The important thing is that all generals agree on a common decision, for a halfhearted attack by a few generals would become a
, and would be worse than either a coordinated attack or a coordinated retreat.
The problem is complicated by the presence of treacherous generals who may not only cast a vote for a suboptimal strategy, they may do so selectively. For instance, if nine generals are voting, four of whom support attacking while four others are in favor of retreat, the ninth general may send a vote of retreat to those generals in favor of retreat, and a vote of attack to the rest. Those who received a retreat vote from the ninth general will retreat, while the rest will attack (which may not go well for the attackers).
The problem is complicated further by the generals being physically separated and having to send their votes via messengers who may fail to deliver votes or may forge false votes.
a blockchain is a way of getting everybody to agree despite their rank or location.

Examples [ directly taken from ]


These are all different ways of verifying the pieces of data in these blockchains. in my opoinion, I diont know whichis better whether ots PoS or PoH. My instinct tells me that it doesn’t really matter. Imagine that we can all directly and equally contribute to decisions and teh validity of everything on a network/system/chain.

Proof Of Work (PoW) Based Blockchain Consensus
Proof of Work (PoW) is the process of producing a cryptographic hash, and the concept was first introduced in 1993 by Cynthia Dwork and Moni Naor, and later re-introduced by Satoshi Nakamoto in the Bitcoin whitepaper in 2008. Proof of Work in blockchain systems historically originates from its use in Hashcash, which was conceived by Adam Back as a system to limit email spam and denial-of-service attacks.
In a PoW system, blockchain validators must take data from a block header as an input, and continuously run it through a cryptographic hash function. Validators hash slight variations of the input data by including an arbitrary number called a nonce every time the input data is run through the cryptographic hash function. PoW needs high levels of electricity of processing power to decide what data gets added to the next block in a blockchain. Specialised computers called ASICs are required to compute complex mathematical problems needed for the PoW system.
Proof Of Stake (PoS) Based Blockchain Consensus
The PoS consensus algorithm was created in 2011 as an alternative to PoW. Although PoS and PoW have similar objectives, they present some fundamental differences and features, especially during the validation of new blocks on the blockchain network. The Proof of Stake (PoS) consensus algorithm differs with the PoW mining consensus with a mechanism where blocks are validated based on the stake of the network participants. Here, unlike running hash functions, validators stake resources primarily in the form of digital money or tokens. The validator of every block is then randomly selected from the stakeholders based on the amount of computational power allocated.
Each PoS system may implement the algorithm in different ways, but, in general, the blockchain is secured by a pseudo-random election process that considers a node’s allocation and the allocation– determining the commitment of the party to ensure the network. The Ethereum blockchain, which is the world’s largest blockchain network in terms of developer activity has initiated to switch from PoW algorithm PoS in an attempt to increase the network’s scalability and reduce excessive electricity wastage.

Proof of History (PoH) Based Consensus
A sequence of computation that can provide a way to cryptographically verify passage of time between two events. It uses a cryptographically secure function written so that output cannot be predicted from the input, and must be completely executed to generate the output.

Delegated Proof-of-Stake (DPoS) Based Blockchain Consensus
Conceptualised by Daniel Larimer, delegated Proof-of-Stake (DPoS) is an another type consensus algorithm, which is based on voting systems where “delegates” vote for their favourite validators to help in the consensus state of new blocks. These validators will also be responsible for validating transactions, maintaining the blockchain network, and will get rewarded in return in doing so with transaction fees. Also, each voter’s power is proportional to the size of the stake in the network. Blockchain projects like EOS, Bitshares, Steem, Tezos, etc. use DPoS consensus algorithm for validating transactions.
Many experts also call it a democratic version of the Proof of Stake consensus system because it is based on a voting process and elects representatives instead of independent network nodes. According to experts, DPoS can manage a higher transaction volume and quicker confirmation times than PoW and PoS consensus mechanisms because of a limited number of network nodes or trusted witnesses are needed to verify data in each new block of the network chain.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.