Skip to main content

Ethereum Architecture





If you notice the diagram on the right, every client (browser) communicates with its own instance of the application. There is no central server to which all clients connect to. This means, in an ideal decentralized world, every person who wants to interact with a dapp (Decentralized Application) will need a full copy of the blockchain running on their computer/phone etc. That means, before you can use an application, you have to download the entire blockchain and then start using the application.

We don't live in an ideal world and it is unreasonable to expect everyone to run a blockchain server to use these apps. But the idea behind decentralization is to not rely on a single/centralized server. So, the community has come up with solutions (hosted blockchain servers, metamask etc.) where you don't have to spend lot of your hard disk and RAM downloading and running a full copy of the blockchain but also not compromise on the decentralized aspect. We will evaluate those options in the future lessons.




Now, what exactly is in the Ethereum blockchain? The blockchain has 2 main components:Database: Every transaction in the network is stored in the blockchain. When you deploy your application, it is considered as a transaction. If you have for example a Voting application that allows anyone to vote for candidates, a vote for a candidate would be considered a transaction. All these transactions are public and any one can see this and verify. This data can never be tampered with. To make sure all the nodes in the network have same copy of the data and to insure no invalid data gets written to this database, Ethereum uses an algorithm called Proof of Work to secure the network. (
http://ethereum.stackexchange.com/questions/14/what-proof-of-work-function-does-ethereum-use)
Code: The database aspect of blockchain just stores the transactions. But where is all the logic to vote for candidate, retrieve the total votes etc. In Ethereum world, you write the logic/application code (called contract) in a language called Solidity. You then use the solidity compiler to compile it to Ethereum Byte Code and then deploy that byte code to the blockchain (There are few other languages you could use to write contracts but solidity is by far the most popular and relatively easier option). So, not only does Ethereum blockchain store the transactions, it also stores and executes the contract code.

So basically, the blockchain stores your data, stores the code and also runs the code in the EVM (Ethereum Virtual Machine). You will learn more about ByteCode and EVM in the future sections.

To build web based Dapps, Ethereum comes with a handy javascript library called web3.js which connects to your blockchain node. So you can just include this library in your famous js framework like reactjs, angularjs etc and start building

You must be wondering why these applications are called smart contracts. In general, contract is a written agreement between two or many parties that is intended to be enforced by law. If we take this written contract and translate it in to code and deploy on the blockchain, we get digital contracts. But the beauty of this code on the blockchain is that it can enforce the agreement between parties and that is the reason they are called "smart contracts".

How can this code enforce the agreement? If you remember, once a contract is deployed to the blockchain, it can neither be stopped nor modified. That is how the agreement is enforced. Let's take a look at a simple example to understand this better.




Let's say we want to build a Crowdsale application. There is a creator who wants to raise $10,000 to create a product and there are potential customers who are interested in this product and are willing to pre-pay for it. The agreement is, each customer will contribute anywhere between $10 - $10,000 and if the goal is met, the money is sent to the creator. If not, money is sent back to the contributors. This is an ideal use case to use smart contract to enforce the agreement between the creator and supporters. It is trivial to implement this logic in a centralized application as well. The advantages of implementing this in a smart contract areThe money sent by all the contributors is in the smart contract. Neither the contributor nor the creator can take that money.
The code can be implemented so that the money is sent to the creator as soon as the goal is reached.The code can be implemented so anyone can trigger a refund to all the customers if the goal is not reached within a certain time frame.
This code can not be tampered once it is deployed on to the blockchain.

Just like in the real world, each country has it's own currency like USD, INR, RNB, GBP, EUR etc, each blockchain has it's own currency. In the case of Ethereum blockchain, the native currency is called Ether. There are exchanges where you can convert Ether to any other fiat currency like USD or EUR. You can see the current price of Ether here
In the real world, currencies have various denominations. For example, a US Dollar is equal to 100 cents and it has various denominations such as pennies (1 cent), nickel (5 cents), dime (10 cents), quarter (25 cents). Depending on your country and currency, you probably have various denominations as well.
Ether also has various denominations as shown on the right. The only two you should really remember are Ether and Wei. Wei is the lowest denomination and this is the denomination you use in your smart contracts.




Comments

Popular posts from this blog

BIG List of Security Related Websites [400+ sites]

http://cryptosuite.org/forum/ 260 CryptoSuite.ORG 80 || The Best Encryption Platform Of The World http://www.turkworm.com/default/index.php?wwwRedirect 154 IP//TurkWorm.Com Hacking & Security Platform - Anasayfa http://www.turkishajan.com/ 88 Hack l TurkishAjan Turkish Hacking&Security Forum // Turk Hack ve Güvenlik Forumları http://www.wardom.org/forum.php 69 Wardom.Org 8 - Forum http://www.idhteam.org/ 73 IDHTEAM UNDERGROUND http://hcegroup.us/forum/forum.php 170 H@ck and Cr@ck = Enj0y! http://beyeugroup.net/BYG/forum.php 60 BeYeuGroup - A Legend of Vietnamese Hackers World http://cin1team.biz/index.php 62 CiN1 Team - Cracking Is Number 1 http://diendancracker.com/ 23 diễn đàn crack, diễn đàn seo, crack việt nam http://forum.vncno1.com/ 23 VNC No.1 - VNC Family http://sinhvienit.net/forum/ 12 Diễn đàn - Cộng đồng sinh viên CNTT http://www.vhcteam.net/VHC/index.php 14 VHC TEAM http://vietmatrix.net/upload/index.php 29 Viet Matrix - VietNam Hacker Community http...

What Is Ethereum?

A t its core, Ethereum is a decentralized global software platform powered by Blockchain technology . It is most commonly known for its native cryptocurrency, ether, or ETH. Ethereum can be used by anyone to create any secured digital technology. It has a token designed for use in the blockchain network, but it can also be used by participants as a method to pay for work done on the blockchain. Ethereum is designed to be scalable, programmable, secure, and decentralized. It is the blockchain of choice for developers and enterprises that are creating technology based upon it to change the way many industries operate and how we go about our daily lives. How Does Ethereum Work? Vitalik Buterin, credited with conceiving of Ethereum, published a white paper to introduce it in 2014.  The Ethereum platform was launched in 2015 by Buterin and Joe Lubin, founder of the blockchain software company ConsenSys. The founders of Ethereum were among the first to consider the full potential of bloc...

HOW TO CREATE CARDANO SMART CONTRACTS?

  According to the Cardano blockchain, Cardano’s new Alonzo Hard Fork gained traction as soon as it was launched on the network. The Alonzo update was released and implemented on the mainnet on the 13th of September,2021. Smart contracts can now be developed and deployed on the mainnet as a result of this development. Alonzo provides Cardano with smart contract capabilities and enhances its functionality by incorporating the Plutus scripts written in a simple, functional language such as Solidity or Haskell and allowing users to place the scripts. With such a beneficial update around smart contracts on Cardano, we must learn about smart contract development on the Cardano platform. To begin with, let’s understand the basic definition of smart contracts. What are Smart Contracts? Smart contracts are pre-programmed, automatic digital agreements. They are self-executing and unchangeable. They do not entertain any activity of a middleman or the presence of any third parties. We can div...

How Bitcoin Works

Bitcoin is more than a cryptocurrency used as a payment or for investors to hold and hope for value increases. There is an entire ecosystem at work behind a cryptocurrency. There are many of these ecosystems working on the internet today, but because Bitcoin was the first, it's essential to understand what makes it work and how. Learn what's going on behind the scenes in the Bitcoin network to help you further your understanding of this digital phenomenon and how it influences the world's finances. The Bitcoin Blockchain The Bitcoin blockchain is a database of transactions secured by encryption and validated by peers. Here's how it works. The blockchain is not stored in one place; it is distributed across multiple computers and systems within the network. These systems are called nodes. Every node has a copy of the blockchain, and every copy is updated whenever there is a validated change to the blockchain. The blockchain consists of blocks, which store data about trans...

What is Polkadot? (DOT)

The Beginner’s Guide to Polkadot Polkadot is a software that seeks to incentivize a global network of computers to operate a  blockchain  on top of which users can launch and operate their own blockchains. In this way, Polkadot is one of a number of competing blockchains aiming to grow an ecosystem of  cryptocurrencies , other notable examples of which include  Ethereum  (ETH),  Cosmos  (ATOM) and  EOSIO  (EOS).  However, Polkadot, launched in 2020, is among the newest, and it introduces a number of novel technical features toward its ambitious goal.  To begin, Polkadot is designed to operate two types of blockchains. A main network, called a relay chain, where transactions are permanent, and user-created networks, called parachains. Parachains can be customized for any number of uses and feed into the main blockchain, so that parachain transactions benefit from the same security of the main chain.  With this design, the Polkad...

What is Go? Golang Programming Language Meaning Explained

  Go, also known as Golang, is an open-source, compiled, and statically typed programming language designed by Google. It is built to be simple, high-performing, readable, and efficient. In this article, you'll learn: Where Go came from and where it is now, Why I think you should learn it, How to install and run it on Windows 10, and How to write your first "Hello World" program in Go Table of Contents What's the Name? Go or Golang? How Go Came into Existence Why you Should Learn Go How to Install and Run Go on Windows 10 How to Write your First Hello World in Go Conclusion What's the Name? Go or Golang? You might hear the language called both Go and Golang, which might be confusing. I once thought they were names for different languages. But Golang is just another name for Go – and Go remains the official name. Golang came from the domain name of the Go official website, golang.org. Which is actually really helpful, because “Golang” is much more searchable than ...