Understand Ethereum Blockchain

in #ethereum6 years ago (edited)


I'm not a professional programmer, but I'm a curious person so I know something about that. At the moment I'm studying this new world, the Blockchain world, and I am impressed! 

How could it be possible that no one knows who Satoshi is?! I'm pretty sure someone knows who is the guy... 

Ethereum Blockchain


Well, at the moment everyone knows what is a blockchain is. Some people better than others, true. But at least they‘ve heard about this. But does everyone know what is a smart contract? Or what the Ethereum Virtual Machine does? Or why Ethereums Blockchain is so interesting? Wtf is Gas and why we need them?!

I will share with you what I know about this and I hope that you share with me what you know, ok? :)

Where to start?...

Smart Contact



Let's start by understanding what is a Smart Contract and what do they do.

Smart Contract: it's a computer program with the objective to facilitate and verify a digital transaction. In other words, Smart Contracts help you exchange money, property, shares, or anything of value in a transparent, conflict-free way, while avoiding the services of a middleman.

So what can a SC (Smart Contract) give us?

Like blockgeeks says in the post about "smart-contracts":

Autonomy – You’re the one making the agreement; there’s no need to rely on a broker, lawyer or other intermediaries to confirm. Incidentally, this also knocks out the danger of manipulation by a third party, since execution is managed automatically by the network, rather than by one or more, possibly biased, individuals who may err.

Trust – Your documents are encrypted on a shared ledger.  There’s no way that someone can say they lost it.

Backup – Imagine if your bank lost your savings account. On the blockchain, each and every one of your friends has your back. Your documents are duplicated many times over.

Safety – Cryptography, the encryption of websites, keeps your documents safe. There is no hacking. In fact, it would take an abnormally smart hacker to crack the code and infiltrate.

Speed – You’d ordinarily have to spend chunks of time and paperwork to manually process documents. Smart Contracts use software code to automate tasks, thereby saving hours off a range of business processes.

Savings – Smart contracts save you money since they knock out the presence of an intermediary. You would, for instance, have to pay a notary to witness your transaction.

Accuracy – Automated contracts are not only faster and cheaper but also avoid the errors that come from manually filling out heaps of forms.

Cool, right?

And how can someone build a SC? Ethereum created a new program language called Solidity. Some people say that Solidity is similar to JavaScrip. For me, it's more like Java... But, like I sad, I'm NOT a professional programmer. I would love to know your opinion about that in the comments section.

How can I learn Solidity


                                                                  


At the moment we don't have very much resources to learn Solidity, but I’ll share with you what I know:

I suggest you read Brian's answer in Quora as well.

Ethereum Virtual Machine


                                                                 


Ok, let's break this down. The Ethereum Virtual Machine (EVM) is easy to understand. This is where the SC run. We can think of the Ethereum’s Blockchain like the Memory of EVM.

If you want to know more and understand better you can read this post.

Dapp



Well, now we are ready to know what  a Dapp is(Decentralized Application).

A DApp has its backend code running on a decentralized peer-to-peer network. Contrast this with an app where the backend code is running on centralized servers.

Using simple terms, a Dapp can be a set of Smart Contract working together with a friendly interface.

Conclusion about Dapp:

A Dapp is the same thing as an App but it has its backend decentralized. 

Ethereum token



Ok, this is great. One of the things I most like in Ethereum is this function. So what is an Ethereum Token?

Do you remember what a Smart Contract is? If the answer is yes, great. The Ethereum Token is a Smart Contract wrote by Ethereum. Your next question probably is “What does it do?” Am I right? 

This means that everyone can create their own token. This is a really interesting concept, as it gives everyone in the world the chance to create a new currency.  But let's be realistic, just because everyone can issue a new token on the Ethereum blockchain that does not mean they should do it. You can read this article to understand better why I say this.

Like you can read in ethereum-token post, by blockgeeks: https://blockgeeks.com/guides/ethereum-token/

We can have 2 types of tokens:

Usage Tokens.

Work Tokens.

Usage Tokens: These are the tokens that act like native currency in their respective DAPPS. Golem is a pretty good example of this. If you want to use the services in Golem then you will need to pay with Golem Network Token (GNT). While these tokens have monetary value they won’t give you any particular rights or privilege within the network itself.


Work Token: These are the tokens that identify you as a sort of shareholder in the DAPP. Because of that, you have a say in the direction that that DAPP takes. A perfect example of this is the DAO tokens. If you were a DAO token holder then you would have the right to vote on whether a particular DAPP could get funding from the DAO or not.

Read the blockgeeks's article to understand better the concept

Ethereum VS Ether


                                                          


Many people think that the Ethereum and Ether are the same thing but they they aren't.

If you go to the Ethereum's website  you will find this:

"Ether is a necessary element — a fuel — for operating the distributed application platform Ethereum. It is a form of payment made by the clients of the platform to the machines executing the requested operations. To put it another way, ether is the incentive ensuring that developers write quality applications (wasteful code costs more), and that the network remains healthy (people are compensated for their contributed resources)."

