Introduction to Blockchain and Cryptocurrency mining
This exclusive lecture from Alexandru Budisteanu, explaining how Blockchain works.
Hi everybody, my name is Alexandru Budisteanu, and I am one of the founders of WebDollar, and over the time I have received many many questions about blockchain. What is it? What does it do? How can you use a blockchain? What other applications are there for blockchains? And how does it work, decentralized?
So first of all, the idea of blockchain was to make a database that replicates itself on every machine in order to have consensus (in order to understand if a transaction is valid, and if you don’t want to use a centralized way, asking a trusted node if he knows about that transaction, if there are funds available from that transaction, or something like that).
You want to validate everything. So in order to validate everything, you download the entire history or some data in order to understand the past transactions- to verify everything that everything is alright, both from a mathematical point of view (like verifying signatures). But the most important thing is that there is a linkability so you can track the funds: that they exist, and that is the owner of those funds.
So, blockchain is actually a decentralized database. Like an SQL database that is replicated on every machine. The main idea of the blockchain is that although you have all the machines with data, only one is delegated/selected in order to write data in that database in an interval of time.
For example, Bitcoin is adjusting the difficulty in order to make other nodes write data, introducing a new block to the blockchain- every ten minutes. WebDollar, for example, is every 40 seconds.
And how does it work? There is a like a lottery, a computation power between everybody which are generating hashes (a hash is a chance that you can write a new block). So how it works is, is that the blockchain verifies the time stamp of those blocks, and when the blocks are generated faster in an interval that should have been done, it increases the difficulty of the lottery.. making it harder next time for the people to create too many blocks.
If there were too few blocks generated in the blockchain, then the lottery adjusted difficulty will get lower. By this way, it will facilitate a little bit more people in less time, in order to generate enough blocks so that all the time the number of blocks are generated at the right time. So the main idea is to adjust a target, a difficulty of this lottery of who is making the new block that in order to assure that in the network (every ten minutes for Bitcoin, every 40 seconds for WebDollar) a new block is being introduced to the network proposing new transactions.
In case the block is not valid (like it was proposed by the right person.. the right miner, but it contains invalid transactions), all other nodes will invalidate and will see that there is a mistake in the block where somebody tried to attack the network, introducing wrong transactions, or wrong data. Automatically that block will be rejected. And in just a very short time, there will be another lucky winner (but in less time.. you don’t need to wait another 40 seconds for WebDollar, ten minutes for bitcoin).. it will maybe take 10 seconds, one minute for Bitcoin or something like that.
And a new solution will be proposed. And how does it work? So, it is interesting that there have been some hash functions developed that are totally random. So nobody can generate a predefined hash. A hash is like an injective function that you don’t know how to reverse engineer.
For example, You have 1X. You multiply by the function f(x).. you get the result y. But you can not reverse engineer that function in order to get a specific y.. in order to find which x should be calculated, which x you should use in order to get a specified y.
So in this way, nobody can make any kind of prediction, nobody can do any kind of magic formulas for those hashes. And how it works is just brute forcing. People (the proof of work) are just mining and generating a lot of hashes in order to find that winning hash/winning ticket for the lottery.
In case there are more hashes, more solutions, more blocks generated in a network, automatically the target will be increased making it more difficult next time. So by making an adjustable difficulty, everybody will be secured and will have fixed inflation that is decided from the cut.
For example, maybe (let’s consider that this is a normal Bitcoin network) and suddenly a big mining farm from China or something like that just entered the blockchain mining Bitcoin. So automatically, the blocks will be generated faster than ten minutes because there has been a new mining farm that has an overwhelming power… let’s say like ten percent.
So, by doing that, blocks will be generated ten percent faster. Instead of making it like ten minutes, if you calculate the average time of when those blocks were generated, you are going to find that the blocks by everyone are generated ten percent faster.
So the bitcoin consensus (all of those nodes) will see that those blocks were generated faster than should have actually been done and will change the difficulty/adjusting the target difficulty of the network in order to make sure that for the next blocks will no longer be generated ten percent more.
And by doing this repetitive loop of changing the difficulty, in order to assure that a specific number of blocks are generated every X blocks- every X minutes, or something like that.
You will assure that in your entire network- there is only one computer that is proposing the solution for the next block. So by this way, you create a decentralized network with full consensus of each other nodes, having the data replicated on all of those machines, and you select only one computer by random from this network, that is proposing the next block for the next transactions.
So this is how the security comes- from the blockchain itself! Because when you only have one winner from the entire network, then automatically a competitor (an attacker) who wants to create his own block, or to try to make an attack on the chain, will need to have a lot of computing power in order to get a 51% plus one attack on the network.
So this is how it works. And this is how in theory- it should work. And actually, if you implement something like this as I described.. to make a random hash function generating that everybody is computing in order to get a hash below a threshold, and you just calculate what was actually the time that all those blocks were generated, and divide that by how long it should actually take in order to generate those.. and you change the threshold of that difficulty- then you will be able to make the blocks harder or less/more in your interval in case there were not enough blocks in that period of time.
So this is how the blockchain works. The question is what other applications are for blockchains?
One of the most interesting things I find is that blockchain can be used to make different applications. One of them is actually video gaming. So for example, the video game… every computer knows everything else. For example- real-time strategy.. when you need to know everything/all the data (how many units are on the map, how many resources you have, how many resources the adversary has, and so on).
So a real-time strategy game must have the entire data of the map. So blockchain can be applied to a video game. But you know, blockchain can be applied to anything that you want to make decentralized.. making sure there is no point of failure in your network.
Because of the main idea for when you create an open source project in a decentralized network.. from the day one of launching that project, you’re open for attacks. So by having a main net that is available and is open source which is accessed by anyone (and is working) means that there can not be a lot of problems/a lot of attacks on your network.
Maybe some denial of service attacks to flood your network, to shut down some of your nodes.. or maybe even your network can be temporarily blocked by a huge distributed denial of service. But that doesn’t mean that an attacker will forge new coins, will do double spending attacks, or any kind of problems by making transactions or by making data.
And there are multiple consensuses. The most powerful one is the Proof of Work (POW, which I described earlier) by generating hashes (and all of those hashes are totally random, and nobody can guess and nobody can predict a specific kind of hash and is just like a lottery). And based on how much computing power you have, you have more hashes.. if you have a very powerful computer, you have more hashes- that means more tickets of the lottery. But that means other people can buy new hardware/new equipment.. maybe more people are going to join the network, so it will become more difficult for you to mine the same coins. But it has some value for a blockchain.
Because it takes electricity to generate those coins. And as you may know, that electricity required to generate and to validate transactions, and how much electricity Bitcoin uses in one day is more than the electricity use in a big country like Romania or a 20 million people country, or something like that.
Because it requires a lot of electricity.. but that is only a game. It is only meant to make a decentralized network, allowing anybody to forge new coins, and to accept transactions, to propagate transactions in your system- in a decentralized way.
There are other consensus methods. One of those is actually Proof of Stake (POS). So instead of mining, instead of buying equipment, in order to have a chance on your lottery, you can actually create a simple consensus that is based on making a proof that you own funds.. and that those funds are in your wallet. And by making a signature you can have somebody who is proposing the next block.
So Proof of Stake consensus algorithm is a new method in order to avoid mining, to avoid hardware/electronics, and to just allow people who own coins to generate new blocks. They are still randomly selected, but the weight by which those people are selected is based mostly on how many coins they have.. divided by how many coins other people have.
So by this way, you are creating new blocks- and for each block that is generated and added to this blockchain, this will create new coins for you as a reward, and will validate new transactions in that chain.
So Proof of Stake is just a simple consensus of this decentralized database in the world, allowing people to stake their own coins by giving proofs that they have their coins in the system.. then giving them the signature that they are the holders of those coins. And there is a probability that you will win the next block selection.. that you will propose the next block.
And that probability is just based on the amount of coins you have, and divided by how many coins other people have.
There are many consensus algorithms. But those are the two most popular consensus algorithms- the Proof of Work (POW) that is mostly a “gold rush.” People are just going to try to use as much equipment they have. But unfortunately most of the time, Proof of Work gets centralized because some big companies/big electronic manufacturers will be able to produce secret projects/secret devices that will have a huge computational power.. and will mine secretly.
I truly believe that Bitcoin is pretty much centralized by many one/two Chinese companies… that they are manufacturing those ASIC devices that are very powerful/very efficient in electricity, but in the same time very very powerful in generating hashes.
So all of those Proof of Work coins get centralized in one way or another. Because this is how it works. You know, all the time, big companies will have more resources in order to compete in this computation. Proof of Stake (POS) is mostly based on how many people you have on your platform/your cryptocurrency.
And the thing is that it is generating an interest like the bank. If you have a lot of coins, then it becomes quite profitable for you just staking them. Just staking them, you are going to get some rewards from the blockchain.. that you are not selling those coins, and more are multiplied in your wallet.
So it gives some kind of value.. for example, the same way you receive interest from banks because the banks use your money in order to fund different projects, to fund different companies. And in this way, they create new businesses, and they make money… using your own money.
But this way, Proof of Stake is enabling people to get more coins by staking those.
Thank you very much for your time, and I really hope you understood what blockchain is, what a decentralized network is, how Proof of Work, works.. and maybe you got some idea of how Proof of Stake works.
Thank you very much for your time, and see you soon!
- Lectures 0
- Quizzes 0
- Duration 6 minutes
- Skill level All levels
- Language English
- Students 1
- Assessments Yes