Electronic currencies, called cryptocurrencies, are based on blockchain concepts. Bitcoin is the first and most well known started in 2009. There are about 1000 others such as Zcash and Litecoin.
The legality varies from country to country, some Governments being wary of the effect it has on their own state currency (called FIAT money) and ability to control money supply, credit and inflation.
Bitcoins are created by computers using set rules that only allow the creation at a set rate , roughly every 10 minutes, and proved by other computers as part of the process. Artificial scarcity has been introduced as built into the calculations is for only 21 million bitcoins to be produced which will be by 2040.
With the transaction rate restricted to 1mb every 10 mins or about 7 transactions/sec compared to a credit card processor 2000/sec Bitcoin Cash has spun off. This has a bigger block (as in blockchain!) of 8mb allowing more transactions and throughput.
Using how bitcoin works foe the double spending problem, if I sent out one Bitcoin twice – once to you and once to Bob the transactions are taken out of the unconfirmed transactions pool and put into the blockchain. At this point they are checked for their validity.
If transaction 1 is pulled out of the pool and seems to be valid (since I have one Bitcoin) it is inserted into the blockchain.
Now transaction 2 is pulled out of the pool. It is invalid since I don’t have anymore Bitcoins to spend and it does not get confirmed.
Should the validation process of 1 and 2 happened simultaneously so that transaction will show that I have the money needed for both. In this case we will have 2 branches of the blockchain and a race will begin – the first one to achieves the next block of confirmations will win.
If they reach the next block simultaneously as well, we will have another race and so on.
This is why it’s recommended to wait until 6 confirmation before considering a transaction complete – Since it’s VERY unlikely that this race will happen more than 6 times. So in the end we will have a clear winner and only one transaction will be confirmed. Until this race is resolved both transactions are in risk of getting cancelled.
The relatively slow speed of transactions is to allow this verification to happen before the chain moves on and the block is recorded irrecovably.