Technical Reference

Blockchain in Payments

Working principles, network types, consensus mechanisms, DeFi protocols, stablecoins, and CBDCs — a technical guide to blockchain technology and its integration with modern payment infrastructure.

3–5 sXRPL / Stellar finality
$150B+stablecoin supply
130+CBDC projects globally
1M TPSLightning theoretical max

Decentralised Finance (DeFi)

DeFi is the set of financial protocols built on smart contracts that replicate — and sometimes improve upon — traditional financial services without trusted intermediaries. No accounts, no credit checks, no business hours. Code executes identically for every participant.

$90B+Total Value Locked (peak)
$4T+DEX volume (2023)
8+%Typical USDC lending APY
ERC-4337Key UX enabler

DeFi Protocol Categories

🔄

Decentralised Exchange (DEX) / AMM

Swap tokens without an order book. An Automated Market Maker pools liquidity in a smart contract; price is set algorithmically (x · y = k for Uniswap v2). Anyone can provide liquidity and earn trading fees. Enables instant stablecoin-to-stablecoin or cross-chain FX swaps.

How it works: Liquidity providers deposit token pairs (e.g., ETH/USDC). Traders interact with the pool contract; the AMM formula adjusts the price with each trade. Providers earn a % of fees proportional to their share.
Uniswap · Curve Finance · PancakeSwap · dYdX · Raydium (Solana)
🏦

Lending & Borrowing Protocol

Supply assets to earn variable interest or borrow against collateral — no bank account or credit score required. Over-collateralised loans protect lenders: borrow $70 of USDC by locking $100 of ETH. Undercollateralised flash loans allow arbitrage within a single transaction block.

How it works: Suppliers deposit into a pool and receive yield-bearing tokens (aTokens, cTokens). Borrowers provide collateral and draw a loan up to the LTV limit. Interest rates adjust algorithmically based on pool utilisation.
Aave V3 · Compound · MakerDAO (DAI) · Euler · Morpho
💵

Stablecoin Protocols

Issue or mint stablecoins pegged to fiat currencies. Three models: Fiat-backed (USDC, USDT — centralised issuer holds reserves), Crypto-backed (DAI — over-collateralised by ETH/RWA via MakerDAO), and Algorithmic (use supply/demand mechanics — historically risky, e.g. UST collapse 2022).

How it works (DAI): User deposits ETH into a Maker Vault, mints DAI up to 66% LTV. If ETH price drops below liquidation threshold (e.g., 150% collateral ratio), the vault is liquidated automatically — no human intervention needed.
USDC (Circle) · USDT (Tether) · DAI / USDS (MakerDAO) · FRAX · PayPal USD (PYUSD)
📈

Yield Aggregators

Automatically move funds across lending and AMM protocols to maximise yield. Users deposit once; the vault strategy rebalances continuously, compounding returns. ERC-4626 (Vault Standard) enables composable yield strategies.

How it works: The vault contract holds user funds and executes a pre-defined strategy (e.g., supply USDC to Aave, collect yield, swap reward tokens to USDC, reinvest). Vaults socialise gas costs across all depositors.
Yearn Finance · Convex · Beefy Finance · Pendle · Ondo Finance (RWA)
🌉

Cross-Chain Bridges & Messaging

Move assets and messages between different blockchains. Lock-and-mint bridges lock the asset on the source chain and issue a wrapped representation on the destination. Message-passing protocols (CCIP, IBC, LayerZero) enable smart contract calls across chains.

How it works: User calls the bridge contract on Chain A, locks token. Bridge relayers (or light clients) verify the event on Chain A. Destination contract mints the wrapped token on Chain B. Security depends entirely on the bridge's trust model.
Chainlink CCIP · Stargate (LayerZero) · Cosmos IBC · Wormhole · Circle CCTP (native USDC bridge)
🔮

Oracles

Smart contracts cannot access external data by themselves — they are deterministic. Oracles are trusted data bridges providing on-chain price feeds, event attestations, randomness, and payment confirmations. Critical for DeFi: a wrong oracle price enables mass liquidations.

How it works: A network of independent oracle nodes each fetch the price from multiple sources, aggregate, and sign it. The aggregated answer is written on-chain by the oracle contract at a configurable heartbeat. DeFi protocols read this value when executing trades or liquidations.
Chainlink · Pyth Network · Band Protocol · UMA · API3

DeFi Risk Taxonomy

🐛Smart Contract Risk

Bugs in protocol code are permanent and can be exploited immediately. Audits and formal verification reduce but do not eliminate risk. Bug bounties (Immunefi) incentivise responsible disclosure.

🔮Oracle Manipulation

A manipulated price feed can trigger incorrect liquidations or enable flash loan attacks. Flash loan + price manipulation was the attack vector in many large DeFi exploits (Mango Markets $114M).

💧Liquidity Risk

AMM pools can be thin for less-traded pairs. In a market crash, deep pools drain quickly — leading to slippage, failed liquidations, and cascading under-collateralisation.

🌉Bridge Risk

Cross-chain bridges hold enormous TVL in a single smart contract. Ronin Bridge ($625M), Wormhole ($320M), Nomad ($190M) were exploited via code bugs or compromised validator keys.

🗳️Governance Risk

Token-based governance is susceptible to vote buying and majority takeovers. A flash loan can temporarily grant majority voting power to an attacker (Beanstalk $182M governance attack).

📋Regulatory Risk

DeFi protocols serving US or EU users may be subject to MiCA, securities regulations, or OFAC sanctions. Tornado Cash sanctions (2022) demonstrated that smart contract addresses can be sanctioned by OFAC.

DeFi Primitives in Payment Applications

💸
Programmable Escrow

Smart contract locks payment; oracle or multi-sig attestation releases it on delivery confirmation. Eliminates escrow agent fees and dispute timelines. Used in trade finance, freelancer marketplaces, and real estate.

🌊
Streaming Payments

Superfluid and Sablier stream USDC or other ERC-20 tokens per-second. Salary paid every second instead of monthly. Content subscriptions billed per-minute of consumption. Enabled by ERC-4337 for gasless user experience.

🔄
On-Chain FX (AMM)

Curve Finance's stableswap invariant enables near-zero-slippage swaps between stablecoins (USDC ↔ USDT ↔ DAI). Payment gateways use AMMs to convert between currencies in the settlement path without a bank FX desk.

🏛️
CBDC + DeFi Composability

Tokenised central bank money issued on a permissioned layer can interact with DeFi protocols via bridges and wrappers. Project Mariana (BIS/SNB/BdF/MAS) tested wCBDC swaps using AMM protocols — combining BFT-secured issuance with open DeFi liquidity.

📑
Real-World Asset (RWA) Tokenisation

Treasury bills, money market funds, and corporate bonds are tokenised on-chain (Ondo USDY, BlackRock BUIDL). Corporate treasuries earn on-chain yield on idle stablecoin balances. Tokenised T-bills settle in minutes vs. T+1 traditional clearing.

🔐
Account Abstraction (ERC-4337)

Smart contract wallets replace EOAs (private key accounts). Enable: gasless transactions (paymaster covers gas), social recovery (replace lost key via guardians), batch payments (approve + transfer in one tx), session keys for subscriptions. Critical for mainstream payment UX.