How does Bitcoin work?

Ah, the age of cryptocurrency, where people can buy and sell online currency without the need for a third party. Whether or not you have invested, it’s worthwhile to understand the technical side of Bitcoin, as it is the most widely recognised form of cryptocurrency. So, with that, how does Bitcoin work?

How Does Bitcoin Work?

Bitcoin is a peer-to-peer (P2P) payment network that uses (decentralised) blockchain technology.
To buy or sell Bitcoin, first, you need a wallet, a digital file that gives you access to sending and receiving Bitcoin. Each person’s Bitcoin wallet has two keys. One is public, while the other one remains private. Your public key is your Bitcoin address, and your private key is often a mnemonic phrase which consists of 12 or 24 words either a seed phrase (12 or 24 words) and gives access to the wallet where the private keys are stored.

The public and private addresses work together to ensure privacy with each Bitcoin transaction. So, when you make a transaction, you sign with your private address to prove that you own the public key, but your private address won’t be disclosed. Then, once you submit your transaction, your public key goes into the blockchain. The private key is required to perform a transaction. All transactions and public keys are recorded on the bitcoin blockchain and are public. The corresponding private keys are not.

What is the Blockchain?

When you buy or sell Bitcoin, it goes to a large, automated network, often referred to as the blockchain. Simply put, a Blockchain is a decentralised ledger where all BTC transactions are registered. The rules of the game are in the source code and cannot be changed just like that.

Next, the transaction goes to Bitcoin miners, who verify the transaction. A Bitcoin miner is anyone with a computer connected to the Bitcoin network. All Bitcoin transactions go to these processing computers, known as nodes, for verification.

How does the verification process work?

First, a transaction is publicly broadcasted to all computers on the network. Then, the transaction goes into a block in the chain.

Ingredients of a block in the chain:

  1. Data from the transaction, which will be stored in the blockchain permanently.
  2. A nonce (number once), which is a randomly generated single-use 32-bit number. The nonce is the number that the winning miner has entered (input) with which the outcome yields the correct hash (output).
  3. A hash, which is found by matching the nonce with a hash value. The hash value, which must be found by entering/guessing the nonce (input).

Searching for the right hash by continuously filling in the nonce takes a lot of computing power. That's where the name proof-of-work comes from, as this method is called. Miners then use a proof-of-work timestamp system to prove that the transaction details are correct. Proof-of-work requires miners to solve cryptographic puzzles to validate the transaction. The computers have to guess/fill in a very long number that is linked to the hash value with an algorithm.

They do this until a computer has found the right nonce. If this happens too fast on average, the number gets longer, if it takes too long, the number gets shorter. The rhythm of bitcoin is around 10 minutes per block. Once confirmed, the block is sent to the whole network and becomes fixed. In other words, the data is permanent and is recorded in the blockchain.

The whole process requires enormous computing power and complex mathematical functions to find the right hash. The computer that solved the puzzle receives a subsidy for the work. This is how new Bitcoin comes into circulation. The amount of the subsidy is halved approximately every 4 years. This continues until the number of 21 million specified in the source code is in circulation. Then the miner is only rewarded with transaction costs paid by the users.

Bitcoin’s Security

Every computer or device connected to the network has a copy of the blockchain that is consistently updated throughout the day. Moreover, every block is recorded and fixed in the ledger, making the Bitcoin blockchain completely transparent.

The proof-of-work system makes it nearly impossible for a hacker to alter a block since any discrepancy would become apparent to anyone on the network. Moreover, the hacker would have to redo the block, modify the subsequent blocks, and then surpass the current workings of the miners.

In theory, changing the network rules is only possible if 51% of the miners reach a consensus on this. An attacker will therefore have to hack more than half of the mining computers, or secretly collect more computing power than is currently being used. With the current hashrate, this is practically impossible for a dozen reasons.

It is not possible to “hack” bitcoin without changing the rules of the game. Quantum computing is often referred to as a future threat. Private keys can also always be stolen by means of phishing etc.

Discover more blogs