Summing up

Ether is the coin. It's what you can buy on Coinbase, Gdax, Binance, etc. Ethereum is all the network.

Gas



An interesting topic. I had some difficulties with understanding what  this is and why we need it.

In a simple way, Gas is the internal pricing for running a transaction or contract in Ethereum (more precisely in EVM). Every operation that can be performed by a transaction or contract on the Ethereum platform costs a certain number of gas, with operations that require more computational resources costing more gas than operations that require fewer computational resources.

For example, something like

 var a = 10;

 should be less than 

while (i++ < 1000) {

    j = j + i;

};

Well, you get the point. More complex = more expensive. The cumulative sum of all the operations is the total gas cost for the transaction.

But maybe you have the same question I had: If this happens on Ethereum Blockchain, why do we pay the cost in gas and not Ether directly?

All the gas prices of all the possible operations the EVM can perform are hard-coded in the Ethereum protocol and in the clients (programs) we connect to it, like Geth, Eth, Parity, etc. If the code listed them in ether, then we'd have to update the code every time ether's value fluctuated to keep the price of computing efforts in a normal range and keep the system usable, which is obviously unsustainable.

The conclusion about gas is 

Transactions on the Ethereum network require fees in the form of gas. The amount of gas depends on the amount of computation required to complete the transaction.

If you want to understand more about this concept visit @tomshwom's post and this site.

To close this article let's see what’s the famous Proof of Work, Proof of Stake and obviously what is "Mining". I will explain just the simpler stuff about these concepts because if I talk about everything that this theme involves, well... You would need more than 12 minutes just to read this section.

What is Mining?


                                              


As Karthink says in his post:

"Mining is a process of validating a transaction or block in a network by the process of complex algorithms to prove and validate the correctness of the transaction and thereby add the new block to the chain. "

The people who solve these problems are called "Miners". Every time a Miner solves one of this complex algorithms, they receive a reward (Ethers).

Everyone can be a Miner. You just need to have a high computing power system (something very expensive xb).

Proof Of Work

So what is PoW... When I was trying to find a good way to explain this I found the Karthik's post in Medium and he has a great way to explain. 

Let's imagine that we are, for a horrible reason, in a math exam along with other students in a classroom. So, all the student can come for the proof with the correct answer and the complete proof. The first one giving the correct answer gets the reward. Well, yeah, that’s good. But all the student are doing the same thing at the same time. It's useless. Why does everyone need to say that 1 + 1 is 2? Ok, it works but it consumes a lot of energy and brain power from the body.

Now in cryptocurrency  language:


The “math exam” refers to the “transaction”, the “classroom” refers to the “world”, “Student” refers to the “computing hardware/computer” that runs the complex algorithms, “brain power” refers to the “computing power” and the “lot of energy” refers to the “lot of electric power”. 


This is the great example that Karthink gives in his post.

The downside of PoW:

  • Requires more electric power which in turn costs the miner
  • High computing power hardware which is expensive (not if you are a millionaire :) )
  • The possibility of miners moving their hardware to mine a different coin if the reward is better there (loyalty)
  • With more and more coins (like more count of bitcoins) getting released, the miner’s reward would come down as the coin becomes scarce to mine

Proof Of Stake

Proof of stake is a different way to validate transactions based and achieve the distributed consensus. In this way of validation, we don't have miners, we have Validators. This system picks the Validator by the amount of stake (coins) a validator has, and the respective age of the stake. In a simple way is: The more coins you have, the higher the probability you get the reward.

The channel Cryptonauts have a great vídeo about all this stuff.

So this eliminates some of the biggest problems with PoW.

  • You don't need to buy expensive hardware (a normal laptop or computer running the respective coin’s Validator client will do, as long as your laptop or computer is online)
  • Energy efficient, as it won’t consume high electricity as PoW does
  • Validators can be more loyal …As higher the stake the Validators have for a long time, the better the chances for the Validator to be picked up for “forging” and earn the transaction fee
  • Faster validations.


Ethereum system


                                  


Ethereum used to work in a PoW system, but recently they made a big change: Ethereum created an update called Casper, which allowed them to become the first 'hybrid' system. This shift means that they now have PoW and PoS.. 

If you want to know all about Casper, Who made it, what Casper does, etc read this post.

And this one, if you want to understand  why they did  this shift, you can read this article too:

Conclusion


                                            


So, I hope this article helps you to understand the fundamentals of the Ethereum's Blockchain. Please, if you see something that could be improved just say! I'm studying this 

new world so I'm sure that some things can be improved.

Let me know what you think about the PoW and PoS - what is better for you? What do you think about the Ethereum's big switch? Tell me all you think in the comments section. 

See you later!


Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.028
BTC 55089.06
ETH 2939.59
USDT 1.00
SBD 2.09