How to DeFi Beginner third part)

lunaray
5 min readJan 27, 2022

Detailed explanation of how to DeFi for beginner, Welcome to follow and discuss with us

Author: Lunaray Team

lunaray.sec@outlook.com

0x01 What is Ethereum

As mentioned in the previous articles, most DeFi Dapps are currently built on the Ethereum blockchain. But what exactly is Ethereum? Ethereum is a global, open source decentralized application platform. You can think of Ethereum as a world computer that no one can shut down. On Ethereum, software developers can write smart contracts that control digital value through a set of standards and can be accessed anywhere in the world.

0x02 What is Smart Contract

A smart contract is a programmable contract that allows two parties to set trading conditions without trusting another third party to execute.

For example, if Christina Aguilera wanted to set up a trust fund to pay David $100 at the beginning of each month for the next 12 months, she could program a smart contract to: 1. Check the current date 2. At the beginning of each month, Automatically send $100 to Bob 3. Repeat until fund in smart contract is ran out.

When using smart contracts, Christina Aguilera has bypassed the need to have a trusted third-party intermediary (lawyer, escrow agent, etc.) to send David the trust fund and make the process transparent to all parties involved.

Multiple smart contracts are grouped together to interoperate, known as decentralized applications (Dapps), to accomplish more complex processes and computations.

0x03 What is ETH?

Ether can be used for everyday transactions similar to Bitcoin. You can send ether to another person to buy goods and services based on the current market value. The Ethereum blockchain records the transfer process and ensures the final outcome of the transaction.

Furthermore, ether is also used to pay for allowing smart contracts and Dapps to run on the ethereum network. You can think of executing smart contracts on the Ethereum network as driving a car. To drive a car, you need fuel. To execute a smart contract on Ethereum, you need to pay a fee called Gas in ether.

Currently, in the DeFi ecosystem, ether is the asset of choice, used as collateral for many DeFi Dapps. It provides security and transparency to this financial system.

0x04 What is Gas?

On Ethereum, all transactions and smart contracts are executed with a small fee. This fee is called Gas. Technically, Gas refers to a measure of the amount of computation required to execute an operation or smart contract. The more complex the operation, the more Gas is required to complete the operation. Gas fees are paid entirely in ETH.

Gas prices fluctuate based on network demand. When more people interact on the Ethereum blockchain, such as transacting with ETH or executing smart contract transactions, the gas price increases due to limited computing resources on the network. Conversely, when the network utilization is insufficient, the gas price will drop.

Users can manually set the Gas fee. When the network is congested due to high utilization, miners will prioritize the transaction with the highest gas fee. Verified transactions will be finalized and added to the blockchain. If the gas fee paid is too low, the transaction will be queued and take a while to complete. Therefore, transactions with below-average gas fees may take longer to complete.

0x04 What is Dapps?

In the context of Ethereum, Dapps are interfaces that interact with the blockchain through the use of smart contracts. Dapps look and behave like regular web and mobile applications, except that they interact with the blockchain in different ways. Some of these ways include requiring ETH to use Dapps, storing user data on the blockchain, making it immutable, and more.

What are the benefits of Dapps?

  • Immutability:Once executed on the blockchain, no one can change any information.
  • Tamper-proof:Smart contracts published to the blockchain cannot be tampered with without alerting all other participants on the blockchain.
  • Transparency: The smart contracts that power Dapps are publicly auditable.
  • Availability. As long as the Ethereum network remains running, Dapps built on it will remain running and available.

What are the disadvantages of Dapps?

  • Immutability: Smart contracts are written by humans, and the quality is closely related to the ability of the writers. Since human error is inevitable, immutable smart contracts have the potential to compound errors into big problems.
  • Transparency: Publicly auditable smart contracts can also be an attack vector for hackers, as hackers can look at the code to find vulnerabilities.
  • Extensibility:In most cases, the bandwidth of a Dapp is limited by the blockchain on which it resides.

What else can Ethereum be used for?

In addition to creating Dapps, Ethereum has two core capabilities: creating decentralized autonomous organizations (DAOs) and issuing other cryptocurrencies.

The DAO is a fully autonomous organization, not governed by a single person, but by code. This code is based on smart contracts, enabling DAOs to replace how traditional organizations typically operate. Since it runs on code, it will be protected from human intervention and will operate transparently. will not be affected by any external factors. Governance decisions or rulings will be voted on by DAO tokens.

Speaking of tokens, Ethereum can serve as a platform to create other cryptocurrencies. There are currently two popular token protocols on the Ethereum network. ERC-20 and ERC-721. Both ERC-20 and ERC-721 are protocol standards that define the rules and standards for issuing tokens on Ethereum.

ERC-20 tokens are fungible, which means they are interchangeable and have the same value. ERC-721 tokens are non-fungible, meaning they are unique and not fungible. A simple analogy is to think of ERC-20 as currency and ERC-721 as collectibles like people or baseball cards.

0x05 Ethereum’s future

Ethereum’s popularity continues to grow as it becomes a core essence of DeFi growth. With these first-mover advantages, the number of users and transactions continues to grow every day. While many hailed this as a success for DeFi, the surge in demand has put enormous pressure on the network.

Rising gas fees are one of the most important issues, as users pay exorbitant fees during peak hours. High gas fees have led to the rapid development of other competing chains, such as Polkadot.

To ensure the continued success of the Ethereum network, the Ethereum community is planning to launch an upgrade known as ETH 2.0. ETH2.0 is a huge project spanning more than three years, using ‘sharding’ technology. Once the upgrade is fully implemented, the network will become more scalable and will solve the problem of high gas fees.

--

--

lunaray

Lunaray takes a leading position in smart contract auditing and consulting service for blockchain security.