Trader logo

The Concept Of Double Spending

What Is Double Spending?

By Daniel Joseph Published 2 years ago 10 min read
1
The Concept Of Double Spending
Photo by Quantitatives on Unsplash


Double spending can be defined as an activity when an individual transacts more money than the required amount. Most currencies online face this issue. Traditional currencies keep check on such problems by paying real cash or acquiring the help of reputed third-party organizations like banks, credit card services, PayPal, etc., which all transact the amount and record the changes in the account balances based on the transactions.

However, Bitcoin functions in an open digital world, where third-party organizations do not influence or monitor it. Its philosophy counters the traditional approach we witness in the financial world. Thus, if I say to you that I have 20 Bitcoins with me, how will you come to know that I am not lying about it?

Thus, to keep everything in check, a public ledger was fabricated that records all the transactions. This public ledger is referred to as BlockChain. I will discuss it in detail in later chapters. This public ledger lets you trace all the Bitcoin transactions right from the very first time they were recorded.
But Bitcoin is a digital currency, and is not monitored by any intermediaries. This technology’s philosophy counters the monitoring activities practiced by third party enterprises. So, if you say that you own 25 Bitcoins, how will I trust that you are being honest or not? The solution is that public ledger with records of all transactions, known as the blockchain. (We will learn about it later.) There is no way you can lie about the number of coins in your possession, when this technology fabricates a way to trace every transaction right from the start.

Thus, for every Bitcoin transaction, miners go through the ledger and check for malicious practices of double spending. If everything is found perfect, the transaction is validated and recorded in the public ledger. It sounds simple, but it is not. A public ledger accompanies a few problems:
Privacy is the first issue. How can one make sure that the exchange of Bitcoins retains transparency while not disclosing their identity?

The other problem is security. If we talk about a public ledger that is open for all, how is it possible to prevent people from using it for their capital exploitations?
Well, to answer these issues, first you should know that a Bitcoin miner does not own an account in which to keep his/her Bitcoins. Now coming to privacy, the cryptocurrency ledger manages to overcome the issue of privacy by using a deceptive technique. This ledger functions as a record keeper for the transactions only. It does not keep a record of the Bitcoin balance or account. This way, all user information remains discreet.
Let me explain how it works with an example:

Let us assume that Rick needs to transfer a Bitcoin to Morty. To accomplish this, Morty will generate an address virtually so that Rick can transact money, including an encryption key, to that address. The process is similar to an account with a password. The only difference is that Morty (the receiver) will open a new virtual address and a key for every new transaction. It is not necessary to do so, but to keep everything secure it is recommended that the transaction is done like this.

Now, when Rick clicks the send button to transact the money to Morty, the transaction changes into an encrypted code containing the amount and Morty’s virtual address. This transaction is also transferred to all Bitcoin miners on the internet, which includes all computers running the software for mining. Once the miners figure out that the transaction is authentic, it gets validated and recorded to the ledger. Let us conclude that the ledger authenticated and recorded the transaction.

Now, let us assume that Morty wants to send one Bitcoin to Jeremy. So, Jeremy validates a virtual address and an encryption key. Morty eventually transacts the Bitcoin by using the key and address that Rick gave him, and sends it to Jeremy. Just like before, the transaction is sent to all the miners for validation. The miners evaluate the transaction via a reference number that points to the previous transaction from Rick to Morty. This is to ensure that Morty did not make any other transactions after that, which we call Double Spending. After the transaction is authenticated, every miner sends and receives a message of validation from every other miner. Similarly, the transactions for Morty and Jeremy are also validated for track keeping in the ledger.
This is how transactions in the Bitcoin world work. People transferring Bitcoins (or Bitcoin fractions) to one another. The ledger keeps track of the Bitcoins, but not the people or their balances. As a user creates a new key and address every time, the ledger will not be able to identify him/her, his/her addresses, or the number of coins he/she possesses. Thus, we define it as a transaction record that moves from one anonymous user to another. Now, moving towards a solution for security:

The primary step that Bitcoin currency takes for securing the public ledger is decentralizing it. There is no sign of a master document or a large spreadsheet secured on a server. Instead, the public ledger is divided into chunks of blocks, which are hidden logs of transaction that contain Bitcoins in batches. Plus, every new block accompanies a reference to its previous block. This way, a user can follow the reference links and locate the very first one, when Satoshi Nakamoto designed this whole concept and Bitcoins were born.
We refer to this long chain of blocks as blockchain, which incorporates the public ledger for Bitcoins. As mentioned in previous chapters, each new block takes 10 minutes to mine, expanding it into a long chain over time.

You should know that every miner of Bitcoins possesses a copy of the complete blockchain on his/her computer. If the user/miner switches off his/her computer for some time and then powers it on once again, his/her computer sends a message to all other miners requesting they share all the blocks that were created during this period of inactivity. Therefore, there are no special privileges given to any particular miner or computer. Also, no specific miner keeps a record of all the updates related to the blockchain. The information is held in check by the numerous miners, publicly.

Factors That Influence Mining

