decrypt101
SocialOpen ProjectsSupport me My Resumes
  • Preface
    • Motivation
    • Roadmap’s
  • Introduction to Blockchain
    • A Brief History
    • Growth of Blockchain
    • Structure of Blockchain
    • Types of Blockchain
    • Key Technologies of Blockchain
    • Features of Blockchain
    • How Blockchain Works ?
    • Implementation of Blockchain
    • Summary
  • Components of Blockchain Architecture
    • Distributed Ledger
    • Blocks
    • Transaction
    • Chain
    • Peer-to-Peer Network
    • Blockchain Layers
    • Off-Chain & On-Chain
    • Wallet
    • Mining
    • Tokens
    • Assets
    • State Channels
    • Sidechains
    • Oracles on Blockchain
    • Atomic Swaps
    • Decentralized Identity (DID)
    • Blockchain Data Storage
    • Interoperability
    • Data structures for Scaling Blockchain
    • Maximal Extractable Value (MEV)
  • Consensus Mechanisms
    • Proof of Work (PoW)
      • Implemation Using Rust
    • Proof of Stake (PoS)
    • Proof of Burn (PoB)
    • Proof of Capacity (PoC)
    • Proof of Activity (PoAc)
    • Proof of Weight (PoWe)
    • Proof of Luck (PoL)
    • Proof of Ownership (PoO)
    • Proof of Existence (PoE)
    • Proof of Believability (PoBe)
    • Proof of History (PoH)
    • Proof of Authority (PoA)
    • Proof of Elapsed Time (PoET)
  • Cryptographics
    • Encryption & Decryption
      • Symmetric Encryption
      • Asymmetric Encryption
      • Key Management and Exchange
      • Implementation
    • Cryptographic Hashing
      • Secure Hash Algorithms (SHA)
      • Message Digest Algorithms
      • Ethash
      • Blake2
      • SCrypt
      • RIPEMD-160
    • Digital Signature
      • Digital Signature Algorithms
      • Digital Signature in Blockchain
    • Zero-Knowledge Proofs (ZKPs)
      • Types of Zero-Knowledge Proof and Protocols
      • A Case Study of Polygon Platform
    • Multi-Party Computation (MPC)
    • Cryptanalysis
    • Practical Implementation
  • Decentralized Application (DApp)
    • Design and UX in Web3
  • Smart Contract
    • Development Tools
    • Solidity
    • Testing Smart Contract
    • Developing Smart Contract
    • Interacting & Deploying with Smart Contract
    • Verifying Smart Contracts
    • Upgrading Smart Contracts
    • Securing Smart Contract
    • Smart Contract Composability
    • Testnet and Mainnet
    • Blockchain Platform Using Smart Contract
    • Application of Smart Contract
    • Practical Implementation
  • Blockchain Platforms
    • Ethereum
      • Ethereum Virtual Machine (EVM)
      • ETHER and GAS
      • Ethereum transaction
      • Ethereum Accounts
      • Ethereum Stacking
      • Ethereum Network
      • Ethereum Scaling Solutions
      • Ethereum Use-Cases
      • Getting Started with Ethereum
      • Ethereum Ecosystem and Support
    • Solana
      • Solana Architecture
        • Solana Account Model
        • Solana Wallet
        • Transactions and Instructions
        • Solana Programs
        • Program Derived Address (PDA)
        • Cross Program Invocation (CPI)
        • Tokens on Solana
        • Clusters and Public RPC Endpoints
        • Transaction Confirmation & Expiration
        • Retrying Transactions
        • Versioned Transactions
        • Address Lookup Tables
        • State Compression
        • Actions and Blinks
      • Solana Developments
      • Solana Client
      • Advanced Solana
      • Solana Scaling and Performance Architecture
      • Solana Solutions and cases
      • Practical Implemenation
    • Binance Smart Chain (BSC)
      • Create a BEP20 Token
    • Hyperledger Fabric
    • Cosmos
    • Polkadot
    • Quorum
    • Polygon
    • Algorand
    • Corda
    • Avalanche
    • TRON
    • Summary
  • Decentralized Finance (DeFi)
    • DeFi Components
    • DeFi Protocols
    • DeFi Platforms
    • DeFi Risk Classification
      • Infrastructure-layer Attacks
      • Smart Contract Layer-attacks
      • Application Layer-attacks
      • DeFi Risks
    • DeFi and Blockchain
    • DeFi Impact
  • Decentralized Ecosystem and Digital Innovation
    • Layer 2 Scaling Fundamental
    • Tokenomics
    • Cryptocurrency
    • Quantative Trading
    • NFTs
    • GameFi
    • Metaverse
  • Blockchain as a Service (BaaS)
    • Building Fullstack Blockchain Platform
    • Decentralized Digital Identity
    • Build a Cryptocurrencies Exchange
    • Play-to-Earn Gaming
    • Solana Token Airdrop Manager
    • Smart Contract Development on Solana with Rust
    • Quantitative Trading Platform
    • Insurances protocols
    • Flash Loans
    • Asset Management
    • Tokenized Derivatives
    • Automated Market Makers (AMMs)
    • Staking
    • Lending and Borrowing Platforms
    • Yield Farming
    • Stablecoin System
    • Security Token Offerings (STOs)
    • Initial Coin Offerings (ICOs)
    • On-Chain Voting Systems
    • Decentralized Autonomous Organizations (DAOs)
    • NFT Marketplaces
    • Provenance Verification
    • Supply Chain Tracking
    • Commodities Tokenization
    • Real Estate Tokenization
    • Digital Certificates
    • KYC (Know Your Customer)
  • Blockchain Development Across Languages
    • Blockchain using Go(Golang)
    • Blockchain using Rust
    • Blockchain using Python
    • Blockchain using Cairo
  • Distributed Systems & Infrastructure Technology
    • Classification of Distributed Systems
    • Networked systems versus Distributed systems
    • Parallel systems vs Distributed systems
    • Distributed versus Decentralized systems
    • Processes of Distributed Systems
    • Architecture of Distributed systems
    • Infrastructure Technologies
  • Distributed System Patterns
    • Distributed Agreements Algorithms
      • HoneyBadgerBFT
    • Data Replications
    • Data Partition
    • Consistency
    • Distributed Time
    • Cluster Management
    • Communication between Nodes
    • Fault Tolerance and Resilience
      • How to design better fault tolerance systems
      • Resilience Patterns
    • Coordination systems
      • Clock synchronization
    • Security
      • Trust in distributed systems
      • Design of Principal Security
      • Security threats, policies, and mechanisms
      • Authentication and Authorizations
      • Cryptography
      • Monitoring in Security
  • Distributed System Design
    • Page 1
    • Distributed Shared Memory
    • Distributed Data Management
    • Distributed Knowledge Management
    • Distributed Ledger
  • FAQs
  • Support and Community
