If you have no idea what the difference is between a Bitcoin and a blockchain, this is the place to start! This guide assumes a moderate level of technical knowledge; for lengthier and even more detailed guides, check out our “Further Resources” section below.
Important Terms To Know
The first concept you’ll need to understand in order to grok how cryptocurrencies work is the “blockchain.”
Think about a typical website or mobile application — unless it is backed by some fancy devops magic, for the most part, it relies on a single database to provide its data. The website will read from this database, and whenever it wants to write to the database, it changes the existing data. Most importantly, if a hacker gets access to this data, there is often nothing to stop them from changing the data however they wish.
So how is blockchain different? Imagine if every user of the website had their own copy of the entire database. (Each computer connected to this network is known as a node.) If that data needs to change, the application wouldn’t actually edit existing records across that entire network of databases; instead, it would send a request to add a new block of data (known as a transaction.) Rather than being a table, this database would be made up of a chain of blocks, one after the other (hence, blockchain — get it?)
Blockchain is often referred to as a ledger, and it’s easy to see why — each block is like a new line, written in permanent ink, in a long list of transactions. If you want to change an earlier transaction, you can’t cross it out or erase it: you need to add a new line to modify the existing state of the data set. This line/block contains two things: a unique hash for that block, and the hash of the previous block in order to verify its place in the chain.
And if you want to cheat and try to modify your ledger? Every other person on the network has a copy of that ledger, and when you check in with each other to make sure everyone has the same data, they will know you tried to edit your data.
Cryptocurrency and Coins
As you can imagine, are many potential applications for blockchain technology: smart contracts, election technology, the protection of intellectual property. However, the most popular by far is a token (or coin)-based system known as cryptocurrency.
Even if you know nothing about cryptocurrency, you’ve almost certainly heard of Bitcoin. The original cryptocurrency, a single Bitcoin was valued at almost $20,000 USD at its peak when only six years previously it could be purchased for $1.
Bitcoin is far from the only cryptocurrency, however; other altcoins (short for “alternative coins”) that have gained significant value include Litecoin and “meme coins” like Dogecoin and Garlicoin, which were popularized by sites such as Reddit.
So how does a cryptocurrency work? At its simplest, each block needs to contain the sender, the receiver, and the amount. If Sam sends 10 DankMemeCoins to Eric, she will broadcast a message to the network saying that her DMC balance should decrease by 10, and Eric’s should increase by the same amount. Every node on the network will then verify and add this new block.
Blockchains can exist without an associated cryptocurrency, but almost all cryptocurrencies are built on blockchain technology. Even if users aren’t sending “money” to each other, cryptocoins can be used as an incentive for users to keep their computers maintaining the network; a great example of this is Storj, where users can pay for file storage on the blockchain with their coins.
Wallets, Addresses, and Keys
So how can someone use this ledger? In order to interact with the blockchain, you can use a piece of software called a wallet. You don’t actually store your cryptocurrency coins in a wallet (since, remember, all data is distributed across the network); instead, a wallet stores two different keys:
- A private key, which is a very large, randomly-generated number. As the name suggests, you should never share your private key with anyone.
- A public key, a code that is created from the private key (via a highly complex algorithm) and is used to generate a public wallet address that can be shared with other users on the network.
In order to send coins to someone else on the network, you can enter their public wallet address and the amount of coins you’d like to send.
If you create a new coin using CoinPress, we will automatically generate the wallet software for you.
You’ve got your wallet set up, but how do you get new coins in order to do something on the blockchain?
Remember how we said that tying transactions on a blockchain to a cryptocurrency is an incentive for users on the network to help maintain that network? This happens through a process called mining.
Miners are nodes on the blockchain network that verify and update the public ledger of transactions. (This verification process will keep, for example, users from spending coins they don’t have.) When this happens, new coins are created and rewarded to the users who helped verify these transactions.
So how does mining actually work? Let’s go back to our example where Sam sent 10 DankMemeCoins to Eric and walk through the whole process:
- Sam enters Eric’s public address in her DankMemeCoin wallet and indicates she would like to send him 10 coins, and her wallet signs off on the transaction with her private key
- The wallet broadcasts this transaction to the rest of the network, where it sits in a pool of other unconfirmed transactions waiting to be added to the DMC blockchain
- Miners on the network grab some of these transactions from these unconfirmed transaction pools and check if the senders of these transactions have acequate balance to complete them. If so, these miners form them into preliminary blocks.
- Miners will then compete with each other to be the first to add these preliminary blocks to the rest of the blockchain. Each of these blocks contain a unique puzzle that needs to be solved (that will vary based on which transactions were added to the preliminary block), and it is the job of the miner’s hardware to guess the answer to that puzzle before anyone else solves it.
Remember how we said above that blocks include hashes? This hash is generated via a complex algorithm by combining the previous block’s content with a string of random numbers known as a nonce. The job of the miners’ computers is to guess the nonce via trial and error by running random numbers through the algorithm in order to check the output against the generated hash of the block. To do so quickly (which will help you be the first one to solve it), you need a large amount of hardware processing powzer; essentially, you are trading electriciy for cryptocoins.
- Once a miner figures out the value needed to solve this hash, they submit it to the rest of the network. (This solution to the puzzle is known as a Proof of Work Consensus.) Other miners will confirm the solution to the puzzle has the right output, and if so, the provisional block can be permanently added to the blockchain. The miner is then able to add another block granting themselves a certain amount of brand new coins — thus increasing the total number of coins in circulation on the network.
Ready to get started?
Check out our CoinPress Guide to see how easy it is to create your own blockchain!