Blockchain, cryptocurrency, and mining
Bitcoin (BTC), which first became popular in 2009, was not widely understood by many people. Blockchain technology was a relatively new concept. It was also, like many new concepts, poorly understood. Blockchain is still a hot topic in 2018. While it is often linked to cryptocurrency, it can also be used as a standalone concept. This article will explain how blockchains work, and also, what blockchain is and where it ends.
This post is an expanded and updated version of our 2017 cryptocurrency primer.
What is Blockchain?
Blockchain is used to create a ledger, which is a record of all historical transactions (e.g. financial transactions or messages). ).
The blockchain, as it is fundamentally known, is a chain or blocks of data that, at the most basic level (at most current implementations), can be conceptualised in a similar way to the diagram below. It is based upon the blockchain as well as Bitcoin’s famous implementation.
See more products : Magento POS, BigCommerce POS, Shopify POS, Woocommerce POS, Restaurant POS, NetSuite POS, Thailand POS, South Africa POS and Commercetools POS, system integration services, workflow management software, enterprise integration platform,
This implementation contains four pieces information in each block of data:
See our services : Backbase
Timestamp – The time the block was created.
Transaction root – This block contains details about the transactions contained within it – i.e. This section of the ledger. This section may contain a lot of data. In Bitcoin, for example, there will be about ten transactions per minute. Others use shorter windows.
Previous hash – This is the hash that links the blocks together. Once a block is processed, its hash will become the Previous Hash for the next block in a chain. This allows historical records to be linked and traversed.
Nonce A cryptographic term that refers to an arbitrary value that is used once in a transaction. We will discuss the purpose of this later.
The hash of a block, which is called the Previous Hash value within the next block, is the hashed total of all data in these four blocks taken together.
Is blockchain tamper-proof?
One truth about security is that no item is inherently tamperproof. It must be designed to make it difficult to tamper with and then protected with as many anti-tampering measures as possible. Therefore, it shouldn’t surprise that blockchains don’t have any additional safeguards to make them tamper-proof.
Distribution and decentralization is the first of these controls. This ensures that everyone has access to the ledger, and any transactions that are added to it. Tampering should be much easier to spot. All parties will notice if they have the same information. Any attempt to falsely report a transaction by less than a majority of those involved will be detected by the others who are honest in processing the data.
Blockchain is not more secure than any other data storage method because it does not allow for distribution or decentralization. One person can control all processing on a blockchain that is owned and processed only by him.
This is where we need a way for interested parties to communicate and verify the validity of new blocks submitted to the chain. Here is where implementations diverge. There have been three main approaches to implementations in the past:
Proof Of Work – This makes it difficult for others to verify that a valid block hash is calculated. After calculating a valid hash, the first person submits it to network. The other parties validate it before adding it to their chains.
Not-So-Famous Uses: Bitcoin (cryptocurrency); Monero(cryptocurrency).
Proof Of Stake Block creators are chosen pseudo-randomly according to their stake in the blockchain. This is used primarily by cryptocurrency because the stake is calculated based upon the currency each member holds.
Notable Uses: DASH, cryptocurrency; Ethereum (cryptocurrency), hybrid PoS/PoW
Practical Byzantine Fail Tolerance. This is a consensus-based system of ‘tolerating faults in data’ and automatically recovering. This article will not cover all details of the system.
Known Uses: Hyperledger fabric
A side note: All of the above solutions are for the risk of what’s known as a Byzantine fault. This is a fault in which there’s potentially incomplete or incorrect information that could lead to different faults being presented to the parties. (Be aware that each party does not know how many malicious participants are involved and that some of them, while ‘in” on any scheme to falsify the data, may only be malicious “approvers” of bad data, and not the generators.
Is it the right time to speak about mining?
Both yes and no.
Because we already have mining as Proof of Work.
Because mining is an artifact of cryptocurrencies that use the Proof of Work fault tolerance solution, it is not desirable for most other blockchain applications.
How can you prove that work is possible?
Proof of Work functions are based on setting a “difficulty goal” for the hash. This is a numerical goal that the hash must meet. Since hashes are always the same for the same data set, we must change some data to manipulate the hash value. This is where we use nonce.
The diagram below is a copy of the one on the en.bitcoin.it website:
Let’s reduce the amount of data in the Transaction Root, Previous Hash and Timestamp elements to the text “Hello, world!” – shown in red on the right and left sides of the diagram.
Let’s also create an arbitrarily difficult target that requires the hash to start with four zeroes.
This is achieved by concatenating a random piece of data (the nonce, shown blue) to the data we wish to record, and then hashing all the strings. If this fails to meet our difficulty target, then we add another nonce to the data we want to record and retry.
To hash “Hello, world!” to meet our ‘four zeroes difficulty target, we will need to repeat this 4,250 times. This would then be sent out to the network, who will validate our effort quickly by comparing our hash to their difficulty target. Remember that everyone checking our efforts should have a copy the same data we sent. If we cheat and use falsified data to generate our hash they’ll receive a different one.
It may sound like brute force, but it’s not. It’s easy to verify that the work was done legally, so the network can quickly reject or approve results.
First, think of cryptocurrency as an application that uses blockchains to store data. Remember that cryptocurrencies can be based on any one of the following fault tolerance approaches: Proof Of Work, Proof Stake or PBFT. However, all major implementations are PoW or PoS at the time this article was written.
Now we can discuss mining
We have already discussed that certain currencies are minable because they use Proof of Work fault tolerance. To encourage the user to perform the complex calculations required by PoW, the first person who generates a valid hash is awarded with the transaction fees (generally the amount of coins included in a transaction after a specified number of decimal places) or a new currency.
This led to a rush for these currencies, and, like anything that involves money, a rush for faster and better ways to mine them. This led to the creation of Application Specific Integrated Circuits, (ASICs), that are dedicated to mining Bitcoin. In April 2018, this translated into hash rates exceeding 30,000,000 terahashes per minute. This is 30 quintillion hashes per seconds across the entire network.
The Bitcoin network compensates by increasing the difficulty rate so that every ten minutes a new block is’mined. Remember that different PoW-based currencies have different target times for blocks.
The huge hashing rate made it impossible to use any other hardware (to the point that you would likely lose electricity). This table was again created using en.bitcoin.it/wiki data and manufacturer specifications.
|2017 Antminer T9 ASIC||0.126|
|2013 AMD 7870XT GPU||326.8|
|2011 Intel Core i5||~20,000|
Note : The 2013 AMD7870XT is the most powerful GPU that anyone has submitted a Bitcoin benchmark for.
This arms race has caused implementations to diverge again. Some cryptocurrencies have started to branch out to use a different Proof of Work algorithm. These can be grouped as:
CPU-Constrained Alphagorithms – These algorithms, such as SHA256, used by Bitcoin, require very little memory per instance ( 512 byte) and can be easily executed by inexpensively-made ASICs.
Bitcoin (SHA256), a well-known use:
Memory-Constrained Algorithms These are algorithms that use significantly more memory per instance, which can significantly increase the effort and cost of ASIC development.
Well-known Uses: Litecoin, Monero (CryptoNight),
We need to bring up the topic of malicious miners. The prospect of easy financial rewards often goes hand in hand with malicious activity.
This blog has previously discussed malicious mining, and in particular the rise of Monero-mining malware during 2017. Monero’s memory-constrained CryptoNight algorithm was specifically designed to work better on home computers than ASICs. The CryptoNote design specification states that the following is true:
[CryptoNote] aims to make GPU and CPU mining nearly equal efficient, and limit ASIC mining.
It appeals to malicious actors who want to install miners on their home PCs. This can be done via either traditional malware that executes on the PC directly or later through in-browser miner miners that run when the user visits a webpage that has the miner embedded. The latter will be discussed in detail in our next blog post.