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.
If someone sending a request to a service has to put in a lot of work to get an answer, it would be very costly to send many requests or require a disproportionate amount of hardware resources.

This creates certain security for such systems.
2. Variants

Two variants of Proof-Of-Work protocols exist:

1. Challenge-response
2. Solution-verification
-> 1. Challenge-response

This variant can be used when a direct link between the prover and the verifier exists.

When the prover sends a request, the verifier chooses a problem to solve and asks the prover to do so.
The prover then has to spend computing power to solve the problem and answer the verifier.

If the verification is successful, the prover gets access to the service. If not, access is denied, or whatever the prover sent is not accepted. Image
-> 2. Solution-verification

This variant doesn't assume a direct link between the prover and the verifier.

There is no request, and the prover wants to prove that their work is valid.

The prover solves a problem that can be self-imposed.
It means that the prover has the choice of the problem.

The verifier must then verify both the problem and the solution before accepting the overall solution.

Bitcoin uses a modified version of this variant. Image
3. Usage In Bitcoin

Bitcoin uses a Proof-Of-Work protocol when new blocks are appended to the chain.

It makes up a considerable portion of Bitcoin's security.

To be precise, Bitcoin uses a solution-verification mechanism because the blockchain is a decentralized system.
The protocol Bitcoin uses is called Hashcash.

It's not the original Hashcash protocol but an adjusted version.

The general idea, however, is actually relatively simple.
Every block contains an irreversible cryptographic hash that considers the hash of all transactions within the current block, the previous block's hash, and a so-called nonce in the new block.

This nonce is a positive integer that the miners can freely choose. Image
The nonce is the only thing the miners can adjust to try and create a hash that fulfills the current difficulty requirements of the network.

You could say it's a number guessing game.

The nonce is set to a value, a hash is created and then checked for validity. Image
If it doesn't meet the requirements, the nonce is incremented, a new hash is created, and so on.

Bitcoin adjusts the original Hashcash system by using two continuous SHA-256 hashes instead of an SHA-1 one.
This leads to Bitcoin being able to freely adjust the difficulty so that not more than six blocks per hour are ever created on the blockchain.
Clients never have to guess the nonce.

They can simply verify that the leading zeroes within the hash actually represent the network's difficulty, and only then that the data presented to them creates the hash they see.
4. Critique

The guessing game associated with mining Bitcoins leads to a lot of energy consumption.

As many miners compete, many of them do the same work before one of them finds a fitting solution to the problem.
Proof-Of-Work protocols are, by design, meant to take a lot of time, and the increased energy consumption is a by-product of this.

There are alternatives that don't consume that much energy and that might currently look like a better alternative.
But, Bitcoin has never been successfully hacked.

This is something to take into account when thinking about whether Proof-of-Work is an excellent system to use.

Another protocol might need less energy, but it might also be more prone to being attacked and hacked.
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
21 Sep
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.
Read 23 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!

:(