SECTION 1: LEARNING OBJECTIVES

By the end of this lesson, you will be able to:

  • Define CBDCs and differentiate them from cryptocurrencies.

  • Explain the motivations for central banks to issue CBDCs.

  • Compare different CBDC design models (retail vs wholesale).

  • Understand the key design choices in CBDC implementation.

  • Analyse global CBDC pilot programs and progress.

  • Identify the implications of CBDCs for the financial system.

  • Implement a simplified CBDC simulation in Python.

  • Develop a framework for CBDC adoption in a digital economy.


SECTION 2: WHAT IS A CBDC?

2.1 Definition

Central Bank Digital Currency (CBDC) is a digital form of fiat money issued by a central bank. It is a legal tender, denominated in the national currency, and represents a direct claim on the central bank.

2.2 CBDC vs Cryptocurrencies vs Stablecoins

 
 
Feature CBDC Cryptocurrency Stablecoin
Issuer Central bank Decentralised Private entity
Backing Full faith of government Market speculation Reserve assets
Legal Status Legal tender Varies Varies
Volatility Low (stable) High Low (pegged)
Privacy Variable High Variable
Control Centralised Decentralised Centralised

SECTION 3: MOTIVATIONS FOR CBDCs

text
┌─────────────────────────────────────────────────────────────────────────────┐
│                    MOTIVATIONS FOR CBDC ISSUANCE                            │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    FINANCIAL INCLUSION                               │   │
│  │  Provide digital payments access to unbanked populations.            │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    PAYMENT EFFICIENCY                                 │   │
│  │  Faster, cheaper, and more efficient payment systems.                │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    MONETARY POLICY TOOL                               │   │
│  │  Direct transmission of monetary policy (e.g., programmable money).  │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    COUNTERING PRIVATE STABLECOINS                    │   │
│  │  Maintain monetary sovereignty in the digital age.                  │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    DIGITAL ECONOMY ENABLER                           │   │
│  │  Enable programmability and smart contract integration.             │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
│  ┌──────────────────────────────────────────────────────────────────────┐   │
│  │                    CROSS-BORDER PAYMENTS                             │   │
│  │  Reduce cost and complexity of international transfers.             │   │
│  └──────────────────────────────────────────────────────────────────────┘   │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

SECTION 4: CBDC DESIGN MODELS

4.1 Retail vs Wholesale CBDC

 
 
Feature Retail CBDC Wholesale CBDC
Users General public, businesses Financial institutions
Purpose Everyday payments, inclusion Interbank settlement, securities
Access Direct to consumers Limited to banks
Privacy Lower (regulatory requirements) Higher (institutional)
Complexity High (scalability, privacy, distribution) Lower
Examples e-CNY (China), Sand Dollar (Bahamas) Project Jura (Switzerland), Project Helvetia

4.2 Architecture Models

text
┌─────────────────────────────────────────────────────────────────────────────┐
│                    CBDC ARCHITECTURE MODELS                                 │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  1. DIRECT CBDC (Central Bank Operates Everything)                         │
│     ┌──────────────────────────────────────────────────────────────────┐    │
│     │ Central Bank                                                   │    │
│     │  • Issues CBDC                                                  │    │
│     │  • Manages accounts                                           │    │
│     │  • Processes transactions                                      │    │
│     │  • Highest control, highest responsibility                    │    │
│     └──────────────────────────────────────────────────────────────────┘    │
│                                                                             │
│  2. HYBRID CBDC (Central Bank + Private Sector)                           │
│     ┌──────────────────────────────────────────────────────────────────┐    │
│     │ Central Bank            │    Private Intermediaries            │    │
│     │  • Issues CBDC          │    • KYC/AML                        │    │
│     │  • Settlement            │    • Distribution                   │    │
│     │  • Oversight            │    • User onboarding                │    │
│     └──────────────────────────────────────────────────────────────────┘    │
│                                                                             │
│  3. INTERMEDIATED CBDC (Two-tier System)                                  │
│     ┌──────────────────────────────────────────────────────────────────┐    │
│     │ Central Bank            │    Commercial Banks                  │    │
│     │  • Issues CBDC          │    • Hold accounts                  │    │
│     │  • Wholesale layer      │    • Retail distribution            │    │
│     │                         │    • Lending/credit                 │    │
│     └──────────────────────────────────────────────────────────────────┘    │
│                                                                             │
└─────────────────────────────────────────────────────────────────────────────┘

