Skip to content

Commit

Permalink
Merge pull request Akshat111111#79 from shivenyadavs/main
Browse files Browse the repository at this point in the history
Update Readme.md added Fundamentals of Blockchain and Ethereum
  • Loading branch information
Akshat111111 authored Nov 4, 2024
2 parents 4a149a1 + 8416bea commit 74df076
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,87 @@ This smart contract ensures that every transaction is recorded on the blockchain

![Line](https://user-images.githubusercontent.com/85225156/171937799-8fc9e255-9889-4642-9c92-6df85fb86e82.gif)

# Fundamentals of Blockchain and Ethereum

### Blockchain Technology
Blockchain is a decentralized and distributed ledger technology that ensures data transparency, security, and immutability. The core characteristics of blockchain technology include:

- **Decentralization**: Information is stored across multiple nodes, reducing the reliance on a central authority.
- **Immutability**: Once data is added to the blockchain, it cannot be altered or deleted, providing a permanent record.
- **Transparency**: All transactions are visible to participants on the network, ensuring accountability.

### How Blockchain Works
Blockchain operates as a chain of blocks, where each block contains transaction data, a timestamp, and a cryptographic hash of the previous block, creating a secure and linked structure. Key concepts in blockchain operation include:

- **Blocks and Chains**: Each block holds data and is linked to the previous one, forming a continuous chain.
- **Consensus Mechanisms**: Blockchains rely on consensus protocols to verify transactions and maintain network integrity. Common mechanisms include:
- **Proof of Work (PoW)**: Miners solve complex puzzles to add a new block, ensuring network security.
- **Proof of Stake (PoS)**: Validators are chosen based on their stake in the network, improving efficiency and reducing environmental impact.

### Transactions on the Blockchain
1. **Initiation**: A transaction is created by a user and broadcast to the network.
2. **Validation**: Miners (in PoW) or validators (in PoS) confirm the authenticity of the transaction.
3. **Recording**: Once validated, the transaction is added to a block and permanently recorded on the blockchain.
4. **Transaction Fees**: Fees incentivize miners or validators to confirm transactions and secure the network, rewarding them for their resources.

---

### Introduction to Ethereum
Ethereum is a decentralized platform designed for building and deploying **smart contracts** and **decentralized applications (DApps)**. Unlike Bitcoin, Ethereum is not solely a digital currency; it is a programmable blockchain that enables developers to create custom applications.

- **Ethereum Virtual Machine (EVM)**: The EVM is a runtime environment for executing smart contracts on the Ethereum blockchain, providing a sandbox for developers to deploy decentralized applications.
For more information, download the [How Does Ethereum Work](howdoesethereumwork.pdf)
---

### Smart Contracts Overview
Smart contracts are self-executing contracts with the terms of the agreement directly written into code. They automatically enforce and execute agreements based on predetermined conditions without the need for intermediaries.

- **Benefits of Smart Contracts**:
- **Automation**: Smart contracts automatically execute actions based on specific triggers.
- **Trustlessness**: They eliminate the need for intermediaries, reducing transaction costs and increasing trust.

# Transaction Lifecycle

## 1. Initiation of a Transaction
- **Creation**: A user creates a transaction using a wallet or application, specifying the amount and recipient’s address.
- **Signing**: The transaction is signed with the sender’s private key to ensure authenticity.
- **Broadcasting**: The signed transaction is broadcast to the blockchain network.

## 2. Transaction Propagation
- **Node Communication**: Nodes receive the transaction and verify its format and validity.
- **Transaction Pool (Mempool)**: Valid transactions are stored in the mempool until picked up by miners.
- **Validation by Nodes**: Each node independently checks that the transaction meets network rules (e.g., sufficient balance).

## 3. Mining and Confirmation
- **Mining Process**: Miners collect transactions from the mempool and attempt to include them in a new block by solving cryptographic puzzles.
- **Consensus Mechanisms**: The network reaches agreement on the state of the blockchain (e.g., Proof of Work or Proof of Stake).
- **Adding to the Blockchain**: Once a block is mined, it is added to the blockchain, and the transactions within it are considered confirmed.

## 4. Transaction Settlement
- **Recording on the Blockchain**: The transaction is permanently recorded, ensuring immutability.
- **Immutability of Transactions**: Once confirmed, a transaction cannot be altered or deleted.
- **Transaction Fee Distribution**: Miners receive fees for processing transactions, incentivizing their participation.

## Post-Transaction Activities
Here are the post-transaction activities:

- **Transaction Verification**: After confirmation, the transaction can be verified by anyone using the blockchain’s public ledger. Users can check the status and details of their transactions using a block explorer.
- **Monitoring and Auditing**: Organizations may monitor transactions for compliance, auditing, and fraud prevention. The transparency of blockchain makes it easier to track transaction histories.
- **Dispute Resolution Mechanisms**: In case of discrepancies or disputes (e.g., double-spending attempts), blockchain networks may have protocols or smart contracts in place to handle such situations.

## Challenges in the Transaction Lifecycle
Here are the challenges in the transaction lifecycle in Blockchain:

- **Network Congestion**: As user adoption increases, the volume of transactions can lead to congestion, resulting in slower processing times and higher transaction fees.
- **Limited Throughput**: Many blockchains have a limited number of transactions they can process per second (TPS), which can hinder their ability to handle large-scale applications.
- **Delay in Transaction Confirmation**: Transactions may take longer to confirm during periods of high network activity, which can be frustrating for users expecting instant transactions.
- **Inconsistent Times**: Different blockchains have varying confirmation times, which can lead to uncertainty in transaction finality.
- **51% Attacks**: In proof-of-work systems, if a single entity gains control of more than 50% of the network’s mining power, they could potentially manipulate transactions.
- **KYC/AML Challenges**: Implementing Know Your Customer (KYC) and Anti-Money Laundering (AML) procedures within decentralized systems can be difficult.
- **Fragmented Ecosystems**: Different blockchain networks often operate in silos, making it difficult to transfer assets or data between them seamlessly.
- **Lack of Standardization**: The absence of common standards for interoperability can hinder collaboration between different blockchain systems.
- **Error-Prone Processes**: Mistakes in sending transactions, such as entering incorrect addresses or amounts, can lead to irreversible losses.
![Lifecycle of a Transaction](https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flv10927ekqpfpypyhapq.png)

## **🧾Setup Instructions🧾**

Expand Down
Binary file added howdoesethereumwork.pdf
Binary file not shown.

0 comments on commit 74df076

Please sign in to comment.