Fri Jun 02, 2017 8:10 am
I just got home, and posted my reply, but since my phone connected to the home wifi, it asked me to log in and didn't save ANYTHING.
*sigh*
I personally don't think that Bitcoin is very well explained online. It's all fluff that is irrelevant, confusing and so oversimplified you wonder what's so special about Bitcoin. I assure you, it's in a world of its own.
Bitcoin consists of 3 main parts, which I will explain individually. They however are interconnected, so it's hard to explain them without referencing the others. So you'll have to bear with me. The three parts are nodes, the blockchain, and transactions.
Let's start!
What is a node?
The bitcoin network consists of many computers that all host their own copies of every single bitcoin transaction in existence. These are nodes. They are all absolutely identical. Nodes are the backbone of the bitcoin network. They make sure that no one manipulates the network by trying to make a fake transaction, they keep a record of all the transactions so most of us don't have to, and they make sure that your transaction is seen by everyone.
What is the blockchain?
The blockchain is what it's called. Its a chain, or a series of blocks, each containing 1 megabyte of transaction data. What makes it so special is how they are made.
When you create a transaction sending bitcoin from one place to another, your computer broadcasts it to the nearest nodes that it can find. They then broadcast it to the nearest nodes they can find, and so on. This is how everyone has the exact same blockchain. Each transaction is spread around the internet within a second.
When a transaction is made, they are all put into a group called the mempool (Short for memory-pool). They are not officially in any block, and we say they're unconfirmed. This is because a special kind of node, a miner, needs to sift through all the transactions in the mempool and find the ones with the highest fees, to put into a block. When it does that, it takes as many of these transactions as it can fit into one megabyte, and tries to work with this. Let's call this a pre-block. It's on it's way to becoming a block.
This will happen with every single miner out there. They will all try and make their own pre-block. Now they will be in a race against each other, to see who can make the next actual block first. They will try and make, or mine, a valid block by creating random strings of letters and characters and then seeing if that string is "compatible" with their pre-block and the most recent valid block, using a bunch of cryptographic hash functions. Let's just say they are trying to create a cryptographic hash that links both the pre-block to the most recent block. This is extremely hard to do, and requires a ton of processing power to have even a decent chance to be the first one to make a block. A twist is that the more powerful your processing power is, it doesn't mean you're definitely going to make the next block. It just means you have a higher chance to. So I guess you could use your laptop to mine bitcoin, but the odds are pretty much you winning the lottery a million times in a row.
So this long string of blocks that are all linked together is called the blockchain. Since they're all linked, it's really hard to revert a transaction once it's in a block. I won't go too deep into this.
The prize for mining the next block first is - you guessed it, a bunch of brand spanking new bitcoin. This is how the bitcoin network creates new bitcoin. By making computers do extremely hard math problems.
What is a transaction?
A transaction is simply saying that you want to make a change to the blockchain. You want to move bitcoin from one address to another. To do this, you need a private key to sign a message that signifies that you own the account and are authorised to send the transaction. Otherwise, when you broadcast it, nodes will instantly reject it.
Something that is unique with bitcoin is how the network calculates the fees that it's users should pay. Since there is a max of 1 megabyte per block, miners will choose transactions with the highest satoshi/byte ratio. The size of a transaction is not actually based on the amount of bitcoin that you transfer, but the amounts of inputs and outputs.
What I mean by this is that if you're sending 0.1 BTC, the inputs will be the transactions making up that 0.1 BTC. If you've received 5 transactions of 0.02 BTC, then there will be 5 inputs. Outputs is the opposite. It's how many addresses that 0.1 is being sent to.
The general math you should do to calculate the size of a transaction is 180 bytes per input, 35 bytes per output, and a 10 byte base fee. So for a transaction of 1 input and two outputs, it would be 260 bytes. I usually go to a site called cointape.com for my fees to pay, and currently it says that the fee should be 420 per byte (The fee is so high nowadays... Not a year ago it was 10-20 sat/byte.), meaning that you should pay 0.001092 BTC for your fee.
That's about it, it's a pretty watered down description, but i'm thinking of writing a fully detailed one later.
theres a snake in my boot