What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ? (2024)

What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ?

Bitcoin is the first decentralized digital currency. Bitcoins are digital coins you can send through the Internet. Compared to other alternatives, Bitcoins have a number of advantages. Bitcoins are transferred directly from person to person via the net without going through a bank or clearinghouse.

What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ? (1)

This means that the fees are much lower, you can use them in every country, your account cannot be frozen and there are no prerequisites or arbitrary limits.

Let's look at how it works! Bitcoins are generated all over the Internet by anybody running a free application called a Bitcoin miner.

What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ? (2)

Mining requires a certain amount of work for each block of coins. This amount is automatically adjusted by the network such that Bitcoins are always created at a predictable and limited rate. Your Bitcoins are stored in your digital wallet which might look familiar if you use online banking.

When you transfer Bitcoins, an electronic signature is added. After a few minutes the transactions is verified by a miner and permanently and anonymously stored in the network.

The Bitcoin software is completely open source and anybody can review the code. Bitcoin is changing finance the same way the web changed publishing. When everyone has access to a global market, great ideas flourish.Let's look at some examples of how Bitcoins are already used today:

You can purchase video games, gifts, books,servers and alpaca socks. Several currency exchanges exist where you can trade your Bitcoins for dollars,euros and more.

Bitcoins are a great way for small businesses and freelancers to get noticed. It doesn't cost anything to start accepting them, there are no chargebacks or fees and you'll get additional business from the Bitcoin economy.

What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ? (3)


What is Bitcoin mining?

Bitcoin operates as a peer to peer network.This means that everyone who uses Bitcoin is a tiny fraction of the bank of Bitcoin.But where do Bitcoins come from?With paper money, a government decides when to print and distribute money.Bitcoin doesn't have a central government.

With Bitcoin, miners use special software to solve math problems.And are issued a certain number a bitcoins in exchange.This provides a smart way to issue the currency.And also creates an incentive for more people to mine.

Since miners are required to approve Bitcoin transactions moreminers means a more secure network.The Bitcoin network automatically changes the difficulty of the math problems dependingon how fast they are being solved.In the early days,

Bitcoin miners solved these math problems with the processors and their computers.Soon miners discovered that graphics cards used for gaming were much better suited to this kind of work.Graphics cards are faster, they use more electricity and generate a lot of heat.

The first commercial Bitcoin mining products included chips that were reprogrammed for mining Bitcoin.These chips were faster but still power-hungry.ASIC, or application-specific integrated circuit, chips are designed specifically for Bitcoin mining.ASIC technology has made Bitcoin mining even faster while using less power.

As the popularity of Bitcoin increases, more miners join the network makingit more difficult for individuals to solve the math problems.To overcome this, miners have developed a way to work together in pools.

Pools of miners find solutions faster than their individual members andeach miner is rewarded proportionately to the amount of work he or she provides.

Mining is an important and integral part of Bitcoin that ensures fairness while keeping the bitcoinnetwork stable, safe and secure.For more information about Bitcoin Mining visit: https://www.BitcoinMining.com

What does it mean to have a bitcoin?

Many people have now heard of bitcoin, that’s it’s a fully digital currency, with no government toissue it and no banks needed to manage accounts and verify transactions.

That no one actually knows who invented it.Yet many people don’t know the answer to this question, at least not in full.To get there, and to make sure the technical details underlying this answer feel motivated,

we’re going to walk through step-by-step how you might have invented your own version ofBitcoin.We’ll start with you keeping track of payments with your friends using a communal ledger.

Then, as you trust your friends and the world less and less, and if your clever enough tobring in a few tools of cryptography to help circumvent the need for trust, what you endup with what’s called a “cryptocurrency”.

Bitcoin is just the first implemented example of a cryptocurrency, and there are now thousands moreon exchanges with traditional currencies.

Walking the path of inventing your own can help set the foundation for understanding someof the more recent players in the game, and recognizing where there’s room for different designchoices.In fact, one of the reasons

I chose this topic is in response to the unprecedented leap inattention, investment and...well.. hype directed at these currencies in just the last year.I won’t comment or speculate on the current or future exchange rates,

but I think we'llagree that anyone looking to buy a cryptocurrency should really know what it is.Not just in terms of analogies with vague connections to gold-mining, I mean an actual directdescription of what computers are doing when sending, receiving and creating cryptocurrencies.

