How Does a Blockchain Work? | Consensys (2024)

How Does a Blockchain Work? | Consensys (1)

BLOCKCHAIN EXPLAINED BY JOE LUBIN

How Ethereum Differs from Bitcoin

How the Bitcoin Blockchain Works

A Spreadsheet Analogy

Imagine a blockchain as a spreadsheet. Everyone has access to the data within each individual cell and saves a copy to their personal computer. The data within the spreadsheet is shared between multiple people. However, nobody can alter an individual cell or change the existing information. In the blockchain world, we call this “immutable”—the inability to change or modify something over time. Now, imagine you wanted to add a new cell to the spreadsheet. This would require approval from members who have access to the spreadsheet data. Once a majority of the spreadsheet owners approve the new cell, the data would then be added to the main spreadsheet.

Back to Bitcoin

As an aside, you’ll notice us use “Bitcoin” with an uppercase B to refer to the overall blockchain and “bitcoin” with a lowercase b to refer to the Bitcoin network’s cryptocurrency. Next, let’s apply the above concepts to further understand how the Bitcoin blockchain works. If Alice traded one bitcoin to Bob, that transaction would be recorded in the Bitcoin blockchain ledger. Viewing the ledger would show how much bitcoin was exchanged when the transaction occurred, and the corresponding bitcoin addresses of Alice and Bob that sent and received the transactions.

Bitcoin Miners

Once a transaction has been made, it must be verified by people called miners. When a transaction occurs—such as Alice’s transaction with Bob—it is grouped together in a mathematically protected “block” with other transactions that have happened in the same time frame. Miners then use computers with incredible computing power to solve the block mathematically. The first miners to solve the block and validate the transactions are rewarded with bitcoin. This is the only way that bitcoin can be created. Finally, each block is connected to the previously verified block, creating a chain of blocks, hence the name blockchain (we know, super creative). One more thing that you need to understand about the blockchain is that it is immutable, which means, once the data has been added into a block, it can never (like never ever) be changed. In a practical application, once Alice trades her bitcoin and the transaction is verified, she cannot get it back or cancel the trade. It’s gone. However, it is worth noting that this benefits individuals and businesses that deal with credit card transaction, which aren’t settled until later dates. A malicious individual, using a credit card could purchase an item and then cancel the transaction leaving an individual or business with lost revenue.

Consensus Algorithm

When Alice trades her bitcoin to Bob, the transaction is represented as a block, which needs to be broadcasted to the blockchain network. The blockchain network is comprised of nodes or participants of the network that validate and relay transactions to transmit information. All nodes are operated voluntarily and are used to verify the correct transactions on the blockchain. Nodes follow consensus rules, which are rules that are agreed upon by the community. A change in the consensus rules requires 95% of the community to approve, which makes it incredibly difficult for one group to change the Bitcoin software. Other consensus algorithms require a lower percentage to change the software protocol. Nodes relay block transactions and validations to other nodes so that the network remains updated. Nodes do not mine bitcoin. However, all miners typically run a full node to validate and relay bitcoin transactions effectively. Since both miners and non-miners execute validation and relay by operating nodes, they all participate in the consensus process.

Bitcoin Mining

Bitcoin miners verify legitimate transactions and create new bitcoin as a reward for their work. A transaction is considered verified once the miner solves a cryptographic (mathematical) puzzle. Bitcoin uses a protocol called proof of work, which has a broad goal to prevent cyber attacks from any single entity or group. More specifically, Bitcoin uses the Secure Hash Algorithm 256 bit (SHA-256). Computer chips can run the SHA-256 algorithm to generate an output, which is referred to as a “hash.” Hashing, the process of creating multiple hashes, is used to solve the mathematical problem, in which the end answer is the known and expected hash value.

A Simplified Example

  • To solve the problem, the hash value has to begin with three zeros: “000”

  • The input then varies every number finding a match for a “Solution”

  • It takes 6,518 tries to find a value that has “000” in the first three digits.

Solution 1 ———088djldkh2h5h3kjhk24gd5h2h5h3kjhk24gd5kh2h5h

Solution 2 ———73485jfljroi5635h3kjhk24gd5we94ee356h2hkh2h5h

Solution 3 ———d89sdf8sge9nxc894opl8qjroi5635h3kjhk24gd5we94

……

Solution 6517 ———088djldkh2h5h3kjhk24gdjroi5635h3kjhk24gd5we

Solution 6518 ———00088djldkh2h5h3kjhk24gdjhk24gd5h2hk24g4f4

