SECTION 1: LEARNING OBJECTIVES
By the end of this lesson, you will be able to:
-
Define tokenisation and explain its significance.
-
Differentiate between different token types (fungible, non-fungible, utility, security).
-
Explain the tokenisation process and lifecycle.
-
Understand Real World Asset (RWA) tokenisation.
-
Describe token standards (ERC-20, ERC-721, ERC-1155, ERC-3643).
-
Identify use cases for tokenisation in finance.
-
Implement a tokenisation simulation in Python.
-
Develop a framework for asset tokenisation projects.
SECTION 2: WHAT IS TOKENISATION?
2.1 Definition
Tokenisation is the process of converting ownership rights or value of an asset into a digital token on a blockchain. Tokens represent a claim on the underlying asset and can be traded, transferred, or used in smart contracts.
2.2 The Tokenisation Process
┌─────────────────────────────────────────────────────────────────────────────┐ │ TOKENISATION PROCESS │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ STEP 1: ASSET IDENTIFICATION │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ Identify asset to tokenise (real estate, art, bonds, etc.) │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ v │ │ STEP 2: LEGAL & COMPLIANCE │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ • Structure legal ownership │ │ │ │ • Ensure regulatory compliance │ │ │ │ • Define rights and obligations │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ v │ │ STEP 3: TOKEN CREATION │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ • Choose token standard │ │ │ │ • Deploy smart contract │ │ │ │ • Mint tokens representing ownership │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ v │ │ STEP 4: DISTRIBUTION │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ • Issue tokens to investors │ │ │ │ • Enable secondary trading │ │ │ │ • Manage dividends/returns │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
SECTION 3: TOKEN TYPES
3.1 Classification
| Token Type | Description | Characteristics | Examples |
|---|---|---|---|
| Fungible Tokens | Interchangeable, divisible units | Equal value, tradable | ERC-20 (USDC, DAI, UNI) |
| Non-Fungible Tokens (NFTs) | Unique, indivisible units | Unique properties, collectible | ERC-721 (art, collectibles) |
| Security Tokens | Represent financial securities | Regulated, rights-based | ERC-1400, tokenised stocks |
| Utility Tokens | Access to services/products | Functional, not investment | ERC-20 (BAT, LINK) |
| Compliance Tokens | Regulated tokens with KYC/AML | Restricted transfer | ERC-3643 |
3.2 Token Standards Overview
| Standard | Type | Features | Use Case |
|---|---|---|---|
| ERC-20 | Fungible | Basic transfer, approval, supply | Currencies, utility tokens |
| ERC-721 | Non-Fungible | Unique ID, ownership, metadata | Art, collectibles |
| ERC-1155 | Semi-Fungible | Batch transfers, mixed types | Gaming, multi-token |
| ERC-1400 | Security | Partitioning, compliance | Security tokens |
| ERC-3643 | Compliance | Permissioned, identity | Regulated assets |
SECTION 4: REAL WORLD ASSET (RWA) TOKENISATION
4.1 What are RWAs?
Real World Assets are physical or traditional financial assets that are represented on-chain through tokenisation.
4.2 RWA Categories
| Category | Examples | Tokenisation Benefits |
|---|---|---|
| Real Estate | Commercial, residential properties | Fractional ownership, liquidity |
| Private Equity | Startup shares, venture capital | Access for retail investors |
| Commodities | Gold, silver, oil | Easy trading, storage |
| Bonds | Government, corporate bonds | Programmable yield, lower costs |
| Art & Collectibles | Paintings, antiques | Fractional ownership, provenance |
| Accounts Receivable | Invoices, future payments | Working capital, factoring |
4.3 RWA Tokenisation Benefits
┌─────────────────────────────────────────────────────────────────────────────┐ │ RWA TOKENISATION BENEFITS │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ LIQUIDITY │ │ │ │ Previously illiquid assets become tradable 24/7. │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ FRACTIONAL OWNERSHIP │ │ │ │ Small investors can access high-value assets. │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ TRANSPARENCY │ │ │ │ Immutable record of ownership and transactions. │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ LOWER COSTS │ │ │ │ Reduced intermediaries and administrative overhead. │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ PROGRAMMABILITY │ │ │ │ Smart contracts automate dividends, payments, rights. │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
SECTION 5: ASSET MANAGEMENT
5.1 Digital Asset Management
| Aspect | Traditional | Digital Asset Management |
|---|---|---|
| Custody | Banks, brokers | Wallets, custodians |
| Trading | Exchange hours | 24/7 |
| Settlement | T+2 days | Near-instant |
| Reporting | Periodic | Real-time |
| Access | Minimum investment | Fractional |
| Transparency | Limited | Full on-chain |
5.2 Portfolio Construction
┌─────────────────────────────────────────────────────────────────────────────┐ │ DIGITAL ASSET PORTFOLIO │ ├─────────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ CORE HOLDINGS (40-60%) │ │ │ │ • Bitcoin, Ethereum │ │ │ │ • Large-cap crypto │ │ │ │ • Stablecoins for stability │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ v │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ GROWTH / DEFI (20-30%) │ │ │ │ • Layer 1 / Layer 2 tokens │ │ │ │ • DeFi protocols (AAVE, UNI, etc.) │ │ │ │ • Yield farming positions │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ v │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ RWA & TOKENISED ASSETS (10-20%) │ │ │ │ • Tokenised real estate │ │ │ │ • Tokenised bonds │ │ │ │ • Commodity-backed tokens │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ │ v │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ ALTERNATIVE (5-10%) │ │ │ │ • NFTs (high-conviction) │ │ │ │ • Pre-sales / IDOs │ │ │ │ • Governance tokens │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────────────────┘
SECTION 6: IMPLEMENTATION IN PYTHON
# =================================================================== # MODULE 2, LESSON 6: TOKENISATION AND ASSET MANAGEMENT # =================================================================== import hashlib import time import json import random from typing import Dict, List, Optional, Tuple import pandas as pd import matplotlib.pyplot as plt import numpy as np import warnings warnings.filterwarnings('ignore') print("="*70) print("TOKENISATION AND ASSET MANAGEMENT") print("="*70) # ---------------------------------------------------------------- # PART A: TOKENISATION SIMULATION (ERC-20 Style) # ---------------------------------------------------------------- print("\n" + "-"*60) print("PART A: Tokenisation Simulation (ERC-20 Style)") print("-"*60) class TokenisedAsset: def __init__(self, name: str, symbol: str, total_supply: int, asset_type: str, asset_value: float): self.name = name self.symbol = symbol self.total_supply = total_supply self.asset_type = asset_type self.asset_value = asset_value # Total value of underlying asset self.balances: Dict[str, int] = {} self.allowances: Dict[Tuple[str, str], int] = {} self.owner = "contract_deployer" self.balances[self.owner] = total_supply self.token_price = asset_value / total_supply self.transactions = [] def get_token_price(self) -> float: return self.token_price def balance_of(self, address: str) -> int: return self.balances.get(address, 0) def transfer(self, sender: str, recipient: str, amount: int) -> bool: if self.balances.get(sender, 0) < amount: return False if amount <= 0: return False self.balances[sender] -= amount self.balances[recipient] = self.balances.get(recipient, 0) + amount self.transactions.append({ 'type': 'transfer', 'from': sender, 'to': recipient, 'amount': amount, 'timestamp': time.time() }) print(f"Transferred {amount} {self.symbol} from {sender[:8]}... to {recipient[:8]}...") return True def get_holdings(self, address: str) -> Dict: balance = self.balances.get(address, 0) return { 'address': address, 'balance': balance, 'value': balance * self.token_price, 'percentage': (balance / self.total_supply) * 100 if self.total_supply > 0 else 0 } def get_metrics(self) -> Dict: active_holders = sum(1 for b in self.balances.values() if b > 0) return { 'name': self.name, 'symbol': self.symbol, 'asset_type': self.asset_type, 'total_supply': self.total_supply, 'asset_value': self.asset_value, 'token_price': self.token_price, 'active_holders': active_holders, 'transactions': len(self.transactions) } # Create tokenised real estate asset property_value = 5000000 # $5M property token_units = 10000 # 10,000 tokens property_token = TokenisedAsset("Prime Real Estate", "PRE", token_units, "Real Estate", property_value) print("Tokenised Asset Created:") print(f" Asset: {property_token.name}") print(f" Type: {property_token.asset_type}") print(f" Total Value: ${property_token.asset_value:,.2f}") print(f" Token Price: ${property_token.token_price:.2f}") print(f" Total Supply: {property_token.total_supply} {property_token.symbol}") # Distribute tokens investors = ["Alice", "Bob", "Charlie", "David", "Eve"] allocations = [2000, 3000, 1500, 1000, 500] print("\n--- Token Distribution ---") for investor, allocation in zip(investors, allocations): # Transfer from owner to investor property_token.transfer(property_token.owner, investor, allocation) print("\n--- Holdings ---") holdings_df = pd.DataFrame([property_token.get_holdings(i) for i in investors + [property_token.owner]]) print(holdings_df.to_string(index=False)) # ---------------------------------------------------------------- # PART B: NFT SIMULATION (ERC-721 Style) # ---------------------------------------------------------------- print("\n" + "-"*60) print("PART B: NFT Simulation (Unique Asset Tokens)") print("-"*60) class NFTCollection: def __init__(self, name: str, symbol: str): self.name = name self.symbol = symbol self.tokens: Dict[int, Dict] = {} self.owners: Dict[int, str] = {} self.balances: Dict[str, List[int]] = {} self.next_id = 1 def mint(self, to: str, name: str, metadata: Dict) -> int: token_id = self.next_id self.next_id += 1 self.tokens[token_id] = { 'name': name, 'metadata': metadata, 'created_at': time.time() } self.owners[token_id] = to if to not in self.balances: self.balances[to] = [] self.balances[to].append(token_id) print(f"Minted NFT #{token_id} '{name}' for {to}") return token_id def transfer(self, from_addr: str, to_addr: str, token_id: int) -> bool: if token_id not in self.owners or self.owners[token_id] != from_addr: print("Not owner of this NFT") return False self.owners[token_id] = to_addr self.balances[from_addr].remove(token_id) if to_addr not in self.balances: self.balances[to_addr] = [] self.balances[to_addr].append(token_id) print(f"Transferred NFT #{token_id} from {from_addr} to {to_addr}") return True def get_metadata(self, token_id: int) -> Optional[Dict]: return self.tokens.get(token_id) def get_balance(self, address: str) -> int: return len(self.balances.get(address, [])) def get_holders(self) -> Dict: holders = {} for owner, tokens in self.balances.items(): holders[owner] = len(tokens) return holders # Create NFT collection art_collection = NFTCollection("Digital Art Collection", "DAC") # Mint NFTs art_collection.mint("Alice", "Sunset over Mountains", {"artist": "Jane", "year": 2024, "style": "Impressionist"}) art_collection.mint("Bob", "Urban Jungle", {"artist": "John", "year": 2024, "style": "Street Art"}) art_collection.mint("Alice", "Ocean Waves", {"artist": "Jane", "year": 2024, "style": "Abstract"}) art_collection.mint("Charlie", "Cosmic Dreams", {"artist": "Alice", "year": 2024, "style": "Digital"}) print("\n--- NFT Holdings ---") for address, count in art_collection.get_holders().items(): print(f"{address}: {count} NFTs") print("\n--- NFT Metadata ---") for token_id in range(1, art_collection.next_id): metadata = art_collection.get_metadata(token_id) if metadata: print(f"Token #{token_id}: {metadata['name']} by {metadata['metadata']['artist']}") # ---------------------------------------------------------------- # PART C: REAL WORLD ASSET TOKENISATION FRAMEWORK # ---------------------------------------------------------------- print("\n" + "-"*60) print("PART C: Real World Asset Tokenisation Framework") print("-"*60) rwa_framework = { "Asset Classes": { "Real Estate": { "Examples": ["Residential", "Commercial", "Land"], "Benefits": ["Fractional ownership", "Liquidity", "Global access"], "Challenges": ["Valuation", "Legal complexity", "Maintenance"] }, "Private Equity": { "Examples": ["Startup equity", "Venture capital", "Growth equity"], "Benefits": ["Access for retail", "Liquidity", "Transparency"], "Challenges": ["Regulation", "Valuation", "Information asymmetry"] }, "Commodities": { "Examples": ["Gold", "Oil", "Agricultural products"], "Benefits": ["Easy trading", "Storage efficiency", "Fractional"], "Challenges": ["Storage cost", "Quality verification"] }, "Bonds": { "Examples": ["Government bonds", "Corporate bonds", "Green bonds"], "Benefits": ["Programmable yield", "Lower costs", "Transparency"], "Challenges": ["Regulation", "Credit risk", "Maturity matching"] } } } for category, details in rwa_framework.items(): print(f"\n{category.upper()}:") print(f" Examples: {', '.join(details['Examples'])}") print(f" Benefits: {', '.join(details['Benefits'])}") print(f" Challenges: {', '.join(details['Challenges'])}") # ---------------------------------------------------------------- # PART D: ASSET MANAGEMENT PORTFOLIO SIMULATION # ---------------------------------------------------------------- print("\n" + "-"*60) print("PART D: Digital Asset Portfolio Simulation") print("-"*60) class Portfolio: def __init__(self, name: str): self.name = name self.holdings: Dict[str, float] = {} self.prices: Dict[str, float] = {} self.transactions = [] self.initial_value = 0 def add_asset(self, asset: str, amount: float, price: float): self.holdings[asset] = self.holdings.get(asset, 0) + amount self.prices[asset] = price self.transactions.append({ 'type': 'add', 'asset': asset, 'amount': amount, 'price': price, 'timestamp': time.time() }) print(f"Added {amount:.2f} {asset} at ${price:.2f}") def update_price(self, asset: str, price: float): self.prices[asset] = price def get_value(self) -> float: total = 0 for asset, amount in self.holdings.items(): total += amount * self.prices.get(asset, 0) return total def get_allocation(self) -> Dict: total = self.get_value() if total == 0: return {} return {asset: (amount * self.prices.get(asset, 0)) / total * 100 for asset, amount in self.holdings.items()} def get_metrics(self) -> Dict: return { 'name': self.name, 'total_value': self.get_value(), 'num_assets': len(self.holdings), 'allocation': self.get_allocation() } # Create portfolio portfolio = Portfolio("Digital Growth Portfolio") portfolio.add_asset("BTC", 1.5, 60000) portfolio.add_asset("ETH", 10, 3000) portfolio.add_asset("SOL", 50, 100) portfolio.add_asset("USDC", 10000, 1) print("\n--- Portfolio Value ---") print(f"Total Value: ${portfolio.get_value():,.2f}") allocation = portfolio.get_allocation() for asset, pct in allocation.items(): print(f" {asset}: {pct:.1f}%") # Visualise portfolio allocation fig, ax = plt.subplots(figsize=(8, 6)) assets = list(allocation.keys()) percentages = list(allocation.values()) ax.pie(percentages, labels=assets, autopct='%1.1f%%', startangle=90) ax.set_title('Portfolio Allocation') plt.tight_layout() plt.savefig('portfolio_allocation.png', dpi=300, bbox_inches='tight') plt.show() print("Portfolio allocation chart saved as 'portfolio_allocation.png'") # ---------------------------------------------------------------- # PART E: TOKENISATION USE CASES IN FINANCE # ---------------------------------------------------------------- print("\n" + "-"*60) print("PART E: Tokenisation Use Cases in Finance") print("-"*60) use_cases = { "Real Estate Tokenisation": { "Description": "Fractional ownership of commercial and residential properties.", "Benefits": ["Liquidity", "Access to global investors", "Reduced transaction costs"], "Examples": ["RealT", "Propy", "SolidBlock"] }, "Private Equity Tokenisation": { "Description": "Tokenisation of startup shares and private company equity.", "Benefits": ["Early liquidity", "Retail access", "Transparent cap tables"], "Examples": ["tZERO", "Securitize", "Harbor"] }, "Commodity Tokenisation": { "Description": "Tokenised ownership of gold, silver, and other commodities.", "Benefits": ["Efficient trading", "Fractional ownership", "Storage avoidance"], "Examples": ["PAX Gold", "Tether Gold", "GoldCoin"] }, "Debt Tokenisation": { "Description": "Tokenised bonds, loans, and debt instruments.", "Benefits": ["Programmable yield", "Secondary market", "Lower issuance costs"], "Examples": ["BondIT", "Algorand Bonds"] }, "Art & Collectibles": { "Description": "Fractional ownership of high-value art and collectibles.", "Benefits": ["Access to high-value assets", "Liquidity", "Provenance"], "Examples": ["Masterworks", "Dropp", "Fractional Art"] } } for use_case, details in use_cases.items(): print(f"\n{use_case.upper()}:") print(f" Description: {details['Description']}") print(f" Benefits: {', '.join(details['Benefits'])}") print(f" Examples: {', '.join(details['Examples'])}") # ---------------------------------------------------------------- # PART F: TOKENISATION LIFECYCLE # ---------------------------------------------------------------- print("\n" + "-"*60) print("PART F: Tokenisation Lifecycle Management") print("-"*60) lifecycle = { "Phase 1: Asset Assessment": { "Activities": [ "Identify asset for tokenisation", "Determine asset value and structure", "Assess legal and regulatory requirements", "Define token economics" ], "Duration": "1-3 months" }, "Phase 2: Legal & Compliance": { "Activities": [ "Legal documentation", "Regulatory filings", "Compliance framework", "Investor accreditation" ], "Duration": "2-4 months" }, "Phase 3: Technical Development": { "Activities": [ "Smart contract development", "Token standard selection", "Audit and testing", "Platform integration" ], "Duration": "2-3 months" }, "Phase 4: Token Offering": { "Activities": [ "Marketing and distribution", "Token sale / STO", "Investor onboarding", "Token distribution" ], "Duration": "1-2 months" }, "Phase 5: Post-Launch": { "Activities": [ "Secondary market trading", "Investor communication", "Dividend / yield distribution", "Compliance monitoring" ], "Duration": "Ongoing" } } for phase, details in lifecycle.items(): print(f"\n{phase.upper()}:") print(f" Duration: {details['Duration']}") print(" Activities:") for activity in details['Activities']: print(f" • {activity}") # ---------------------------------------------------------------- # PART G: SUMMARY AND RECOMMENDATIONS # ---------------------------------------------------------------- print("\n" + "="*70) print("PART G: Summary and Recommendations") print("="*70) print(""" Tokenisation and Asset Management – Key Takeaways: 1. Tokenisation converts asset ownership into digital tokens on blockchain. 2. Token types: fungible, non-fungible, security, utility, compliance. 3. Standards: ERC-20 (fungible), ERC-721 (NFT), ERC-1155 (multi-token), ERC-3643 (compliance). 4. RWA tokenisation brings real estate, private equity, commodities, bonds on-chain. 5. Benefits: liquidity, fractional ownership, transparency, lower costs, programmability. 6. Tokenisation lifecycle: Assessment → Legal → Development → Offering → Post-launch. 7. Portfolio management: core holdings, growth/DeFi, RWAs, alternatives. Recommendations: - Ensure legal and regulatory compliance before tokenisation. - Choose appropriate token standard for the asset type. - Conduct thorough smart contract audits. - Consider investor rights and governance. - Build secondary market liquidity. - Monitor regulatory developments in tokenised assets. - Diversify across asset types and risk profiles. """)