One thing worth stressing, by the way, is that even though you and I will dig into the underlyingdetails here, which takes some meaningful time, you don’t actually need toknow those details to use a cryptocurrency, just like you don’t need to know the details ofwhat happens under the hood when you swipe a credit card.

Like any other digital payments, there are plenty of user-friendly applications that letyou send and receive these currencies very easily.The difference is that the backbone underlying this is not a bank verifying transactions,but a clever system of decentralized trustless verification based on some of the math bornin cryptography.

To start, set aside the thought of cryptocurrencies for a few minutes.We’re going to start the story with something more down to earth:

Ledgers, and digital signatures.

If you and your friends exchange money pretty frequently, paying your share of the dinner billand such, it can be inconvenient to exchange cash all the time.So you might keep a communal ledger that records payments you intend to make in the future.

Alice pays Bob $20, Bob pays Charlie $40, things like that.This ledger will be something public and accessible to everyone, like a website where anyone can goand just adds new lines.

At the end of every month, you all look through the list of transactions and tally everything up.If you’ve spent more than you received, you put that money into the pot, and if you've receivedmore than you spent, you take that much money out.So the protocol for being part of this system looks something like this: Anyone can add linesto the ledger, and at the end of every month everyone gets together to settles up withreal money.

One problem with a public ledger like this is that when anyone can add a line, what'sprevents Bob from going in and writing “Alice pays Bob $100” without Alice approving?How are we supposed to trust that all these transactions are what the sender meant for themto be?

This is where the first bit of cryptography comes in: Digital signatures.Like a handwritten signature, the idea here is that Alice should be able to add something nextto a transaction that proves that she has seen it, and approved of it.And it should be infeasible for anyone else to forge her signature.At first, it might seem like digital signatures shouldn’t even be possible, since whatever datamakes up the signature can just be read and copied by any computer, so how do you preventforgeries?

The way this works is that everyone generates what’s called a public key/private key pair,each of which looks like some string of bits.The private key is sometimes also called the “secret” keyso that we can abbreviate itto SK while abbreviating the public key as pk.

As the names suggest, the secret key is something you should keep to yourself.In the real world, your handwritten signature looks the same no matter what document you're signing.

A digital signature is much stronger because it changes for different messages.It looks like a string of 1’s and 0’s, commonly something like 256 bits, and altering themessage even slightly completely changes what your signature on that message should looklike.

Formally, producing a signature involves some function that depends both on the message itself, and on your private key.

The private key ensures that only you can produce the signature and the fact that it dependson the message means no one can just copy one of your signatures to forge it on anothermessage.

Hand-in-hand with this is a function to verify that a signature is valid, and this is where thepublic key comes into play.All it does it output true or false to indicate if this was a signature created by the private keyassociated with the public key you use for the verification.

I won’t go into the details how exactly these functions work, but the idea is that itshould be completely infeasible to find a valid signature if you don’t know the secretkey.Specifically, there is no strategy better than just guessing and checking if random signatures arevalid using the public key until you hit one that works.

There are 2^{256} possible signatures with 256 bits, and you’d need to find the one thatwork.This is a stupidly large number.To call it astronomically large would be giving way to much credit to astronomy.

In fact, I made a supplemental blog devoted just to illustrate what a huge number this is.Let’s just say that when you verify a signature against a given message and public key, you canfeel extremely confident that the only way someone could have produced it is if they knewthe secret key associated with the public key.

There’s one slight problem here:

If Alice signs a transaction like “Alice pays Bob$100”, even though Bob can’t forge Alice’s signature on new messages, he could just copy thatthe same line as many times as he wants, since the message/signature combination is valid.To get around that, we make it so that when you sign a transaction, the message has to includesome unique id associated with that transaction.

That way, if Alice pays Bob $100 multiple times, each transaction requires a completely newsignature.Alright, great, digital signatures remove a huge aspect of trust in our initial protocol.But even still, this relies on an honours system of sorts.Namely, you’re trusting that everyone will actually follow through and settle up in cash atthe end of each month.But what if, for example, Charlie racked up thousands of dollars in debt, and just refuses toshow up?The only real reason to revert to cash to settle up is if some people, I’m looking atyou Charlie, owe a lot of money.So maybe you have the clever idea that you never actually have to settle up in cash as longas you have some way to prevent people from spending too much more than they take in