SECTION 5: GLOBAL CBDC PROGRESS

5.1 CBDC Development Status

 
 
Status Countries Examples
Launched 3+ Bahamas (Sand Dollar), Jamaica (JAM-DEX), Nigeria (e-Naira)
Pilot Phase 30+ China (e-CNY), India (e-Rupee), Brazil (Drex)
Research Phase 100+ US (Project Hamilton), UK, Australia
Considering Many Most developing and developed nations

5.2 Major CBDC Projects

 
 
Project Country Type Progress Key Features
e-CNY China Retail Widespread pilots Smart contract, wallet-based
Digital Euro EU Retail Research phase Privacy-focused, offline payments
e-Rupee India Retail Pilot Two-tier, bank distribution
Project Hamilton US Research Completed High performance, privacy
Project Helvetia Switzerland Wholesale Completed DLT integration
Sand Dollar Bahamas Retail Live Financial inclusion focus

SECTION 6: IMPLEMENTATION IN PYTHON

python
# ===================================================================
# MODULE 2, LESSON 2: CENTRAL BANK DIGITAL CURRENCIES (CBDCs)
# ===================================================================

import hashlib
import time
import json
import random
from typing import Dict, List, Optional
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import warnings
warnings.filterwarnings('ignore')

print("="*70)
print("CENTRAL BANK DIGITAL CURRENCIES (CBDCs)")
print("="*70)

# ----------------------------------------------------------------
# PART A: CBDC SYSTEM SIMULATION
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART A: CBDC System Simulation")
print("-"*60)

class CBDCWallet:
    def __init__(self, wallet_id: str, owner: str, institution: str = "Central Bank"):
        self.wallet_id = wallet_id
        self.owner = owner
        self.institution = institution
        self.balance = 0
        self.transaction_history = []
        self.created_at = time.time()
        self.is_locked = False
    
    def get_balance(self) -> float:
        return self.balance
    
    def deposit(self, amount: float, source: str) -> bool:
        if amount <= 0:
            return False
        self.balance += amount
        self.transaction_history.append({
            'type': 'deposit',
            'amount': amount,
            'source': source,
            'timestamp': time.time()
        })
        return True
    
    def transfer(self, amount: float, recipient, reason: str = "") -> bool:
        if self.is_locked:
            print(f"Wallet {self.wallet_id} is locked.")
            return False
        if self.balance < amount:
            print(f"Insufficient balance in wallet {self.wallet_id}")
            return False
        if amount <= 0:
            return False
        
        self.balance -= amount
        self.transaction_history.append({
            'type': 'transfer_out',
            'amount': amount,
            'recipient': recipient.wallet_id,
            'reason': reason,
            'timestamp': time.time()
        })
        recipient.receive(amount, self.wallet_id, reason)
        return True
    
    def receive(self, amount: float, sender_id: str, reason: str = "") -> bool:
        self.balance += amount
        self.transaction_history.append({
            'type': 'transfer_in',
            'amount': amount,
            'sender': sender_id,
            'reason': reason,
            'timestamp': time.time()
        })
        return True
    
    def lock(self) -> None:
        self.is_locked = True
    
    def unlock(self) -> None:
        self.is_locked = False
    
    def get_transactions(self, limit: int = 10) -> List[Dict]:
        return self.transaction_history[-limit:]
    
    def __repr__(self):
        return f"CBDCWallet({self.wallet_id}, balance={self.balance:.2f})"

