Consensus is a necessity for blockchains, but what does this actually mean and why is it important?

Let's take a look at it from the perspective of a blockchain.

A thread. ↓
1. The Client-Server Model

Most applications nowadays work with the so-called client-server model.

Client applications interface with a central server that is owned by one entity.

This server decides what information to store and what to return to clients. Image
If the owner decides to change the data, they can simply do so. Many users wouldn't sometimes even notice that data was altered.

The client-server architecture is a centralized application style. Users are always at the mercy of the owner of a service.
2. Decentralized Applications

Decentralized applications don't rely on a client-server architecture. They primarily work by using peer-to-peer protocols.

There is no more central server that all clients talk to. Instead, they talk to each other. Image
In such a model, there is a huge problem that needs to be solved.

If all those clients exchange information, what stops some of them from saying something different than the others. And who should be trusted in this case?
This problem is especially critical for blockchains that usually come with a dedicated currency.

It would be a worst-case scenario if no one could stop anyone from taking currency tokens from your account and putting them into their own one or simply deleting them.
Other than that, even outside of the monetary space, data is essential to its owner.

If that data is altered or deleted, it does damages. This needs to be prevented, or the system itself loses trust.

Without trust, there is less if not even no instigation to use a system.
3. Consensus Protocols

There is a multitude of consensus protocols for different use cases. They are not exclusive to blockchains.

If you ever worked with Kafka, you perhaps know that it always comes with the need for a Zookeeper node (or, even better, more).
Kafka topic leader election (when a node fails) is based on a consensus protocol where multiple Zookeeper nodes decide which of the remaining Kafka instances becomes the new leader of a particular topic.
This is only an example of a permissioned variant of a consensus protocol. The participants are known and can authenticate themselves.

In the case of blockchains, however, permissionless consensus protocols are used. In a peer-to-peer network, all participants are unknown.
Clients usually only talk to a small portion of the system.

Because clients only talk to a part of the system, there is always a portion of the network unknown. But clients still need to trust even the unknown parts of the system.
Consensus Protocols are designed to achieve consensus in a system.

They are a set of algorithms and steps that, given the same input on every client, lead to the same result for everyone.
All participants can verify whether what they see is correct or whether a choice is valid.

The protocols themselves don't prevent incorrect or fraudful data, they provide a way to filter that data out. Clients can then simply ignore it.
The participants of the network agree on what the truth is together.

Some participants may disagree but it's usually a majority vote. You could say that the process is somehow democratic.
In blockchain space, getting this consensus usually requires mining or validating, depending on the protocol used by the specific blockchain.

When Bitcoin miners use up all those precious Nvidia graphics cards and energy, they do this to contribute to the system's consensus.
In this specific case, they do a complicated calculation (hashing) multiple times by guessing a random integer to get a pre-defined result (a hash).

This result, the nonce, is then included in a new block and can be verified for correctness by everyone.
Every participant can check whether that nonce and its block are correct.

Guessing the nonce and verifying the result builds the consensus of the Bitcoin network. Clients can agree on which blocks are actually correct and which are not.
Other factors are included, like the longest verifiable chain being accepted as the truth and more, so the protocol is a little more complex than presented here.

But you should hopefully still get a general idea of the system itself.
There is never THE consensus protocol.

Different blockchains use different consensus protocols and alter them to fit their needs.

It's more important to choose one that fits the specific case and works well (enough) to guarantee some form of security and stability in a system.
4. Conclusion

Consensus protocols in blockchain space ensure that the system behaves correctly, although there is no central controlling entity.

They come in a multitude of flavors, and research on more is ongoing.

Their job is to build security and trust.
Without security and trust, such systems would have no value to be used.

This is why consensus plays a crucial part in blockchains.
As already stated, you can use those protocols for a lot more than only decentralized networks, so feel free to research.

You might or might not end up needing this knowledge at some point.
5. Thread end

That's it for this thread.

I hope you found something useful for you in it.

If you enjoyed reading this thread, consider dropping a like, retweet the first tweet, and follow me (@oliverjumpertz) for more content like this.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Oliver Jumpertz

Oliver Jumpertz Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @oliverjumpertz

30 Sep
Web 3.0 is the next evolutionary step of the internet and an awesome one, to be honest.

Every web developer, beginner, junior, or senior can and should contribute to it, and it doesn't even take too much effort.

Let's see how.

A thread. ↓
If you are still unsure what the term "Web 3" or "Web 3.0" really means, you might want to read this thread first. 👇🏻

1. Why you should care

The Web is inevitably going to evolve. The question is not if but when this is going to happen.

This process won't happen fast or overnight, though. Instead, it will be a slow transition, nearly unnoticeable.
Read 21 tweets
26 Sep
Have you recently heard more about the term dApp?

Want to learn about one of the central components of Web 3 that can earn you millions of bucks?

Let's learn about dApps and how you can get started!

A thread. ↓
1. The internet today

Nearly all websites you visit every day are a perfect model of how the internet works today.

Someone creates a service (a website, e.g.), hosts it somewhere, and has it under complete control.
If you own an app, you decide what happens. You store the data. You can often decide what you do with it.

And most importantly: You can prevent certain users from participating if you don't feel like they deserve to be around.
Read 25 tweets
24 Sep
Did you ever want to know what Proof-of-Work is?

It's the consensus protocol behind Bitcoin and, according to some people, the sole reason for climate change due to its insane energy consumption.

Let's take a closer look at this consensus protocol.

A thread. ↓
1. Basics

The Proof-Of-Work protocol creates a system in which one party (the prover) has to prove to one or multiple other parties (the verifiers) that they put in a certain amount of work for some purpose.
The prover's work is moderately hard to very hard, while the verifiers can pretty quickly check whether the proof is correct.

This creates an asymmetric system.

The original idea was to create protection against DDoS attacks and spam.
Read 20 tweets
20 Sep
What is a Blockchain?

You hear the term Bitcoin and Blockchain more often these days, but there must be more to the technology than just crypto, or not?

Well, we can take a look at the underlying technology to understand better what it is.

A thread. ↓
1. Foreword

This thread is a high-level overview to give you an intro to blockchain technology.

It doesn't go too much into detail, so you should be able to follow along nicely.
2. Client-Server Architecture

Before we dive into blockchain technology, we should take a look at how most of the internet works.

We need this to understand the fundamental differences between a traditional model and the change blockchain technology brings.
Read 33 tweets
16 Sep
Do you know what many dApp developers struggle with?

Which data to put on-chain. More data on the chain can drive the cost up. Too much data might render your app unusable. Storing fewer data might not be an option.

Here are some ideas for you to fix this.

A thread. ↓
1. Use A Dedicated Database

This approach will make your dApp into an app.

If you bring in central data storage, you can circumvent the limits of some blockchains, but it doesn't keep the promise of being decentralized.
You can store anything that you can't store on-chain in your database and associate it with a user.

Whenever you need that type of data, you fetch it from your database.
Read 13 tweets
16 Sep
I regularly post visual content about JavaScript. And at the moment, this content is a lot about algorithms.

Now it's time for a collection of many of those visuals for any developer interesting in algorithms with JavaScript!

A thread. ↓
1. Check For Palindrome .
2. Reverse A String .
Read 23 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(