Given the input of “Solution 6518,” any miner could verify that this undeniably creates a hash with three zeros in the first three digits. The first miner to solve this problem would broadcast their answer to the network and be rewarded with bitcoin. The block would then be considered verified, and it would be added to the blockchain. This puzzle is a representation of the type of puzzle a Bitcoin miner would need to solve and not a real puzzle.

Confirmation Difficulty

A standard Bitcoin block requires millions of hashes to solve the puzzle. In the Bitcoin blockchain, the complexity of the puzzle changes every 2,016 blocks to ensure that the average block confirmation time takes ten minutes. Therefore, it is possible for the problem to become easier to solve if confirmations are consistently taking longer than ten minutes. Although, usually the problems become more challenging to solve, which has made it very expensive and highly time intensive to confirm blocks. Initially, bitcoin could be mined using consumer-grade computing chips. However, due to this increase in difficulty, bitcoin mining currently requires enormous hashing power, and the industry utilizes application-specific integrated circuit (ASIC) chips. ASICs are customized specifically for bitcoin mining, rather than general-purpose functions. These chips are also incredibly expensive, which has resulted in a select group or pool of miners that dominate the lion’s share of the bitcoin mining activity.

Block by Block

Another important aspect is that each block contains the solved hash from the parent or previous block. Each new block requires the parent block’s hash, ensuring a chronological block order. For instance, block 30’s hash is necessary for block 31. Block 31 cannot exist until block 30 has been verified and added to the blockchain. This guarantees that each block is connected all the way back until the first block, which is commonly referred to as the “genesis block.” To change any single block would require changing every preceding block, simultaneously. Lastly, each block is immutable, which again, means that once a transaction occurs, it cannot be reversed. This further ensures that once added the blocks within the blockchain cannot be altered.

Supply

The supply of Bitcoin is limited to 21 million bitcoins, which is estimated to occur around the year 2140. The amount of bitcoin rewarded to miners is halved every 210,000 blocks. Therefore, the reward will continue to split until the twenty-one millionth bitcoin is created, at which point miners will only receive transaction fees.

Why Don’t Miners Cheat?

Bitcoin is deeply rooted in cryptography, computer science, economics, and various other disciplines. One of those disciplines happens to be game theory, which uses mathematical models to predict how rational players will react when given individual choices or situations. Bitcoin utilizes game theory concepts to incentivize the desired action of miners and users.

How the Ethereum Blockchain Works

The Ethereum blockchain functions similarly to the Bitcoin blockchain, but with several important differences.

Accounts: Wallet Addresses

There are two types of Ethereum accounts:

  • Contract Accounts

  • Externally Owned Accounts (EOAs)

Externally Owned Accounts are similar to Bitcoin addresses and are controlled by private keys. Ethereum accounts also have both public and private addresses for users to interact with to transfer ether. Contract accounts, which are used to communicate with smart contracts, are controlled by their contract code and are activated through an EOA. Ether is required for every transaction on the network (contract accounts and EOAs) to prevent malicious attacks, such as network spamming.

Transactions

The Ethereum network requires users to pay a transaction fee when using the blockchain. This protects the Ethereum blockchain from frivolous or malicious computational tasks, such as users spamming the network with an overload of useless transactions. The more complex the transaction (more lines of code), the more expensive the fees. These fees are paid in ether (ETH) and are referred to as the “gas price.”

Ethereum Network

Like bitcoin, Ethereum utilizes nodes that are operated voluntarily in order to verify the correct transactions on the blockchain. Nodes hold information such as:

  • the entire Ethereum transaction history

  • the most recent information about the state of smart contracts

  • the balances of accounts

  • and much more

There Are Two Types of Nodes

  • A full node synchronizes the blockchain by downloading the whole chain, from the genesis block (first block) to the current block.

  • A light node does not download the entire chain, but can still effectively verify transactions.

Nodes do not mine the Ethereum blockchain. However, all miners typically run a full node to validate and relay Ethereum transactions effectively. Since both miners and non-miners execute validation and relay by operating nodes, they all participate in the consensus process.

The Ethereum Virtual Machine

At the foundation of these programmable applications is the Ethereum Virtual Machine (EVM), which is the executable and trustless environment for smart contracts. The EVM executes a contract with whatever rules the developer initially programmed, such as sending money from Alice to Bob. The network is made up of thousands of computers processing the execution of the programs. Therefore, each node in the Ethereum network is actually running the EVM, and consequently, each node executes the same code. The EVM can execute these programs through a bytecode language. However, developers are also able to use the Ethereum programming language Solidity to write smart contracts and other more advanced applications.