Powered by GitBook
On this page
  • Types of peer-to-peer networks
  • Unstructured
  • Structured
  • Hybrid
  • What are the advantages of peer-to-peer networks?
  • Example Use Cases of P2P
  1. Components of Blockchain Architecture

Peer-to-Peer Network

PreviousChainNextBlockchain Layers

Last updated 8 months ago

A P2P (Peer-to-Peer) network is a decentralized network architecture in which each participant (node) acts as both a client and a server. This means that each node can initiate or complete transactions and share resources, such as data, bandwidth, or processing power, directly with other nodes without relying on a central authority or intermediary.

P2P networks have varied applications, but the most common is media sharing (like music, movies, and games). Because there’s no central controller, all content stored on the network is distributed across the peers. Content may be stored in multiple locations, and each peer is equally capable of providing other peers with requested content. Peers may also contribute to managing network traffic and file location processes.

Types of peer-to-peer networks

A core principle of any P2P network is that no single entity has complete control over any particular content because that content exists in multiple independent locations and is controlled by many parties. However, the mechanisms used to deliver content from one node to the next can vary from network to network, depending on the type of P2P network.

Unstructured

This is a pure application of P2P. Nodes are connected to other nodes on the fly as they join the network—there’s no overarching organization. The upside of unstructured P2P networks is that they’re easy to build, and can handle a high frequency of nodes joining and leaving (called “churn”). A downside is that the lack of organized communication between nodes can cause inefficient searches. A search request is either broadcast widely across the network, or passed from node to node until the requested content is found. This uses lots of network resources, and can be unsuccessful if the requested content is obscure and hard to locate.

Structured

Hybrid

A hybrid P2P network aims to reproduce the best features of both the structured and unstructured models. In a hybrid P2P network, a central server keeps track of nodes and helps one node find another. The central server also oversees the indexing of content. A node looking for content contacts the central server to find where the desired content is, but then communicates directly with the node identified as having the content. The content doesn’t pass through the central server. In this way, the hybrid approach gains an efficiency advantage from having a reliable and robust central server, while still tapping into the performance advantages of nodes working together directly.

What are the advantages of peer-to-peer networks?