.What you might do is start by having everyone pay $100 into the pot, and have the first fewlines of the ledger will read “Alice gets $100, Bob gets $100, etc.Now, just don’t accept transactions when someone is spending more than they have on theledger.

For example, after starting everyone off with $100, if the first two transactions is “Charliepays Alice $50” and “Charlie pays Bob $50” if he were to try to add “Charlie pays You$20”, that would be invalid, as invalid as if he never signed it.

Notice, this means you need to know the full history of transactions to verify that a new oneis valid.And this is, more or less, going to be true for cryptocurrencies as well, though there isa little room for optimization.

What’s interesting here is that this step somewhat removes the connection between theLedger and physical cash.In theory, if everyone in the world used this Ledger, you could live your whole life just sendingand receiving money on this ledger without ever converting to the real US.

To emphasize this point, let’s start referring to quantities on the ledger as “LedgerDollars”,or LD for short.You’re of course free to exchange LedgerDollars for real US dollars, for example maybe Alice givesBob a $10 bill in the real world in exchange for him adding and signing the transaction“Bob pays Alice 10 LedgerDollars” to the communal ledger.

But exchanges like this are not guaranteed in the protocol.It’s now more analogous to how you might exchange Dollars for Euros or any other currency onthe open market, it’s just its own independent thing.This is the first important thing to understand about Bitcoin, or any other cryptocurrency:

What it is is a ledger; the history of transactions in the currency.Of course, with Bitcoin money doesn’t enter the Ledger with people buying into using cash,I’ll get to how new money enters the ledger in just a few minutes.

Before that, there’s an even more significant difference between our current system of Ledger Dollarshow cryptocurrencies works.So far, I’ve said that this ledger is some public place, like a website where anyone canadd new lines.But this requires trusting a central location.Namely, who hosts that website?

Who controls the rules of adding new lines?To remove that bit of trust, we’ll have everyone keep their own copy of the ledger.Then to make a transaction, like “Alice pays Bob 100 LedgerDollars”, you broadcast intothe world for people to hear and record on their own private Ledgers.

But unless we do something more, this system would absurdly bad.How can you get everyone to agree on what the right ledger is?When Bob receives the transaction “Alice pays Bob 10 LedgerDollars”, how can he be surethat everyone else received and believes that same transaction?That he’ll be able to later use those 10 LedgerDollars to make a trade with Charlie.Really, imagine yourself just listening to transactions being broadcast.

How can you be sure that everyone else is recording the same transactions in the same order?Now we’ve hit on an interesting puzzle: Can you come up with a protocol for how to acceptor reject transactions and in what order so that you can feel confident that anyoneelse in the world following the same protocol has a personal ledger that looks thesame as yours?

This is the problem addressed in the original Bitcoin paper.At a high level, the solution Bitcoin offers to trust whichever ledger has the most computational workput into it.I’ll take a moment to explain what exactly that means, which involves this thing calledCryptographic hash function”.

The general idea we’ll build to is that if you use computational work as a basis for whatto trust, you can make it so that fraudulent transactions and conflicting ledgers would requirean infeasible amount of computation.

Again, this is getting well into the weeds beyond what anyone would need to know just touse a currency like this.But it’s a really cool idea, and if you understand it, you understand the heart of bitcoinand other cryptocurrencies.

A hash function takes in any kind of message or file and outputs a string of bits with afixed length, like 256 bits.This output is called the “hash” or “digest” of the message, and it’s meant to look random.

What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ? (4)

It’s not random; it always gives the same output for a given input.But the idea is that when you slightly change the input, maybe editing just one character,the resulting hash changes completely.In fact, for the hash function,

I’m showing here, called SHA256, the way that output changes asyou slightly change the input is entirely unpredictable.You see, this is not just any hash function, it’s a cryptographic hash function.That means it’s infeasible to compute in the reverse direction.

If I show you some specific string of 1’s and 0’s and ask you to find an input message sothat the SHA256 hash of that message gives this exact string of bits, you will have no bettermethod than to guess and check.

Again, if you want a feel for just how much computation would be needed to go through256 guesses, take a look at the supplemented blog.I actually had way too much fun writing that thing.You might think you could reverse engineer the desired input by really digging through thedetails of how the function works, but no one has ever found a way to do that.