How Does Ethereum Mining Work?

Ethereum miners verify legitimate transactions and create new ether as a reward for their work. A transaction is considered verified once the miner solves a cryptographic (mathematical) puzzle. Similar to Bitcoin, Ethereum uses a proof of work (PoW) protocol, which has a broad goal to prevent cyber attacks from any single entity or group. One notable difference between Bitcoin mining and Ethereum mining is the block confirmation time. While a Bitcoin block confirmation requires an average of 10 minutes, an Ethereum block is confirmed in about 14 seconds. And just like Bitcoin, the algorithm automatically adjusts the difficulty of the cryptographic problems so that the average block time is 14 seconds. With Bitcoin, miners often work to mine the same block and sometimes those blocks are confirmed at very similar times, in which case the first one is a reward and added to the existing chain, while the second confirmed block is called an “orphan.” In Bitcoin, the orphaned blocks are mostly useless and not part of the main chain. Ethereum operates using a similar concept called the GHOST (Greedy Heaviest Observed Subtree) protocol, which essentially means the chain with most computation done upon it (not necessarily the longest) is the main Ethereum blockchain. Ethereum’s fast block time results in an increase in the number of orphaned blocks, which are referred to as “uncles” on the Ethereum blockchain. The main difference is that Ethereum incentivizes mining uncles and provides a reward, as opposed to Bitcoin, which only rewards the first confirmed block.

Mining Uncles Provides Two Significant Benefits

  • It decreases centralization by incentivizing individual miners to mine orphan blocks meaning they don’t have to be part of a large mining pool because they can still receive a reward.

  • It increases the security of the chain because all blocks, including uncles, have to follow the same mining protocol, which increases the amount of work on the main (heaviest) chain.

Proof of Stake

The Ethereum network currently uses the proof of work algorithm and will be transitioning to using a proof of stake algorithm called Casper. Proof of stake (PoS) is a consensus algorithm that requires each miner to own a stake in the native currency, ether in this case. It is worth noting that not all PoS protocols are the same, but are similar in regards to the basic concept. Proof of work (PoW) protocols, such as Bitcoin, reward mining effort (validations) with individual bitcoins. The Proof of Stake Casper algorithm is a smart contract, in which the miners—now referred to as “validators”—must send a deposit or “stake” to the Casper contract. The validators or stakers now take turns proposing and voting on the next block, each having one vote per block. The votes are also weighted by the amount of stake, so a validator who stakes 100 ETH will have a more meaningful vote than a validator who stakes 40 ETH. If these validators produce anything that the Casper protocol considers invalid, then the validators lose their stake, which incentivizes validators to follow consensus.

What Is Ether?

Let’s say you want to buy ether, the cryptocurrency native to the Ethereum blockchain. The simplest way to do that would be to set up an account on one of many widely-used cryptocurrency exchanges, like Coinbase or Kraken. These exchanges allow you to set up an Ethereum wallet so you can buy, sell, send, and receive ether from anyone else who also has a blockchain wallet that can send and receive ether.When you purchase ether, your transaction becomes part of a block on the Ethereum blockchain. This block contains a record of the most recent Ethereum transactions that have taken place anywhere in the world by anyone running the Ethereum protocol. It also includes a cryptographic hash (a mathematical algorithm) record of the most recently validated block on the Ethereum blockchain.This block with your transaction record won’t become part of the Ethereum blockchain until one of the many computers running the Ethereum network solves or discovers the cryptographic hash matching the unique hash tied to that block. This solving process is commonly known as “mining.” When the hash is solved or discovered, the block with your transaction record is instantly added to the end of the blockchain that’s maintained by every one of those computers, and your transaction becomes part of the Ethereum blockchain’s permanent record.It’s worth noting that “ether” and “Ethereum” are often used interchangeably to refer to the cryptocurrency that operates on the Ethereum blockchain. This is not technically correct, as ether is the term for the cryptocurrency token used on the Ethereum blockchain platform. If we were to represent this relationship in terms of computer software (which it is), Ethereum would be the operating system, and ether would be the application. In a non-computer software analogy, Ethereum is comparable to a vehicle while ether acts as the fuel that powers and enables the machine to run efficiently.

How Does a Blockchain Work? | Consensys (2024)

FAQs

How Does a Blockchain Work? | Consensys? ›

Where a standard ledger exists on one computer or server, a distributed ledger exists and is updated simultaneously on every computer in the network (every individual and organization that uses the ledger). A blockchain is, therefore, a type of decentralized ledger, which operates on a peer-to-peer network.