class CentralBank:
    def __init__(self, name: str):
        self.name = name
        self.wallets: Dict[str, CBDCWallet] = {}
        self.total_supply = 0
        self.policy_rate = 2.0  # Interest rate
        self.transactions = []
        self.cbdc_symbol = "eCNY"  # Default
    
    def create_wallet(self, wallet_id: str, owner: str, institution: str = "Central Bank") -> CBDCWallet:
        wallet = CBDCWallet(wallet_id, owner, institution)
        self.wallets[wallet_id] = wallet
        print(f"Created wallet {wallet_id} for {owner}")
        return wallet
    
    def issue_cbdc(self, wallet_id: str, amount: float) -> bool:
        if wallet_id not in self.wallets:
            print(f"Wallet {wallet_id} not found.")
            return False
        wallet = self.wallets[wallet_id]
        wallet.deposit(amount, self.name)
        self.total_supply += amount
        print(f"Issued {amount} {self.cbdc_symbol} to {wallet_id}")
        return True
    
    def set_policy_rate(self, rate: float) -> None:
        self.policy_rate = rate
        print(f"Policy rate set to {rate}%")
    
    def apply_policy_rate(self, wallet_id: str, days: int = 30) -> float:
        """Apply interest to wallet based on policy rate."""
        if wallet_id not in self.wallets:
            return 0
        wallet = self.wallets[wallet_id]
        # Annual rate compounded daily (simplified)
        daily_rate = (1 + self.policy_rate/100) ** (1/365) - 1
        interest = wallet.balance * daily_rate * days
        wallet.deposit(interest, "Interest Payment")
        return interest
    
    def get_supply_metrics(self) -> Dict:
        total_balance = sum(w.balance for w in self.wallets.values())
        return {
            'total_supply': self.total_supply,
            'circulating_supply': total_balance,
            'num_wallets': len(self.wallets),
            'policy_rate': self.policy_rate
        }

# Create central bank and CBDC system
central_bank = CentralBank("National Digital Bank")
central_bank.cbdc_symbol = "eDollar"

# Create wallets
alice = central_bank.create_wallet("W001", "Alice", "Commercial Bank A")
bob = central_bank.create_wallet("W002", "Bob", "Commercial Bank B")
charlie = central_bank.create_wallet("W003", "Charlie", "Commercial Bank A")
treasury = central_bank.create_wallet("W000", "Government Treasury")

# Issue CBDC
central_bank.issue_cbdc("W000", 1000000)  # Initial issuance to treasury
central_bank.issue_cbdc("W001", 10000)    # To Alice
central_bank.issue_cbdc("W002", 5000)     # To Bob

# Transactions
print("\n--- Transactions ---")
alice.transfer(500, bob, "Payment for services")
bob.transfer(200, charlie, "Reimbursement")
alice.transfer(1000, treasury, "Tax payment")

# Apply policy rate
central_bank.set_policy_rate(3.0)
interest = central_bank.apply_policy_rate("W001", 30)
print(f"Alice received {interest:.2f} interest on balance")

# Show balances
print("\n--- Final Balances ---")
for wallet_id, wallet in central_bank.wallets.items():
    print(f"{wallet.owner} ({wallet_id}): {wallet.balance:.2f} {central_bank.cbdc_symbol}")

print(f"\nTotal Supply: {central_bank.total_supply} {central_bank.cbdc_symbol}")
print(f"Policy Rate: {central_bank.policy_rate}%")

# ----------------------------------------------------------------
# PART B: CBDC DESIGN CHOICES COMPARISON
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART B: CBDC Design Choices Comparison")
print("-"*60)

design_choices = pd.DataFrame({
    'Feature': [
        'Privacy Level',
        'Interoperability',
        'Offline Capability',
        'Programmability',
        'Interest Bearing',
        'Access Model',
        'Technology Base'
    ],
    'Direct Model': [
        'Limited',
        'Native',
        'Possible',
        'Full',
        'Yes',
        'Direct (CB)',
        'DLT or traditional'
    ],
    'Hybrid Model': [
        'Moderate',
        'APIs/Standards',
        'Possible',
        'Full',
        'Yes',
        'Through intermediaries',
        'DLT/Blockchain'
    ],
    'Intermediated Model': [
        'Higher (institutional)',
        'Intermediated',
        'Limited',
        'Limited',
        'Yes (by banks)',
        'Through banks',
        'Traditional + DLT'
    ]
})

