Chapter 1: Basic Concepts of Virtual Currency

Haiyue
16min

Chapter 1: Basic Concepts of Virtual Currency

Learning Objectives
  • Understand the definition and essence of virtual currency
  • Learn about the development history of virtual currency
  • Master the differences between digital currency, cryptocurrency, and virtual currency
  • Recognize the main types of virtual currencies

Definition and Essence of Virtual Currency

Core Concepts

Virtual Currency refers to a digitalized form of currency that uses cryptographic technology to ensure security, without relying on traditional central banks or government institutions for issuance.

Key Characteristics
  • Digital Form: Exists entirely in electronic data format
  • Decentralization: Does not require central authority control
  • Cryptographic Protection: Uses encryption algorithms to ensure security
  • Global Circulation: Can conduct transactions across geographical boundaries

Differences from Traditional Currency

FeatureTraditional CurrencyVirtual Currency
Issuing AuthorityCentral BankAlgorithm/Protocol
Physical FormBanknotes, CoinsDigital Code
Transaction VerificationBanking SystemNetwork Consensus
Storage MethodBank AccountDigital Wallet
TransparencyLimitedHighly Transparent

Development History of Virtual Currency

Important Development Milestones

🔄 正在渲染 Mermaid 图表...

Development Stage Analysis

  1. Concept Inception Period (1990s-2008)

    • Rise of the cypherpunk movement
    • Introduction of digital cash concept
    • Gradual establishment of technical foundation
  2. Technical Validation Period (2009-2013)

    • Stable operation of Bitcoin network
    • Early adopter participation
    • Verification of technical feasibility
  3. Ecosystem Development Period (2014-2019)

    • Emergence of various virtual currencies
    • Development of exchanges and wallet services
    • Beginning of regulatory framework establishment
  4. Mainstream Acceptance Period (2020-Present)

    • Entry of institutional investors
    • Central banks developing digital currencies
    • Flourishing development of Web3.0 ecosystem

Distinguishing Currency Types

Digital Currency vs Cryptocurrency vs Virtual Currency

Concept Distinction

These three concepts are often used interchangeably, but they actually have subtle differences:

  • Digital Currency: The broadest concept, including all forms of digital money
  • Virtual Currency: Specifically refers to digital currency used in virtual environments
  • Cryptocurrency: Decentralized digital currency protected by cryptographic technology
# Conceptual hierarchy example
class DigitalCurrency:
    """Digital Currency Base Class - The broadest concept"""
    def __init__(self, name, is_digital=True):
        self.name = name
        self.is_digital = is_digital

class VirtualCurrency(DigitalCurrency):
    """Virtual Currency - Digital currency used in specific environments"""
    def __init__(self, name, platform):
        super().__init__(name)
        self.platform = platform  # Usage platform

class Cryptocurrency(VirtualCurrency):
    """Cryptocurrency - Decentralized currency protected by cryptography"""
    def __init__(self, name, consensus_mechanism, blockchain):
        super().__init__(name, "Decentralized Network")
        self.consensus_mechanism = consensus_mechanism
        self.blockchain = blockchain
        self.is_decentralized = True

# Instantiate different types of currencies
cbdc = DigitalCurrency("Central Bank Digital Currency")  # Centralized digital currency
game_coin = VirtualCurrency("Game Coin", "A Game Platform")  # Game virtual currency
bitcoin = Cryptocurrency("Bitcoin", "PoW", "Bitcoin Blockchain")  # Cryptocurrency

print(f"Is Bitcoin decentralized: {bitcoin.is_decentralized}")
print(f"Bitcoin consensus mechanism: {bitcoin.consensus_mechanism}")

Main Types of Virtual Currency

1. Payment Tokens

Characteristics: Specifically designed for value transfer and payment Representatives: Bitcoin (BTC), Litecoin (LTC)

class PaymentToken:
    """Payment Token Example"""
    def __init__(self, name, total_supply, block_time):
        self.name = name
        self.total_supply = total_supply  # Total supply
        self.block_time = block_time      # Block time
        self.primary_use = "Payment and value storage"

    def calculate_transaction_fee(self, amount, congestion_level):
        """Calculate transaction fee"""
        base_fee = amount * 0.001  # Base rate 0.1%
        congestion_fee = base_fee * congestion_level  # Network congestion fee
        return base_fee + congestion_fee

# Bitcoin example
bitcoin = PaymentToken("Bitcoin", 21_000_000, 10)  # 21 million total supply, 10-minute blocks
print(f"Estimated fee for transferring 100 BTC: {bitcoin.calculate_transaction_fee(100, 1.5):.4f} BTC")