How does blockchain work step by step? ›

How does blockchain work?
  1. Step 1 – Record the transaction. A blockchain transaction shows the movement of physical or digital assets from one party to another in the blockchain network. ...
  2. Step 2 – Gain consensus. ...
  3. Step 3 – Link the blocks. ...
  4. Step 4 – Share the ledger.

What exactly is blockchain and how does it work? ›

A blockchain is “a distributed database that maintains a continuously growing list of ordered records, called blocks.” These blocks “are linked using cryptography. Each block contains a cryptographic hash of the previous block, a timestamp, and transaction data.

How do you explain blockchain to dummies? ›

'Blockchain' is a compound word– here the 'blocks' are the records of data, and the 'chains' are the links each record has with each other. It's a democratizing technology, in that it makes everyone equally accountable and equally in control (at least in the case of public blockchains– but more on that later).

What is blockchain explained very simply? ›

Blockchain technology is a decentralized, distributed ledger that stores the record of ownership of digital assets. Any data stored on blockchain is unable to be modified, making the technology a legitimate disruptor for industries like payments, cybersecurity and healthcare.

How do blockchains make money? ›

Most Blockchain businesses make money by using the software as a Service – Companies such as Tierion and Block cypher charge a fee for using their API and infrastructure with the help of professional services. Some companies build custom projects for enterprise clients.

What is a real life example of a blockchain? ›

A real world business example of blockchain in supply chain management would be Walmart tracking produce from suppliers. Blockchain allows for more transparency between the parties to help manage waste, contaminations, and timing of overall items within their supply chain, (FoodLogistics.com).

Where is blockchain data stored? ›

The data stored in a blockchain is decentralized, meaning that it is not stored in a single location or controlled by a single entity. Instead, the data is stored on multiple devices, or “nodes,” which are connected to the blockchain network.

Is blockchain only for money? ›

After all, any kind of data can be stored in a blockchain, not just financial records.

How many blockchains are there? ›

This article will explore the expansive and diverse world of blockchain technology, delving into the over 1,000 distinct blockchains that exist as of 2024, each offering unique functionalities for various industries.

Why do we need blockchain? ›

Without blockchain, each organization has to keep a separate database. Because blockchain uses a distributed ledger, it records transactions and data identically in multiple locations. All network participants with permissioned access see the same information at the same time, providing full transparency.

Where does blockchain's security come from? ›

It uses cybersecurity frameworks, assurance services and best practices to reduce risks against attacks and fraud. Blockchain technology produces a structure of data with inherent security qualities. It's based on principles of cryptography, decentralization and consensus, which ensure trust in transactions.

How does money move in the blockchain? ›

Blockchain tracks the movement of money between wallets through a decentralized ledger system. Each transaction is recorded on a block, which is then added to a chain of blocks in a chronological order. This chain of blocks is maintained by a network of computers (nodes) that validate and verify each transaction.

Who can view the blockchain? ›

Public blockchains allow anyone to view transaction amounts and the addresses involved. If the address owners become known, the user loses their anonymity.

Who invented blockchain? ›

The first decentralized blockchain was conceptualized by a person (or group of people) known as Satoshi Nakamoto in 2008.

Who adds a block to the chain? ›

The process of creating a block is called mining, and it involves solving a complex mathematical puzzle that requires significant computational power. Miners compete with each other to be the first to solve the puzzle and add the next block to the blockchain.

What are the seven steps of a blockchain process? ›

7 Steps to Integrate Blockchain for Your Business
  • Identify Needs & Objectives. ...
  • Evaluate Blockchain Platforms. ...
  • Develop a PoC. ...
  • Collaborate with blockchain experts. ...
  • Design the blockchain architecture. ...
  • Develop & Test. ...
  • Deploy & Integrate.
Jul 5, 2023

How do beginners get into blockchain? ›

If you're new to blockchain technology or programming, consider learning one of the more popular languages, such as Solidity or Ethereum. These languages are general purpose and make it easy to develop decentralized applications (dApps) on top of the blockchain.

Top Articles
Which online English teaching platform pays most? | ✔️ ✔️ ✔️ TESOL FAQs
Which is Better: Gold, Platinum or Titanium Credit Card?
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Msgr. Benton Quitzon

Last Updated:

Views: 5752

Rating: 4.2 / 5 (63 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Msgr. Benton Quitzon

Birthday: 2001-08-13

Address: 96487 Kris Cliff, Teresiafurt, WI 95201

Phone: +9418513585781

Job: Senior Designer

Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.