print(design_choices.to_string(index=False))

# ----------------------------------------------------------------
# PART C: GLOBAL CBDC PROGRESS DASHBOARD
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART C: Global CBDC Progress Dashboard")
print("-"*60)

cbdc_progress = pd.DataFrame({
    'Country/Region': [
        'China (e-CNY)',
        'EU (Digital Euro)',
        'India (e-Rupee)',
        'US (Project Hamilton)',
        'UK (Britcoin)',
        'Nigeria (e-Naira)',
        'Bahamas (Sand Dollar)',
        'Brazil (Drex)'
    ],
    'Type': [
        'Retail',
        'Retail',
        'Retail',
        'Research',
        'Research',
        'Retail',
        'Retail',
        'Wholesale/Retail'
    ],
    'Status': [
        'Pilot (200M+ users)',
        'Research/Pilot',
        'Pilot (limited)',
        'Research',
        'Research',
        'Live (limited)',
        'Live',
        'Pilot'
    ],
    'Technology': [
        'Blockchain (permissioned)',
        'Researching',
        'Blockchain',
        'DLT',
        'Researching',
        'Blockchain',
        'Blockchain',
        'DLT'
    ]
})

print(cbdc_progress.to_string(index=False))

# Visualise CBDC adoption
fig, ax = plt.subplots(figsize=(10, 5))
status_order = ['Live', 'Pilot', 'Research']
colors = {'Live': 'green', 'Pilot': 'orange', 'Research': 'blue'}
statuses = cbdc_progress['Status'].apply(lambda x: 'Live' if 'Live' in x else ('Pilot' if 'Pilot' in x else 'Research'))
counts = statuses.value_counts()

ax.bar(counts.index, counts.values, color=[colors[s] for s in counts.index])
ax.set_ylabel('Number of Countries/Projects')
ax.set_title('CBDC Development Status (Selected Projects)')
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('cbdc_progress.png', dpi=300, bbox_inches='tight')
plt.show()
print("CBDC progress chart saved as 'cbdc_progress.png'")

# ----------------------------------------------------------------
# PART D: CBDC IMPACT ANALYSIS
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART D: CBDC Impact Analysis")
print("-"*60)

impact_analysis = {
    "Financial Inclusion": {
        "Impact": "Positive",
        "Description": "Provides digital payments access to unbanked.",
        "Risk": "Digital divide may exclude some populations."
    },
    "Monetary Policy": {
        "Impact": "Enhanced transmission",
        "Description": "Direct policy transmission with programmable money.",
        "Risk": "Potential disintermediation of banks."
    },
    "Payment Efficiency": {
        "Impact": "Positive",
        "Description": "Faster, cheaper, 24/7 payments.",
        "Risk": "Technical complexity and implementation costs."
    },
    "Financial Stability": {
        "Impact": "Mixed",
        "Description": "Could reduce bank runs risk if well-designed.",
        "Risk": "Potential for rapid bank disintermediation."
    },
    "Privacy": {
        "Impact": "Concern",
        "Description": "Balance between privacy and regulatory needs.",
        "Risk": "Potential for surveillance concerns."
    },
    "Cross-Border": {
        "Impact": "Positive",
        "Description": "Simplified international payments.",
        "Risk": "Complexity in interoperability standards."
    }
}

for area, details in impact_analysis.items():
    print(f"\n{area.upper()}:")
    print(f"  Impact: {details['Impact']}")
    print(f"  Description: {details['Description']}")
    print(f"  Risk: {details['Risk']}")

# ----------------------------------------------------------------
# PART E: CBDC IMPLEMENTATION ROADMAP
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART E: CBDC Implementation Roadmap")
print("-"*60)