There are good reasons some Internet applications choose to use a P2P structure, including:

  • Inherent scalability: When a node joins the network, it adds to network capacity at the same time it’s adding to demand. One node leaving or not performing well can be offset by the rest of the network.

  • Increased stability: Because data doesn’t reside on a single server, access to data can’t be lost due to a server experiencing an attack or outage.

  • Longer-lived content: It’s very difficult to completely remove data stored in multiple locations. In contrast, data found only on a single server is easy to take out of circulation, whether voluntarily, through censoring, or by outside forces like hackers. Data longevity also means improved archiving of older material.

  • Better performance: Direct communication between nodes means shorter transmission routes and faster response typically. In the case of a large data file, the data can be partitioned into smaller pieces, with each piece delivered by a different peer. Receiving data from multiple sources simultaneously means collecting a large file takes much less time.

  • Cost savings: Peers replace expensive servers, reducing the costs of meeting high demand content requests.

Example Use Cases of P2P

Peer-to-peer (P2P) networks are versatile and can be applied to a variety of use cases. Here are some common and notable use cases:

1. File Sharing

  • Example: BitTorrent

  • Description: P2P networks are commonly used for distributing large files efficiently. In a file-sharing network like BitTorrent, files are broken into chunks and distributed across many peers. Each peer can upload and download chunks simultaneously, which speeds up the overall transfer and reduces the load on any single server.

2. Cryptocurrencies

  • Example: Bitcoin, Ethereum

  • Description: Cryptocurrencies use P2P networks to facilitate decentralized transactions and maintain a distributed ledger (blockchain). Each node in the network maintains a copy of the blockchain and participates in validating transactions, ensuring the system is secure and resilient against central points of failure.

3. Decentralized Applications (dApps)

  • Example: Decentralized Finance (DeFi) platforms

  • Description: dApps run on P2P networks and decentralized blockchains, providing services without relying on a central authority. They enable users to interact directly with smart contracts and other blockchain-based applications for financial transactions, lending, and more.

4. Voice and Video Communication

  • Example: Skype (pre-Microsoft acquisition), WebRTC-based apps

  • Description: P2P networks enable direct communication between users for voice and video calls. WebRTC, for instance, allows browsers to communicate directly with each other without the need for intermediaries, improving efficiency and reducing latency.

5. Distributed Computing

  • Example: SETI@home, Folding@home

  • Description: P2P networks can be used to harness the computational power of distributed nodes to perform complex calculations. Projects like SETI@home use idle CPU resources from volunteers to analyze data from space, while Folding@home uses distributed computing for biomedical research.

6. Content Distribution Networks (CDNs)

  • Example: Peer-to-peer CDNs

  • Description: P2P networks can enhance content delivery by distributing the load across multiple peers. In a P2P CDN, content is cached and shared among peers, reducing the reliance on central servers and improving the speed and reliability of content delivery.

7. Gaming

  • Example: P2P multiplayer games like some versions of Fortnite or Age of Empires

  • Description: In online multiplayer games, P2P networks can be used for player-to-player interactions, reducing latency and server load. This allows players to connect directly with each other, facilitating faster and more responsive gameplay.

8. Distributed Data Storage

  • Example: IPFS (InterPlanetary File System)

  • Description: P2P networks can be used for decentralized file storage. In IPFS, files are split into smaller pieces and distributed across the network. Each peer stores and shares parts of the files, creating a resilient and scalable storage system.

9. Blockchain-Based Voting Systems

  • Example: Some blockchain-based voting systems

  • Description: P2P networks can be used to create secure, transparent voting systems. Blockchain technology ensures that votes are recorded and verified in a decentralized manner, preventing tampering and ensuring trust in the election process.

10. Decentralized Social Networks

  • Example: Mastodon

  • Description: Decentralized social networks use P2P principles to allow users to interact on a platform without relying on a central authority. Users connect directly with each other and share content, often in a federated or distributed manner.

Benefits of P2P Networks

  • Scalability: Easily scales with the number of peers.

  • Resilience: More resilient to failures and attacks since there’s no single point of failure.

  • Cost Efficiency: Reduces costs associated with centralized infrastructure.

  • Privacy: Can enhance privacy by avoiding centralized data storage.

P2P networks are powerful and flexible, supporting a wide range of applications from file sharing and communication to decentralized finance and distributed computing. Each use case leverages the unique strengths of P2P architecture to achieve specific goals.

A structured P2P network introduces a hierarchy to the nodes’ interconnectivity. Nodes are connected in an organized fashion to maximize efficiency. New content or a new location of existing content is logged into a “map” called a table. Search requests use this “map” to find the best location to retrieve the content from. Having nodes and content organized and quickly locatable makes for a more efficient network. However, when the network experiences churn, it can be a challenge to maintain the structured organization of node connectivity and to keep hash tables up-to-date.

hash