hg0088线上

What is a blockchain?

hg0088线上a blockchain is best described as a public database that is updated and shared across many computers in a network.

hg0088线上"block" refers to the fact that data and state is stored in sequential batches or "blocks". if you send eth to someone else, the transaction data needs to be added to a block for it to be successful.

"chain" refers to the fact that each block cryptographically references its parent. a block's data cannot be changed without changing all subsequent blocks, which would require the consensus of the entire network.

each new block and the chain as a whole must be agreed upon by every node in the network. this is so everyone has the same data. for this to work, blockchains need a consensus mechanism.

Ethereum currently uses a proof-of-work consensus mechanism. This means that anyone who wants to add new blocks to the chain must solve a difficult puzzle that you need a lot of computing power to work on. Solving the puzzle "proves" that you have spent the computational resources. Doing this is known as mining. Mining can be trial and error but adding a block successfully is rewarded in Eth. On the other hand, submitting fraudulent blocks is not an attractive option considering the resources you've spent on producing the block.

hg0088线上new blocks are broadcast to the nodes in the network, checked and verified, updating the state for everyone.

hg0088线上so to summarise, when you send eth to someone, the transaction must be mined and included in a new block. the updated state is then shared with the entire network. more on the details below.

What is Ethereum?

in the ethereum universe, there is a single, canonical computer (called the ethereum virtual machine, or evm) whose state everyone on the ethereum network agrees on. everyone who participates in the ethereum network (every ethereum node) keeps a copy of the state of this computer. additionally, any participant can broadcast a request for this computer to perform arbitrary computation. whenever such a request is broadcast, other participants on the network verify, validate, and carry out (“execute”) the computation. this causes a state change in the evm, which is committed and propagated throughout the entire network.

requests for computation are called transaction requests; the record of all transactions as well as the evm’s present state is stored in the blockchain, which in turn is stored and agreed upon by all nodes.

cryptographic mechanisms ensure that once transactions are verified as valid and added to the blockchain, they can’t be tampered with later; the same mechanisms also ensure that all transactions are signed and executed with appropriate “permissions” (no one should be able to send digital assets from alice’s account, except for alice herself).

What is Ether?

hg0088线上the purpose of ether, the cryptocurrency, is to allow for the existence of a market for computation. such a market provides an economic incentive for participants to verify/execute transaction requests and to provide computational resources to the network.

hg0088线上any participant who broadcasts a transaction request must also offer some amount of ether to the network, as a bounty to be awarded to whoever eventually does the work of verifying the transaction, executing it, committing it to the blockchain, and broadcasting it to the network.

the amount of ether paid is a function of the length of the computation. this also prevents malicious participants from intentionally clogging the network by requesting execution of infinite loops or resource-intense scripts, as these actors will be continually charged.

What are dapps?

hg0088线上in practice, participants don’t write new code every time they want to request a computation on the evm. rather, application developers upload programs (reusable snippets of code) into evm storage, and then users make requests for the execution of these code snippets with varying parameters. we call the programs uploaded to and executed by the network smart contracts.

hg0088线上at a very basic level, you can think of a smart contract like a sort of vending machine: a script which, when called with certain parameters, performs some actions or computation if certain conditions are satisfied. for example, a simple vendor smart contract could create and assign ownership of a digital asset if the caller sends ether to a specific recipient.

hg0088线上any developer can create a smart contract and make it public to the network, using the blockchain as its data layer, for a fee paid to the network. any user can then call the smart contract to execute its code, again for a fee paid to the network.

hg0088线上thus, with smart contracts, developers can build and deploy arbitrarily complex user-facing apps and services: marketplaces, financial instruments, games, etc.

Terminology

Blockchain

the sequence of all blocks that have been committed to the ethereum network in the history of the network. so-named because each block contains a reference to the previous block, which helps us maintain an ordering over all blocks (and thus over the precise history).

ETH

hg0088线上the native cryptocurrency of ethereum. users pay ether to other users to have their code execution requests fulfilled.

EVM

the ethereum virtual machine is the global virtual computer who’s state every participant on the ethereum network stores and agrees on. any participant can request the execution of arbitrary code on the evm; code execution changes the state of the evm.

More on the EVM

Nodes

the real-life machines which are storing the evm state. nodes communicate with each other to propagate information about the evm state and new state changes. any user can also request execution of code by broadcasting code execution request from a node. the ethereum network itself is the aggregate of all ethereum nodes and their communications.

More on nodes

Accounts

where ether is stored. users can initialize accounts, deposit ether into the accounts, and transfer ether from their accounts to other users. accounts and account balances are stored in a big table in the evm; they are a part of the overall evm state.

More on accounts

Transactions

hg0088线上a “transaction request” is the formal term for a request for code execution on the evm, and a “transaction” is a fulfilled transaction request and the associated change in the evm state. any user can broadcast a transaction request to the network from a node. for the transaction request to actually affect the agreed-upon evm state, it must be validated, executed, and “committed to the network” by some other node. execution of any code causes a state change in the evm; upon commitment, this state change is broadcast to all nodes in the network. some examples of transactions:

More on transactions

Blocks

the volume of transactions is very high, so transactions are “committed” in batches, or blocks. blocks generally contain dozens to hundreds of transactions.

More on blocks

Smart contracts

A reusable snippet of code (a program) which a developer publishes into EVM memory. Anyone can request that the smart contract code be executed by making a transaction request. Because developers can write arbitrary executable applications into the EVM (games, marketplaces, financial instruments, etc.) by publishing smart contracts, these are often also called dapps, or Decentralized Apps.

More on smart contracts

Further reading

Back to top ↑
  • On this page
  • What is a blockchain?
  • What is Ethereum?
  • What is Ether?
  • What are dapps?
  • Terminology
  • Further reading
  • Related tutorials