Interestingly, there’s no proof that it’s hard to compete in the reverse direction,yet a huge amount of modern security depends on cryptographic hash functions.If you were to take a look at what algorithms underlying the secure connection that your browser ismaking with YouTube right now, or that it makes with a bank, you will likely seename like SHA256 in there.

For right now, our focus will just be on how such a function can prove that a particular listof transactions is associated with a large amount of computational effort.Imagine someone shows you a list of transactions, and they say “I found a special number so thatwhen you put this number at the end of the list of transactions and apply SHA256 the entirething, the first 30 bits of the output are zeros”.How hard do you think it was for them to find that number?

For a random message, the probability that the hash happens to start with 30 successive zerosis 1 in 230, which is about 1 in a billion.Because SHA256 is a cryptographic hash function, the only way to find a special number like thisjust guessing and checking.

So this person almost certainly had to go through about a billion different numbers beforefinding this special one.And once you know the number, you can quickly verify that this hash really does start with30 zeros.In other words, you can verify they went through a large amount of work without having togo through that same effort yourself.This is called “proof of work”.

And importantly, all this work is intrinsically tied to that list of transactions.If you change one of the transactions, even slightly, it would completely change the hash,so you’d have to go through another billion guesses to find a new proof of work, a new numberthat makes it so that the hash of the altered list together with this new number startswith 30 zeros.

So now think back to our distributed ledger situation.Everyone is broadcasting transactions, and we want a way for everyone to agree on what thecorrect ledger really is.As I said, the core idea behind the original bitcoin paper is to have everybody trust whichever edgehas the most work put into it.This works is to first organize a given ledger into blocks, where each block consists ofa list of transactions, together with a proof of work.That is, a special number so that the hash of the whole block starts with a bunch of zeros.

For the moment let’s say it has to start with 60 zeros, but later I’ll return back tohow you might choose that number.In the same way that a transaction is only considered valid if it is signed by the sender,a block is only considered valid if it has a proof of work.

Also, to make sure there is a standard way to order of these blocks, we’ll make it sothat a block has to contain the hash of the previous block.That way, if you change any block, or try to swap the order of two blocks, it would changethe block after it, which changes that block’s hash, which changes the next block,and so on.That would require redoing all the work, finding a new special number for each of these blocks thatmakes their hashes start with 60 zeros.

Because blocks are chained together like this, instead of calling it a ledger, this is commonly calleda “Blockchain.As part of our updated protocol, we’ll now allow anyone in the world to be a “block creator”.What this means is that they’ll listen for the transactions being broadcast, collect theminto a block, then do a whole bunch of work to find the special number that makes thehash of this block start with 60 zeros, and broadcast out the block they found.

To reward a block creator for all this work, when she puts together a block, we’ll allow herto include a special transaction at the top in which she gets, say, 10 LedgerDollarsout of thin air.This is called the block reward.It’s a special exception to our usual rules about whether or not to accept transactions;it doesn’t come from anyone, so it doesn’t have to be signed.It also means that the total number of LedgerDollars in our economy increases with each new block.

Creating blocks is often called “mining” since it requires a lot of work, and it introduces newbits of currency into the economy.But when you hear or read about miners, keep in mind that what they’re really doing is creatingblocks, broadcasting those blocks, and getting rewarded with new money for doing so.

From the miners perspective, each block is like a miniature lottery, where everyone is guessingnumbers as fast as they can until one lucky individual finds one that makes thehash of the block start with many zeros, and gets rewarded for doing so.

The way our protocol will now work for someone using this system is that instead of listening fortransactions, you listen for new blocks being broadcast by miners, updating your own personalcopy of the blockchain.The key addition is that if you hear of two distinct blockchains with conflicting transaction histories, you defer to the longest one, the one with the most work put into it.

If there’s a tie, wait until you hear of an additional block that makes one longer.So even though there is no central authority, and everyone is maintaining their own copy ofthe blockchain, if everyone agrees to give preference to whichever blockchain has the mostwork put into it, we have a way to arrive at a decentralized consensus.

To see why this makes for a trustworthy system, and to understand at what point you should trustthat payment is legitimate, it’s helpful to walk through what it would take tofool someone in this system.If Alice wants to fool Bob with a fraudulent block, she might try to send him one that includesher paying him 100 LedgerDollars, but without broadcasting that block to the restof the network.

