Proof-Of-Work is the name of a cryptographic algorithm that is used for some blockchains when new blocks are to be appended to the chain.

Let's take a higher-level look at how this one works, shall we?

🧵🔽
1️⃣ The Basics

This algorithm 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 work the prover has to put in is moderately hard to very hard, while the verifiers can pretty easily 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 would have to put in a lot of work to get an answer, it would be very costly to send a multitude of requests or require a disproportionate amount of hardware resources.
2️⃣ Variants

Two variants of Proof-Of-Work algorithms exist:

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

This variant can be used when there is a direct link between the prover and the verifier. 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 provide its answer to the verifier. If the verification is successful, the prover gets access to the service. If not, access is denied or whatever was sent is not accepted.
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 some work they have done is valid. This variant is actually the one used by Bitcoin.
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.
3️⃣ Usage In Bitcoin

Bitcoin uses a Proof-Of-Work algorithm when new blocks are appended to the chain. It actually makes up a huge portion of Bitcoin's security. To be precise, Bitcoin uses a solution-verification mechanism as the blockchain is a decentralized system.
The algorithm Bitcoin uses is called Hashcash. It's not the original Hashcash algorithm but an adjusted version.

The general idea, however, is actually relatively simple. Every block contains an irreversible cryptographic hash that takes into account the hash of all ...
... transactions within the current block, the previous block's hash, and a so-called nonce in the new block. This is a positive integer that can be chosen by the miners. It 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 checked for validity. If it doesn't meet the requirements, the nonce is incremented, a new hash is created, and so on.
Bitcoin adjusts the original Hashcash algorithm 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 6 blocks are ever created per hour on the blockchain.
Clients never have to guess the nonce. They can simply verify that the leading zeroes within the hash actually represent the difficulty of the network and only then that the data presented to them creates the hash they see.
3️⃣ Critique

The guessing game associated with mining Bitcoins actually leads to a lot of energy consumption. As many miners compete with each other, many of them do the same work before one of them finds a fitting solution to the problem.
Proof-Of-Work algorithms 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 currently look like a better alternative.
4️⃣ The End

That's it for this thread. I hope you like this general overview of Proof-Of-Work algorithms and how one such application within Bitcoin generally works.

Feel free to leave your feedback, as usual!

• • •

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

25 Mar
Svelte has topped the satisfaction rankings of "State of JS 2020" some time ago, and this justifies an introduction for everyone still not aware of it.

An introduction to Svelte 💛

🧵🔽
1️⃣ What is Svelte?

Svelte is a component-based frontend framework like React and Vue, that promises:

- Less code
- No virtual DOM
- True reactivity

and delivers on all of these pretty well.
It currently has 41.2k stars on GitHub and an active community, including 359 contributors.

The community is pretty active and unlike React, there is no huge corporation backing it.

But no need to worry, Svelte won't vanish anytime soon.
Read 16 tweets
24 Mar
Let's take a look at the Jamstack,

the architectural approach that makes your websites faster, safer, cheaper, and all that with a better developer experience.

🧵🔽
1️⃣ What Is It?

The Jamstack is an architectural approach.

The letters "J A M" are an acronym and actually stand for:

▶️ JavaScript
▶️ APIs
▶️ Markup
🟢 JavaScript

JavaScript is the universal runtime of the web. Every browser can handle JavaScript and it's the language that brings interactivity to every modern-day browser.

JavaScript can either be written directly or act as a compile target.
Read 25 tweets
23 Mar
Here are _some_ of the most essential git operations you will need when working as a developer.

🧵🔽
1️⃣ Create A New Repository

This is the most basic command you'll need. When you start a repository locally, your start with git init.
2️⃣ Clone A Repository

You can clone a remote repository to get a local copy of it. Your local repository is connected to the remote one so you can pull in changes and push yours to the remote.
Read 15 tweets
22 Mar
Test-Driven Development

You hear some people talking about it, you might have a basic idea, but let's take a closer look because, in the end, it's not as difficult as it might seem from the outside!

🧵⏬
1️⃣ What Is It?

Test-driven development (short: TDD) is a software development technique.

Instead of writing all your code first and only then writing your tests, you start with tests, then code a little, then test again, and so on.
It is one specific form of the test-first approach and aims at making software development faster, more reliable, and safer to do. And it especially forces developers into a user role.

By writing tests first, you become a user. You are the first one to ...
Read 26 tweets
21 Mar
So many people say "learn the fundamentals", but sometimes it's difficult as a beginner to even remotely grasp what that means. And that's okay.

Let's talk about it, and let me give you some info on it (from my point of view).

🧵⏬
1️⃣ What Actually Are Fundamentals?

Fundamentals are concepts, and maybe even techniques, that you can apply in multiple areas and multiple programming languages.

They are not tied to anything specific and are sometimes pretty theoretical.
All in all, they are the foundation you can base more specific knowledge on.

All programming languages build on those fundamentals themselves and give you a very specific way to work with them.
Read 30 tweets
20 Mar
JavaScript keeps evolving every day, and there are many proposals currently in the pipeline that are going to make JavaScript even more awesome! 🔥

We'll take a look at one proposal that is currently in stage 2 and is going to bring native immutability to JS!

🧵⏬
1️⃣ The Records & Tuple Proposal

This proposal introduces two new types to JavaScript, namely Record and Tuple.

They are designed as compound primitives that can contain other (compound) primitives.

github.com/tc39/proposal-…
They are both deeply immutable, so you no longer need to Object .freeze() your objects or use libraries like Immutable .js to gain unchangeable objects, and do you know what's even more awesome?

You can compare them with the strict equality comparison (===), ...
Read 18 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!