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? ›

A blockchain is a distributed, immutable, and decentralized ledger at its core that consists of a chain of blocks and each block contains a set of data. The blocks are linked together using cryptographic techniques and form a chronological chain of information.

How does a blockchain 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.

What is blockchain answers? ›

Blockchain technology is an advanced database mechanism that allows transparent information sharing within a business network. A blockchain database stores data in blocks that are linked together in a chain.

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 a blockchain in simple terms? ›

What is blockchain? Blockchain is a shared, immutable ledger that facilitates the process of recording transactions and tracking assets in a business network. asset can be tangible (a house, car, cash, land) or intangible (intellectual property, patents, copyrights, branding).

What is a blockchain for beginners? ›

Broadly speaking, a blockchain is a highly secure, communal chain of data that helps business networks exchange assets, store information, and record transactions.

What is the purpose of a blockchain? ›

Blockchain is a tamper-proof, sequential ledger based on cryptographic principles. It's designed to create trust in the timeliness, accuracy, security, and speed of transactions.

What are the 5 elements of the blockchain? ›

What is blockchain? True blockchain has five elements: Distribution, encryption, immutability, tokenization and decentralization.

Is blockchain safe to use? ›

Access to the database is protected by financial-grade public key encryption. These features earn the blockchain architecture a spot among the most secure databases ever created.

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.

How do you explain blockchain to a child? ›

Blockchain is essentially a network of computers, or "nodes," that share the same transactional history. The information is now dispersed throughout the entire network rather than being held by a single organization or database.

What is the primary function of a blockchain? ›

The purpose of the blockchain is to share information amongst all parties that access it via an application. Access to this ledger in terms of reading and writing may be unrestricted ('permissionless'), or restricted ('permissioned').

What is blockchain the blockchain for beginners? ›

Distributed ledger technology (DLT), also known as the blockchain, is a distributed database that maintains a continuously growing list of digital transactions. Transactions are spread across many nodes in the network, making it difficult for anyone to tamper with them.

How does blockchain work step by step? ›

Following are the steps for Blockchain working: The sender initiates a transaction and signs it with her private key. The transaction request is broadcast to the transaction pool. Miners pick transactions out of the transaction pool to verify them.

What is a real life example of a blockchain? ›

Hospitals have moved away from paper for record-keeping, and they use blockchain technology to store patient data, which is kept confidential. The patient will be given a digital ID or a number key to access these records.

Who owns a blockchain? ›

In the simplest terms, a blockchain is formed by stringing together different blocks. Each 'block' is a set of data or some kind of information – most commonly, transactions. Nobody 'owns' blockchain technology.

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.

How do you receive money from blockchain? ›

Click Receive button and choose the crypto you'd like to receive from the list or use the search field. Next, you will see your unique crypto address and a QR code. Copy the address or scan the QR code when sending crypto from another wallet, exchange etc.

What is the difference between cryptocurrency and blockchain? ›

Blockchain is a storage technology used for saving data on decentralized networks. Cryptocurrency is a medium of exchange like the US dollar. A blockchain can be used for storing different types of information beyond cryptocurrency transaction records. All cryptocurrencies have a monetary value.

Top Articles
Firewall Change Automation | Tufin
Best Soccer Formation| Formation in Football | Cupello
Use Copilot in Microsoft Teams meetings
855-392-7812
Http://N14.Ultipro.com
Stadium Seats Near Me
Valley Fair Tickets Costco
Chalupp's Pizza Taos Menu
Melfme
Words From Cactusi
Needle Nose Peterbilt For Sale Craigslist
Katie Boyle Dancer Biography
123 Movies Babylon
Taylor Swift Seating Chart Nashville
Synq3 Reviews
The fabulous trio of the Miller sisters
Restaurants Near Paramount Theater Cedar Rapids
Gon Deer Forum
Google Flights Missoula
Zack Fairhurst Snapchat
Invitation Homes plans to spend $1 billion buying houses in an already overheated market. Here's its presentation to investors setting out its playbook.
Mail.zsthost Change Password
The Ultimate Guide to Extras Casting: Everything You Need to Know - MyCastingFile
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
Rs3 Ushabti
Walgreens Bunce Rd
Vivaciousveteran
Breckiehill Shower Cucumber
Hefkervelt Blog
Tracking every 2024 Trade Deadline deal
Delta Math Login With Google
Otis Inmate Locator
Obsidian Guard's Skullsplitter
DIY Building Plans for a Picnic Table
Emiri's Adventures
The Menu Showtimes Near Amc Classic Pekin 14
Emily Katherine Correro
Sports Clips Flowood Ms
Jennifer Reimold Ex Husband Scott Porter
USB C 3HDMI Dock UCN3278 (12 in 1)
Rochester Ny Missed Connections
Ktbs Payroll Login
Compare Plans and Pricing - MEGA
Sukihana Backshots
SF bay area cars & trucks "chevrolet 50" - craigslist
Stewartville Star Obituaries
11526 Lake Ave Cleveland Oh 44102
Wal-Mart 140 Supercenter Products
Accident On 40 East Today
Christie Ileto Wedding
Used Sawmill For Sale - Craigslist Near Tennessee
2487872771
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 5815

Rating: 5 / 5 (80 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.