That way everyone else thinks she still has those 100 LedgerDollars.To do this, she’d have to find a valid proof of work before all other miners, each working ontheir own block.And that could happen!Maybe Alice wins this miniature lottery before anyone else.But Bob will still be hearing broadcasts made by other miners, so to keep him believing thefraudulent block Alice would have to do all the work herself to keep adding blocks tothis special fork in Bob’s blockchain that’s different from what he’s hearing fromthe rest of the miners.Remember, as per the protocol Bob always trusts the longest chain he knows about.

Alice might be able to keep this up for a few blocks if just by chance she happens to findblocks more quickly than all of the rest of the miners on the network combined.But unless Alice has close to 50% of the computing resources among all miners,

the probability becomesoverwhelming that the blockchain that all the other miners are working on grows fasterthan the single fraudulent blockchain that Alice is feeding Bob.So in time, Bob will reject what he’s hearing from Alice in favour of the longer chain that everyoneelse is working on.Notice that means you shouldn’t necessarily trust a new block that you hear immediately.Instead, you should wait for several new blocks to be added on top of it.If you still haven’t heard of any longer blockchains, you can trust that this block ispart of the same chain everyone else is using.

And with that, we’ve hit all the main ideas.This distributed ledger system based on a proof of work is more or less how the Bitcoin protocolworks, and how many other cryptocurrencies work.There arejust a few details to clear up.Earlier I said that the proof of work might be to find a special number so that the hash ofthe block starts with 60 zeros.

The way the actual bitcoin protocol works is to periodically change that number of zeros sothat it should take, on average, 10 minutes to find a block.So as there are more and more miners on the network, the challenge gets harder and harder insuch a way that this miniature lottery only has about one winner every 10 minutes.

Many newer cryptocurrencies have much shorter block times.All of the money in Bitcoin ultimately comes from some block reward.These rewards 50 Bitcoin per block.There’s a great site called “block explorer” where you can look through the bitcoin blockchain,and if you look at the very first few blocks on the chain, they contain no transactions otherthan the 50 Bitcoin reward to the miner.

Every 210,000 blocks, which is about every 4 years, that reward gets cut in half.So right now, the reward is at 12.5 Bitcoin per block, and because this reward decreases geometricallyover time, there will never be more than 21 million bitcoin in existence.

However, this doesn’t mean miners will stop earning money.In addition to the block reward, miners can also pick up transactions fees.The way this works is that whenever you make a payment, you can optionally include a small transactionfee with it that will go to the miner of whatever block includes that payment.

The reason you might do this is to incentivize miners to actually include the transaction youbroadcast into the next block.

You see, in Bitcoin, each block is limited to about 2,400 transactions, which many critics argueis unnecessarily restrictive.For comparison, Visa processes an average of around 1,700 transactions per second, and they'recapable of handling more than 24,000 per second.Slower processing on Bitcoin means highertransactions fees, since that’s what determines which transactions miners choose toinclude in new blocks.

This is far from comprehensive coverage of cryptocurrencies.There are many nuances and alternate design choices I haven’t touched here, but hopefully thiscan provide a stable Wait-but-Why-style tree trunk of understanding for anyone looking toadd a few more branches with further reading.Like I said at the start, one of the motivations behind this video is that a lot of money has startedflowing towards cryptocurrencies, and even though I don’t want to make any claimsabout whether that’s a good or bad investment,

I do think it’d be healthy for peoplegetting into this game to at least know the fundamentals of the technology.

The challenges and benefits of decentralization are by no means limited to currency and transaction histories, and the usefulness of tools from cryptography like hash functions and digital signaturesare likewise much more general.For example, a couple of Protocol Lab’s projects, such as IPFS and Filecoin, centeron distributed file-storage, which opens a whole field of interesting challenges possibilities.For any developers out there, Protocol labs place a high value on open source, so if you'reinterested you can join what’s already a very strong community of contributors.They’re also looking to hire more full-time developers, so if you think you might be a goodfit for some of these projects, definitely apply.

What is Bitcoin ? How does Bitcoin really works? What is Bitcoin mining ? (2024)
Top Articles
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 6095

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.