roadmap = {
    "Phase 1 (0-12 months) – Research & Design": {
        "Focus": "Foundation building.",
        "Activities": [
            "Conduct feasibility studies",
            "Engage stakeholders",
            "Design architecture",
            "Assess technology options"
        ],
        "Deliverables": ["CBDC white paper", "Design document", "Stakeholder engagement plan"]
    },
    "Phase 2 (12-24 months) – Prototype & Pilot": {
        "Focus": "Build and test.",
        "Activities": [
            "Develop technical prototype",
            "Run limited pilot",
            "Test scalability and privacy",
            "Gather feedback"
        ],
        "Deliverables": ["Functional prototype", "Pilot results", "Feedback report"]
    },
    "Phase 3 (24-36 months) – Live Deployment": {
        "Focus": "Scale and launch.",
        "Activities": [
            "Deploy production system",
            "Onboard intermediaries",
            "Launch public rollout",
            "Monitor and adjust"
        ],
        "Deliverables": ["Live CBDC system", "User adoption metrics", "Operational playbook"]
    },
    "Phase 4 (36+ months) – Enhancement": {
        "Focus": "Evolve and expand.",
        "Activities": [
            "Add advanced features (programmability)",
            "Integrate with cross-border",
            "Enhance privacy solutions",
            "International collaboration"
        ],
        "Deliverables": ["Enhanced CBDC capabilities", "Cross-border integration", "International standards"]
    }
}

for phase, details in roadmap.items():
    print(f"\n{phase.upper()}:")
    print(f"  Focus: {details['Focus']}")
    print("  Activities:")
    for activity in details['Activities']:
        print(f"    • {activity}")
    print("  Deliverables:")
    for deliverable in details['Deliverables']:
        print(f"    • {deliverable}")

# ----------------------------------------------------------------
# PART F: CBDC VS CRYPTO VS STABLECOIN COMPARISON
# ----------------------------------------------------------------

print("\n" + "-"*60)
print("PART F: CBDC vs Cryptocurrency vs Stablecoin Comparison")
print("-"*60)

comparison = pd.DataFrame({
    'Feature': [
        'Issuer',
        'Backing',
        'Legal Status',
        'Volatility',
        'Privacy',
        'Settlement Finality',
        'Programmability',
        'Cross-border Speed',
        'Regulatory Status'
    ],
    'CBDC': [
        'Central Bank',
        'Government full faith',
        'Legal tender',
        'Stable',
        'Variable (controlled)',
        'Final (centralised)',
        'Limited/Controlled',
        'Fast (potential)',
        'Fully regulated'
    ],
    'Cryptocurrency': [
        'Decentralised',
        'Market/Consensus',
        'Varies (not legal tender)',
        'High',
        'High (pseudonymous)',
        'Probabilistic',
        'Full',
        'Fast',
        'Evolving'
    ],
    'Stablecoin': [
        'Private entity',
        'Reserve assets',
        'Varies',
        'Stable (pegged)',
        'Variable',
        'Varies',
        'Limited',
        'Fast',
        'Increasingly regulated'
    ]
})

print(comparison.to_string(index=False))

# ----------------------------------------------------------------
# PART G: SUMMARY AND RECOMMENDATIONS
# ----------------------------------------------------------------

print("\n" + "="*70)
print("PART G: Summary and Recommendations")
print("="*70)

print("""
Central Bank Digital Currencies (CBDCs) – Key Takeaways:

1. CBDCs are digital fiat currencies issued by central banks.
2. Types: Retail (public) and Wholesale (institutional).
3. Motivations: financial inclusion, payment efficiency, monetary policy, countering stablecoins.
4. Design models: Direct, Hybrid, Intermediated (two-tier).
5. Global progress: launched in Bahamas, Nigeria, Jamaica; pilots in China, India, EU.
6. Impacts: positive for inclusion and efficiency; mixed for financial stability; privacy concerns.
7. Implementation roadmap: Research → Pilot → Launch → Enhancement.

Recommendations:
  - Understand the CBDC landscape and design choices.
  - Prepare for CBDC integration in existing financial systems.
  - Consider privacy and inclusion in CBDC design.
  - Monitor international developments and standards.
  - Engage with regulatory and industry stakeholders.
  - Explore CBDC use cases in your domain.
""")