2. Platform Tokens

Characteristics: Provide infrastructure for smart contracts and DApps Representatives: Ethereum (ETH), Binance Smart Chain (BNB)

class PlatformToken:
    """Platform Token Example"""
    def __init__(self, name, native_token, virtual_machine):
        self.name = name
        self.native_token = native_token
        self.virtual_machine = virtual_machine
        self.supported_features = []

    def add_feature(self, feature):
        """Add platform feature"""
        self.supported_features.append(feature)

    def execute_smart_contract(self, contract_code, gas_limit):
        """Execute smart contract"""
        gas_used = min(len(contract_code) * 100, gas_limit)  # Simplified gas calculation
        return {
            "success": gas_used <= gas_limit,
            "gas_used": gas_used,
            "remaining_gas": gas_limit - gas_used
        }

# Ethereum example
ethereum = PlatformToken("Ethereum", "ETH", "EVM")
ethereum.add_feature("Smart Contracts")
ethereum.add_feature("DeFi Protocols")
ethereum.add_feature("NFT")

# Smart contract execution example
contract_result = ethereum.execute_smart_contract("transfer(address,uint256)", 21000)
print(f"Contract execution result: {contract_result}")

3. Utility Tokens

Characteristics: Provide special functions or benefits within specific ecosystems Representatives: Chainlink (LINK), Basic Attention Token (BAT)

import random
from datetime import datetime

class UtilityToken:
    """Utility Token Example"""
    def __init__(self, name, symbol, use_case):
        self.name = name
        self.symbol = symbol
        self.use_case = use_case
        self.holders = {}
        self.total_supply = 0

    def mint_tokens(self, recipient, amount, reason):
        """Mint tokens"""
        if recipient not in self.holders:
            self.holders[recipient] = 0

        self.holders[recipient] += amount
        self.total_supply += amount

        print(f"Minted {amount} {self.symbol} for {recipient}, reason: {reason}")

    def use_for_service(self, user, amount, service):
        """Use tokens to obtain service"""
        if user in self.holders and self.holders[user] >= amount:
            self.holders[user] -= amount
            return f"User {user} used {amount} {self.symbol} to obtain service: {service}"
        else:
            return f"User {user} has insufficient balance"

# Chainlink LINK token example
chainlink = UtilityToken("Chainlink", "LINK", "Oracle service payment")

# Mint rewards for oracle node providers
chainlink.mint_tokens("Oracle_Node_1", 100, "Providing accurate data")

# Smart contract uses LINK to pay for oracle service
result = chainlink.use_for_service("DeFi_Protocol", 10, "Get ETH/USD price data")
print(result)

4. Governance Tokens

Characteristics: Holders can participate in project decision-making and governance Representatives: Uniswap (UNI), Compound (COMP)

from collections import defaultdict
from datetime import datetime, timedelta

class GovernanceToken:
    """Governance Token Example"""
    def __init__(self, name, symbol):
        self.name = name
        self.symbol = symbol
        self.holders = defaultdict(int)
        self.proposals = []
        self.votes = defaultdict(dict)  # {proposal_id: {voter: vote_power}}

    def distribute_tokens(self, recipient, amount):
        """Distribute governance tokens"""
        self.holders[recipient] += amount
        print(f"Distributed {amount} {self.symbol} to {recipient}")

    def create_proposal(self, proposer, title, description, voting_period_days=7):
        """Create governance proposal"""
        if self.holders[proposer] < 1000:  # Need at least 1000 tokens to propose
            return "Proposer has insufficient tokens, cannot create proposal"

        proposal = {
            "id": len(self.proposals),
            "proposer": proposer,
            "title": title,
            "description": description,
            "created_at": datetime.now(),
            "voting_end": datetime.now() + timedelta(days=voting_period_days),
            "yes_votes": 0,
            "no_votes": 0,
            "status": "active"
        }

        self.proposals.append(proposal)
        return f"Proposal #{proposal['id']} created successfully: {title}"

    def vote(self, voter, proposal_id, support):
        """Vote on proposal"""
        if proposal_id >= len(self.proposals):
            return "Proposal does not exist"

        proposal = self.proposals[proposal_id]

        # Check voting deadline
        if datetime.now() > proposal["voting_end"]:
            return "Voting has ended"

        # Calculate voting power (equal to token holdings)
        vote_power = self.holders[voter]

        if vote_power == 0:
            return "No voting rights (does not hold tokens)"

        # Record vote
        self.votes[proposal_id][voter] = vote_power if support else -vote_power

        # Update proposal tally
        if support:
            proposal["yes_votes"] += vote_power
        else:
            proposal["no_votes"] += vote_power

        return f"{voter} voted successfully, power: {vote_power}"

    def finalize_proposal(self, proposal_id):
        """Finalize proposal"""
        proposal = self.proposals[proposal_id]

        if datetime.now() < proposal["voting_end"]:
            return "Voting has not ended yet"

        if proposal["yes_votes"] > proposal["no_votes"]:
            proposal["status"] = "passed"
            result = "Passed"
        else:
            proposal["status"] = "rejected"
            result = "Rejected"

        return f"Proposal #{proposal_id} {result}, yes votes: {proposal['yes_votes']}, no votes: {proposal['no_votes']}"