As the activity of mining is intricate, it is prudent that you choose the right hardware. One has to keep in mind specific factors that affect the overall performance of a Bitcoin mining process. Let us discuss each factor.
Hash Rate:

Hash rate can be defined as the number of calculations performed by the hardware in one second. This rate is of high significance, as the higher the hash rate number, the faster the calculations, which will close the block and reward you much quicker. Miners keep a look-out for a particular output from the hash function. For the hash functions, the same output is generated for the same input, yet they have been fabricated to show erratic behavior. Thus, miners try several random inputs to find a particular output for the hash function. You should understand that the competition in mining is robust, so to obtain a reward, a miner needs to search through all the random inputs as fast as possible. Thus, a higher hash rate facilitates faster search output – thus increasing the probability of being rewarded.

To measure hash rates, we use the unit MH/s (megahashes per second), GH/s (gigahashes per second), and TH/s (terahashes per second). You may have already seen these units displayed above, but now you understand their importance. Furthermore, a hardware’s hash rate is particularly fabricated for Bitcoin mining, which can range from 336 MH/s to 14 million MH/s.

Consumption Of Energy:

The next factor of importance in Bitcoin mining is the investment in power input. Powerful hardware that you are planning to use for computations is going to need a convenient supply of electricity (energy). Before proceeding, you will need to understand the energy consumption of the hardware in watts. Plus, you will have to calculate your electricity bill as per the predicted number of watts. This calculation will help you to anticipate whether your investment in mining Bitcoins is less than the rewards you are going to earn or not.
Utilizing the consumption of energy and hash rate in numbers will help you figure out the number of hashes that you receive for each watt expended by your hardware. For achieving the numbers, you can divide the hash rate by the watts.

Here is an example:
Assume that the hash rate of your hardware is 4,000 MH/s with a requirement of 30 watts, so the consumption of energy will be 133,333 MH/s per watt. You can even use an electricity rate calculator online, or simply check your electricity bill to know the actual cost of your investment in the power supply for your hardware.

Hardware:

At one time, the concept of Bitcoin was too good to be true. People from a multitude of regions and cultures were attracted to this financial technology that offered freedom. There was no role of a centralized network, which relaxed users. Now, they had the power to check their transactions through an autonomous system that did not function through corporations, tax authorities, banks, and other third-party organizations. There is no one to keep an eye on how one spent his/her own money.

Moreover, in the past few years, the value of Bitcoin was not motivated by mere profit, but was admired due to the unique concept and philosophy it followed. Back then, computers were all that were needed to transact and calculate the exchange of Bitcoins. As technology advanced, miners found that better GPU processors were able to calculate and mine Bitcoins at a faster rate. In fact, the results were almost 100 times more efficient than previously. Thus, mining hardware manufacturers came into existence, and they started designing hardware specifically for this purpose. This conclusively gave birth to the concept of cryptocurrency mining.
Nowadays, mining Bitcoins has become quite profitable. Many are even paying their regular bills through the rewards generated using mining of Bitcoins. The mining farms consist of graphic card processors and cooling units to keep the computation running continuously.
Apparently, a mining farm will require a vast supply of power, which is not usually available to individual miners. Thus, the big corporations invest in the energy utilization and virtually gather limitless resources to create mining farms. However, there is still a way for individual miners to make a profit. And that is by joining with other miners and combining their power. This is known as a mining pool.

Proof Of Work

You should also be familiar with the phenomenon ‘proof of work’ in the mining industry. A Proof of Work is a part of data that is quite time-consuming, costly and difficult to produce. It is needed for acknowledging particular needs. However, it has to be more streamlined to check whether it satisfies the specific requirements or not. Production of a POW can be formulated randomly with reduced probability. Lowering the probability results in more chances of trial and error, which is essential to validate before generating a proof of work. Bitcoin uses a hash cash proof of work system, in particular.
The hash cash method used in Bitcoin mining helps reduce spam emails, as the sender will have to provide a valid proof of work in the contents of the email, including the To address.

Any legit email can show the proof without any difficulties. On the contrary, spam emails will not be able to do so, as there is a need for computations for generating the proof. In the Bitcoin system, the hash cash proof of work generates blocks. This proof of work is attached to an individual block’s data so that it can be validated. Its difficulty is also regulated so that there is a limit on the generation of new blocks. Thus, each block generation takes roughly 10 minutes. Moreover, as the probability is set at a low value, the success of a generation of proof of work becomes unpredictable, as there is little information about the particular computer that will be generating the successive block.
Also, there is a requirement for validating a block, which is based on a lower hash value than the present target. In other words, every block that generates consists of the hash value from the previous block. This results in the chain of blocks that together incorporate a lot of computational work to produce Proof of Work.

Furthermore, altering a block will require reworking on all the following blocks. This way the blockchain remains safe from being tampered with.

personal finance
1

About the Creator

Daniel Joseph

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments (1)

Sign in to comment
  • Obajuwon Israel2 years ago

    Wow so illustrative, I got it

Find us on social media

Miscellaneous links

  • Explore
  • Contact
  • Privacy Policy
  • Terms of Use
  • Support

© 2024 Creatd, Inc. All Rights Reserved.