00 - Smart Contract Security | Blockchain basics
Tags: blockchain, security, solidity, ethereum
Published: 2021-10-10 04:57:41

In this series of smart contract security articles, I ([@geekshiv](https://twitter.com/geekshiv)) and [@Thtsuman](https://twitter.com/Thtsuman) will cover Solidity, Smart Contract, etc with the security (Audit) aspect of it. Let's go through some of the basic terms and concepts before jumping to the complex part.
<br />

- **Block**: Block is kind of container which stores data relevant to the network and transactions. Example: If you send ETH to someone, the transaction data needs to be added to a block for it to be successful.

A block may look like this:
![Block Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvcjexi1nv6lo6gieojr.png)
<br />

- **Block-chain**: Whenever a new block is created it refers to it's parent block and this creates a chain of blocks. A block's data cannot be changed without changing all subsequent blocks, which would require the consensus of the entire network.
![Blockchain Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3qean2615zqkujc17k20.jpeg)
<br />

- **Ethereum**: Ethereum is built upon the concept of blockchain which acts as an open-source blockchain network providing features like a decentralized ledger, Smart Contracts, tokens (ERC-20 and ERC-721), and has its cryptocurrency called Ether(ETH).
<br />

- **Ether**: Ether (ETH) is a cryptocurrency. It facilitates the operations of the ethereum platform. 
Example: Any transaction in the ethereum network needs a fee that is paid in the form of ether.
<br />

- **Gas**: Gas is a fee that is paid to the miner for the computational effort required to execute specific operations on the Ethereum network. 

<br />
- **Consensus**: When it comes to a decision of a network or large group the majority of people have to agree upon the decision to be successfully executed. This agreement can be referred to as a consensus mechanism. In Blockchain at least 51% of nodes have to agree for successful execution.
In Ethereum Consensus is achieved using the following Consensus mechanisms:
    1. Proof of Work (PoW)
    2. Proof of Stake (PoS)
<br />

- **Smart Contract**: A smart contract is a digital contract that is deployed on the Ethereum network. A smart contract is basically an agreement between nodes converted into a piece of code which once agreed upon and deployed on the network cannot be changed.
<br />

- **Solidity**: Solidity is a programming language that is used to write smart contracts in Ethereum.
<br />

- **Web3**: Web3, in the context of Ethereum, refers to decentralized apps that run on the blockchain. These are apps that allow anyone to participate without monetising their personal data.
<br/>

- **DAPP**: DAPP (decentralized application) is a combination of smart contracts and a frontend interface. DAPP allows users to interact with services using the ethereum network.
<br />

- **DeFi**: Defi (Decentralized finance) is a term referred to finance applications or services on a Blockchain network. Its a modern, effective way of decentralized banking that overcome the difficulties faced in the traditional banking system.
<br />

- **Accounts**: Every entity in the network had an account of its own which is determined by a unique string. The smart contract also has an account that is different from the owner's account. Example account: ``` {0x0B76a1869bb55ABE5c8e696552418CD15e9eaEdd}```
<br />


References:
- https://andersbrownworth.com/blockchain/
- https://ethereum.org/en/developers/docs/
- Web3: https://blockchainhub.net/web3-decentralized-web/