# Uniswap UNI governance example
uniswap_dao = GovernanceToken("Uniswap", "UNI")

# Distribute governance tokens
uniswap_dao.distribute_tokens("Community Member A", 5000)
uniswap_dao.distribute_tokens("Community Member B", 3000)
uniswap_dao.distribute_tokens("Development Team", 10000)

# Create proposal
proposal_result = uniswap_dao.create_proposal(
    "Development Team",
    "Add new trading pair fee pool",
    "Propose to create a 0.01% fee pool for USDC/USDT trading pair"
)
print(proposal_result)

# Vote
print(uniswap_dao.vote("Community Member A", 0, True))   # Support
print(uniswap_dao.vote("Community Member B", 0, False))  # Oppose
print(uniswap_dao.vote("Development Team", 0, True))    # Support

# Finalize (simulate end of voting period)
uniswap_dao.proposals[0]["voting_end"] = datetime.now() - timedelta(days=1)
print(uniswap_dao.finalize_proposal(0))

Sources of Virtual Currency Value

1. Technical Value

The underlying technological innovation of virtual currencies provides fundamental value:

def calculate_network_value(active_users, transaction_volume, utility_score):
    """
    Simplified model for calculating network value
    Parameters:
    - active_users: Number of active users
    - transaction_volume: Transaction volume
    - utility_score: Utility rating (1-10)
    """
    # Metcalfe's Law: Network value is proportional to the square of users
    network_effect = active_users ** 1.5  # Simplified version

    # Transaction activity value
    transaction_value = transaction_volume * 0.01

    # Utility value
    utility_value = utility_score * 1000

    total_value = network_effect + transaction_value + utility_value

    return {
        "network_effect": network_effect,
        "transaction_value": transaction_value,
        "utility_value": utility_value,
        "total_estimated_value": total_value
    }

# Bitcoin network value assessment example
btc_value = calculate_network_value(
    active_users=50_000_000,      # 50 million active users
    transaction_volume=1_000_000,  # 1 million daily transactions
    utility_score=8               # Utility score of 8
)

print("Bitcoin Network Value Assessment:")
for key, value in btc_value.items():
    print(f"  {key}: {value:,.0f}")

2. Economic Value

Supply and Demand

Virtual currency prices are primarily determined by market supply and demand:

  • Supply Side: Issuance mechanism, inflation rate, burning mechanism
  • Demand Side: Investment demand, payment demand, speculative demand
  • Market Sentiment: News events, regulatory policies, technical progress

3. Network Effects

🔄 正在渲染 Mermaid 图表...

Risks and Challenges

Main Risk Factors

  1. Technical Risks

    • Code vulnerabilities
    • Network attacks
    • Scalability issues
  2. Market Risks

    • Severe price volatility
    • Insufficient liquidity
    • Market manipulation
  3. Regulatory Risks

    • Policy uncertainty
    • Changes in compliance requirements
    • Risk of usage prohibition
  4. Operational Risks

    • Lost private keys
    • Wallet security
    • Exchange risks
Investment Reminder

Virtual currency investment has high-risk characteristics with significant price volatility. Before investing, please:

  1. Fully understand the related risks
  2. Only invest funds you can afford to lose
  3. Conduct thorough research and preparation
  4. Consider seeking professional advice

Chapter Summary

Through this chapter, we have learned:

  1. Basic Definition of Virtual Currency: Digital, decentralized, cryptographically protected form of currency
  2. Development History: Evolution process from concept inception to mainstream acceptance
  3. Type Classification: Different categories including payment, platform, utility, and governance tokens
  4. Value Sources: Factors such as technological innovation, network effects, and market supply and demand
  5. Risk Awareness: Multi-dimensional risks including technical, market, regulatory, and operational aspects

These fundamental concepts lay an important foundation for further learning about blockchain technology and specific applications. In the next chapter, we will delve into the core technology supporting virtual currencies—blockchain technology principles.