Skip to main content

How Does Blockchain Work?

  

What is blockchain?

In short, a blockchain is a list of data records that works as a decentralized digital ledger. The data is organized into blocks, which are chronologically arranged and secured by cryptography. 

The earliest model of a blockchain http:// was created in the early 1990s when computer scientist Stuart Haber and physicist W. Scott Stornetta employed cryptographic techniques in a chain of blocks as a way to secure digital documents from data tampering. 

The work of Haber and Stornetta certainly inspired the work of many other computer scientists and cryptography enthusiasts - which eventually led to the creation of Bitcoin as the first decentralized electronic cash system (or simply the first cryptocurrency).

Although blockchain technology is older than cryptocurrencies, it was only after the creation of Bitcoin in 2008 that its potential started to be recognized. Since then, the interest in blockchain technology has been growing gradually, and cryptocurrencies are now being acknowledged on a larger scale.

Blockchain technology is mostly used to record cryptocurrency transactions, but it suits many other kinds of digital data and can be applied to a wide range of use cases. The oldest, safest, and largest blockchain network is Bitcoin, which was designed with a careful and balanced combination of cryptography and game theory.


How does blockchain work?

In the context of cryptocurrencies, a blockchain consists of a stable chain of blocks, each one storing a list of previously confirmed transactions.  Since the blockchain network is maintained by a myriad of computers spread around the world, it functions as a decentralized database (or ledger). This means that each participant (node) maintains a copy of the blockchain data, and they communicate with each other to ensure that they are all on the same page (or block).

Therefore, blockchain transactions occur within a peer-to-peer global network and this is what makes Bitcoin a decentralized digital currency that is borderless, and censorship-resistant. In addition, most blockchain systems are considered trustless because they do not require any kind of trust. There is no single authority in control of Bitcoin.

A central part of almost every blockchain is the process of mining, which relies on hashing algorithms. Bitcoin uses the SHA-256 algorithm (Secure hash algorithm 256 bits). It takes an input of any length and generates an output that will always have the same length. The output produced is called a "hash" and, in this case, is always made of 64 characters (256bits).

So the same input will result in the same output, no matter how many times the process is repeated. But if a small change is made to the input, the output will change completely. As such, hash functions are deterministic, and in the cryptocurrency world, most of them are designed as a one-way hash function.

Being a one-way function means that it is almost impossible to calculate what was the input from the output. One can only guess what the input was, but the odds of guessing it right are extremely low. This is one of the reasons why Bitcoin's blockchain is secure.

Now that we know what the algorithm does, let's demonstrate how a blockchain works with a simple example of a transaction.

Imagine that we have Alice and Bob along with their Bitcoin balance. Let's say Alice owes Bob 2 Bitcoins.

For Alice to send Bob that 2 bitcoin, Alice broadcasts a message with the transaction that she wants to make to all the miners in the network.

In that transaction, Alice gives the miners Bob's address and the amount of Bitcoins she would like to send, along with a digital signature and her public key. The signature is made with Alice's private key, and the miners can validate that Alice, in fact, is the owner of those coins.

Once the miners are sure that the transaction is valid, they can put it in a block along with many other transactions and attempt to mine the block. This is done by putting the block through the SHA-256 algorithm. The output needs to start with a certain amount of 0's in order to be considered valid. The amount of 0's needed depends on what's called the "difficulty," which changes depending on how much computing power there is on the network.

In order to produce an output hash with the desired amount of 0's in the beginning, the miners add what's called a "nonce" into the block before running it through the algorithm. Since a small change to the input completely changes the output, the miners try random nonces until they find a valid output hash.

Once the block is mined, the miner broadcasts that newly mined block to all the other miners. They then check to make sure that the block is valid so that they can add it to their copy of the blockchain and the transaction is complete. But in the block, the miners also need to include the output hash from the previous block so that all blocks are tied together, hence the name blockchain. This is an important part because of the way trust works in the system.

Every miner has their own copy of the blockchain on their computer, and everyone trusts whichever blockchain that has the most computational work put into it, the longest blockchain. If a miner changes a transaction in a previous block, the output hash for that block will change, which leads to all the hashes after it changing as well due to the blocks being liked with hashes. The miner would have to redo all of the work in order to make anyone accept his blockchain as the right one. So if a miner wanted to cheat, he would need more than 50% of the network's computing power, which is very unlikely. Network attacks like this are thereby called 51% attacks.

The model of making computers work in order to produce blocks is called Proof-of-Work (PoW) there are also other models like Proof-of-Stake (PoS) which do not require as much computing power and are meant to require less electricity while being able to scale to more users.

Comments

Popular posts from this blog

“How To” Start Trading The Forex Market? (part 3)

 10 REASONS TO START TRADING FOREX! More and more well informed investor and entrepreneurs are diversifying their traditional investments like stocks, bonds & commodities with foreign currency because of the following reasons: 1) FOREX is the largest financial market in the world. With a daily trading volume of over $1.5 trillion, the spot FOREX market can absorb trading sizes that dwarf the capacity of any other market. In fact, when compared with the $50 billion daily market for equities or the $30 billion futures market, it becomes quickly apparent this gives you, and millions of other FOREX traders, almost infinite trading liquidity and flexibility. 2) FOREX is a True 24-hour market. The FOREX Market never sleeps.  Trading positions can be entered and exited at any moment around the globe, around the clock, 5.5 days a week. There is no waiting for an opening bell as in the case of trading stocks. It is a 24- hour, continuous electronic (ONLINE) currency exchange that n...

Introduction To Forex Trading

 There are many markets: markets for stocks, futures, options and currencies. These are probably the most accessible markets for everyday traders like you and I. People easily understand the basics of trading shares. I began trading shares first and then I moved on to trading currencies. If you do not know a lot about currency trading, allow me to introduce it to you. It is what I trade and I believe that it is one of the best markets to trade because of its efficiency. The transaction costs to execute a trade are minimal and most brokers provide you with the tools and data you need to make your trading decisions, they usually provide them for free. The market is open 24 hours a day which allows you to design your trading hours around your daily commitments. It is very volatile, which is great for those people who are looking for day-trading opportunities.  The foreign exchange market is the market in which currencies are bought and sold against one another. People may loosely...

Basic Introduction To Forex Trading

 If you were wondering; forex trading is nothing more than direct access trading of different types of foreign currencies. A few years ago, foreign exchange trading was mostly limited to large banks and institutional traders however; today technological advancements have made it so that small traders can also take advantage of the many benefits of forex trading just by using the various online trading platforms to trade. The currencies of the world are on a floating exchange rate, and they are always traded in pairs Euro/Dollar, Dollar/Yen, etc. About 85 percent of all daily transactions involve trading of the major currencies. Four major currency pairs are usually used for investment purposes. They are: Euro against US dollar, US dollar against Japanese yen, British pound against US dollar, and US dollar against Swiss franc. Right now I will show you how they look in the trading market: EUR/USD, USD/JPY, GBP/USD, and USD/CHF. As a note you should know that no dividends are paid on...