Bitcoin – Double Spending And Mining Explained

Bitcoin – Double Spending And Mining Explained

In today’s article, we’re going to go a little deeper and dive into Bitcoin’s functionality and how it really works. So, in simple English, Bitcoin is a ledger or digital-file that holds account numbers and their balances. Now the way people exchange these digital coins is by altering this file. Let’s say Bill sells Samantha his couch for 1 Bitcoin, Bill’s account balance will naturally increase by 1 Bitcoin, and Samantha’s will decrease by 1 Bitcoin. (Obviously a couch would cost something like 0.027 BTC but for the sake of this example let’s keep it to one unit.)

 

Now what really sets apart this transaction from your regular Credit Card transaction, is that there’s no government or gold-backed issued money behind these numbers – they are purely digital. Bill only wants to give Samantha his couch away for a larger sum in his digital ledger – all in good faith other participants will trust Bitcoin’s decentralized system. But, who maintains and updates this digital-file to ensure that there are no cheaters?

 

Well, one of the main reasons Bitcoin was created was to try and avoid centralized control, so this means that every participant has to maintain and update their own version of the universal-ledger. As a result, everyone sees everyone’s account balances, but the great thing about Bitcoin’s digital-system is that it uses account numbers and not people’s real names, so to a certain extent there definitely is a degree of anonymity. But another great question is if everyone updates their own ‘version’ of the record-book, how are they all synced when funds are constantly being transferred?

 

To put it simply, when you wish to send money, you let everyone else know by sending a message with the receiver’s account number, your own, and of course the number of funds. Then everyone updates their own version of the ledger.

 

How To Buy A Couch With Bitcoin

 

But if to send money all you need is to broadcast a message with someone’s account details then what would stop a thief, like Veronica, from using Bill’s money by exploiting the fact that she can see his ‘public address?’ Like any pen and paper cheque, Bitcoin transactions require a unique signature that proves the sender, is indeed the real holder of the account, but instead, this whole process depends on mathematical, unique algorithms instead of a physical signature.

 

Actually, what this unique signature is, is a 64 letter and number string also known as a ‘private key.’ You get it upon creating a new account. Upon creating your new account you’ll also get unique ‘public key’ which is a string of 34 letters mathematically connected to just your account and visible to everyone. It’s essentially your digital address. Have you ever heard of a digital-wallet? These are the keys it holds, and these virtual-keys are what enable users to create their own unique ‘signatures.’ Now, to create a unique-signature, a user must enter the number of funds they wish to transfer and sign it with their private key.

 

The system then spits out a unique signature which gets sent out to the entire network to get validated. Then, another function enables other users to verify this unique signature, and ensure it was indeed created by the account owner while also validating that the digital funds trying to get transferred, haven’t already been sent to someone else. When this is verified the signature is then applied to that particular transaction and unlike the classic handwritten versions of our signatures, these digital-signatures can’t be imitated, copied or reused.

 

Now, something very interesting to note is that while these mathematical unique-signatures serve as proof of who sent how many funds to what address, they cannot provide details on when it was sent, and this can be a problem. In today’s banking system, if Veronica wrote two cheques, but her account only had enough funds in it to pay one of them, the bank would prioritize and only pay the first individual that attempted to cash his cheque, and refuse the second, because after the first person cashes out their cheque, her account would be empty. What I’m trying to emphasize here is that using our traditional system the order of these cheques is critical because it will determine who gets paid.

 

With this digital system, both recipients may think their transaction came first and ship a product, which would, in essence, allow Veronica to spend her money two times! The mighty ‘Double Spending’ problem. Bitcoin has solved this problem by providing a way for the entire world to decide on the order of transactions. As more new transactions are created, they go into the ‘pending-pool’ and then from there, they get sorted into a giant chain that locks in their order – the blockchain.

 

In order to decide which transaction comes next, a sort of algorithmic lottery is held. What happens is, participants, select the pending transaction of their choice and then begin trying to solve a math problem that will then allow them to link it to the end of the blockchain. As in any ‘competition,’ the first person to solve the problem wins (first in first out) and gets to have their transaction next in the chain. This lottery technique enables every user to partake in the decision of which transaction comes next, and the maths behind it also ensures that everyone agrees about previous transactions too.

 

Let’s suppose you’re joining the network for the first time, and you request a copy of the transaction chain to catch up but receive several different versions. Confusion, right? Which one should you trust? Which one is authentic? In a perfect world, you would trust the one that the majority of people are using but determining this online is not as easy as it sounds. What would stop a single person from voting hundreds of times? Bitcoin has us covered there too by necessitating people to solve mathematical problems in order to be able to cast a vote.

 

This means each singular vote costs quite some computing power, making it highly unlikely that a single person or group could ever afford to outvote or out-compete the majority of users. The transaction procedures described above serve as a kind of voting system. You could call it ‘Digital Democracy.’ But how are all the votes counted?

 

Well, the cryptographic hash function has well defined statistical properties, so you could look at any answer and pretty much make an approximate calculation of how many guesses it took to solve, just like estimating how many coin-flips it would take to get 10 heads in a row. So not only do the links in a chain put transactions in their correct order, but they also act as an effective vote count making it very easy to see which version of the ledger most people are using.

 

Finally, how does the more Bitcoin get created? Well, every time someone wins the digital-lottery and picks the next transaction in the chain, new Bitcoins are created and awarded to their account. Solving these problems is most commonly known as “mining,” and this is how more money is made, but the main purpose the math serves is to make sure everyone’s ledgers agree and that nothing has been tampered with.

 

The math also provides a convenient way to randomly distribute money. In fact, analysts have predicted that sometime in 2140, the creation of Bitcoins will come to a halt because we would have mined them all, and participants will only be able to get paid from fees added on to transactions. But no worries, that’s a long time from now and just looking at the pace at which new coins are being created, something will definitely be ready to replace Bitcoin.

 

I hope this gives you a quick sense of the nitty-gritty of Bitcoin. Until next time.

 

 

Disclaimer:
This article is for educational and informative purposes only and should not be considered as investment or trading advice.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 79.99% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money. Find more details about risk here.

eFXGO! Official iOS Mobile App Free • available on app store

4.5/5