Split View: 블록체인 & Web3 완전 이해 — 비트코인, 이더리움, DeFi, NFT의 원리와 미래
블록체인 & Web3 완전 이해 — 비트코인, 이더리움, DeFi, NFT의 원리와 미래
목차
- 블록체인 기초
- 비트코인
- 이더리움과 스마트 컨트랙트
- Layer 2 스케일링
- DeFi — 탈중앙 금융
- NFT — 디지털 소유권
- DAO — 탈중앙 자율 조직
- Web3 비전 vs 현실
- 2026 블록체인 트렌드
- 개발자를 위한 블록체인
1. 블록체인 기초
1.1 블록체인이란?
블록체인은 트랜잭션 기록을 블록 단위로 묶어 체인처럼 연결한 분산 원장(Distributed Ledger) 기술입니다. 특정 중앙 기관 없이 네트워크 참여자 전원이 동일한 장부를 공유하며, 한번 기록된 데이터는 사실상 변경이 불가능합니다.
핵심 특성:
| 특성 | 설명 |
|---|---|
| 탈중앙화 | 단일 서버가 아닌 수천 개 노드에 데이터 분산 |
| 불변성 | 블록이 확정되면 과거 기록 변경 불가 |
| 투명성 | 모든 트랜잭션이 공개적으로 검증 가능 |
| 합의 기반 | 참여자 다수의 동의를 통해 상태 전이 결정 |
1.2 블록의 구조
하나의 블록은 크게 **헤더(Header)**와 **바디(Body)**로 나뉩니다.
+------------------------------+
| Block Header |
| - 이전 블록 해시 |
| - 타임스탬프 |
| - 난스(Nonce) |
| - 머클 루트(Merkle Root) |
+------------------------------+
| Block Body |
| - 트랜잭션 1 |
| - 트랜잭션 2 |
| - ... |
+------------------------------+
이전 블록의 해시를 현재 블록 헤더에 포함시키는 구조이기 때문에, 과거 블록 하나를 수정하려면 그 이후 모든 블록을 다시 계산해야 합니다. 이것이 블록체인의 불변성을 보장하는 원리입니다.
1.3 해시 함수와 머클 트리
블록체인에서 가장 핵심적인 암호학 도구는 해시 함수입니다. SHA-256을 예로 들면, 어떤 길이의 입력이든 고정 길이(256비트)의 출력을 생성하며, 입력의 아주 작은 변화도 완전히 다른 해시값을 만들어냅니다.
import hashlib
data = "Hello, Blockchain!"
hash_value = hashlib.sha256(data.encode()).hexdigest()
print(hash_value)
# 출력: 고정 길이 64자리 16진수 문자열
**머클 트리(Merkle Tree)**는 트랜잭션들의 해시를 쌍(pair)으로 묶어 반복적으로 해시하면서 하나의 루트 해시를 만드는 트리 구조입니다. 이를 통해 특정 트랜잭션이 블록에 포함되었는지를 전체 데이터를 다운로드하지 않고도 효율적으로 검증할 수 있습니다.
1.4 합의 알고리즘
분산 네트워크에서 "다음 블록에 무엇을 기록할 것인가"를 결정하는 방식이 합의 알고리즘입니다.
Proof of Work (PoW)
채굴자(miner)가 특정 조건을 만족하는 난스 값을 찾기 위해 해시 연산을 반복합니다. 엄청난 계산 자원이 필요하기 때문에, 악의적 공격자가 네트워크를 조작하려면 전체 연산 능력의 51% 이상을 확보해야 합니다.
목표: 해시값 앞자리가 0000으로 시작하는 난스 찾기
nonce=0 -> hash: a3f2b1c9... (조건 불충족)
nonce=1 -> hash: 8d1e7f4a... (조건 불충족)
...
nonce=N -> hash: 0000ab3f... (조건 충족! 블록 생성!)
장점은 검증된 보안성이지만, 단점은 막대한 전력 소모입니다.
Proof of Stake (PoS)
검증자(validator)가 일정량의 토큰을 스테이킹(예치)하고, 지분에 비례하여 블록 생성 권한을 얻습니다. PoW 대비 전력 소비가 99% 이상 감소하며, 악의적 행동 시 스테이킹한 자산이 삭감(슬래싱)됩니다.
그 외에도 DPoS(Delegated Proof of Stake), PBFT(Practical Byzantine Fault Tolerance), PoA(Proof of Authority) 등 다양한 변형이 존재합니다.
1.5 퍼블릭 vs 프라이빗 블록체인
| 구분 | 퍼블릭 | 프라이빗 | 컨소시엄 |
|---|---|---|---|
| 접근성 | 누구나 참여 | 허가된 참여자만 | 선정된 기관들 |
| 합의 속도 | 느림 | 빠름 | 중간 |
| 대표 사례 | Bitcoin, Ethereum | Hyperledger Fabric | R3 Corda |
| 탈중앙 수준 | 높음 | 낮음 | 중간 |
2. 비트코인
2.1 사토시 나카모토와 비트코인의 탄생
2008년 10월, 사토시 나카모토(Satoshi Nakamoto)라는 익명의 인물이 "Bitcoin: A Peer-to-Peer Electronic Cash System"이라는 백서를 발표했습니다. 2009년 1월 3일 제네시스 블록(Block 0)이 채굴되면서 비트코인 네트워크가 시작되었습니다.
비트코인은 **"신뢰할 수 있는 제3자 없이 온라인 결제를 가능하게 하는 시스템"**을 목표로 설계되었습니다.
2.2 UTXO 모델
비트코인은 계좌 잔액 모델이 아닌 UTXO(Unspent Transaction Output) 모델을 사용합니다.
[트랜잭션 예시]
Input: 이전 TX에서 받은 5 BTC (UTXO)
Output: 상대에게 3 BTC (새 UTXO 생성)
본인에게 1.999 BTC (거스름돈 UTXO)
0.001 BTC 수수료 (채굴자에게)
모든 UTXO는 "소비되었거나" "소비되지 않았거나" 둘 중 하나입니다. 이 모델은 병렬 처리에 유리하고 이중 지불을 구조적으로 방지합니다.
2.3 반감기(Halving)
비트코인의 블록 보상은 약 4년(21만 블록)마다 절반으로 줄어듭니다.
| 시기 | 블록 보상 |
|---|---|
| 2009 | 50 BTC |
| 2012 | 25 BTC |
| 2016 | 12.5 BTC |
| 2020 | 6.25 BTC |
| 2024 | 3.125 BTC |
총 발행량은 2,100만 BTC로 제한되어 있으며, 마지막 비트코인은 약 2140년경에 채굴될 예정입니다. 이 디플레이션 설계가 비트코인을 "디지털 금"이라 부르는 이유 중 하나입니다.
2.4 라이트닝 네트워크
비트코인의 메인 체인은 초당 약 7건의 트랜잭션만 처리할 수 있습니다. 이 확장성 문제를 해결하기 위해 **라이트닝 네트워크(Lightning Network)**가 만들어졌습니다.
두 사람이 **결제 채널(Payment Channel)**을 열고, 채널 내에서 무제한으로 거래한 뒤, 최종 잔액만 메인 체인에 기록합니다. 이를 통해 마이크로 결제를 거의 즉시, 극히 낮은 수수료로 처리할 수 있습니다.
Alice --- [결제 채널] --- Bob
| |
| 오프체인 거래 수행 |
| (즉시, 저비용) |
| |
+--- 최종 정산 ----> 메인체인 기록
3. 이더리움과 스마트 컨트랙트
3.1 이더리움의 혁신
비탈릭 부테린(Vitalik Buterin)이 2013년 제안하고 2015년 출시한 이더리움은 블록체인에 **프로그래밍 가능한 로직(스마트 컨트랙트)**을 추가한 플랫폼입니다. 비트코인이 "프로그래밍 가능한 화폐"라면, 이더리움은 "프로그래밍 가능한 세계 컴퓨터"를 지향합니다.
3.2 스마트 컨트랙트란?
스마트 컨트랙트는 미리 정의된 조건이 충족되면 자동으로 실행되는 코드입니다. 블록체인 위에 배포되어 누구도 변경하거나 중단할 수 없습니다.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract SimpleStorage {
uint256 private storedValue;
event ValueChanged(uint256 newValue);
function set(uint256 value) public {
storedValue = value;
emit ValueChanged(value);
}
function get() public view returns (uint256) {
return storedValue;
}
}
위 코드는 Solidity로 작성된 단순 저장 컨트랙트입니다. set 함수로 값을 저장하고 get 함수로 읽습니다. 한번 배포되면 코드 자체를 수정할 수 없습니다(업그레이드 패턴 사용 시 제외).
3.3 EVM(Ethereum Virtual Machine)
EVM은 이더리움 네트워크의 모든 노드에서 동일하게 실행되는 튜링 완전 가상 머신입니다. 스마트 컨트랙트의 바이트코드를 실행하며, 모든 노드가 같은 결과를 얻도록 결정적(deterministic) 실행을 보장합니다.
EVM 호환 체인(Polygon, BSC, Avalanche, Arbitrum 등)이 많아지면서, Solidity로 작성된 컨트랙트를 여러 체인에 배포할 수 있는 생태계가 형성되었습니다.
3.4 Gas와 수수료
이더리움에서 모든 연산에는 Gas가 소모됩니다. Gas는 네트워크 남용을 방지하고, 채굴자/검증자에게 보상을 제공하는 메커니즘입니다.
트랜잭션 비용 = Gas Used x Gas Price(Gwei 단위)
예시:
- 단순 ETH 전송: 21,000 Gas
- ERC-20 토큰 전송: 약 65,000 Gas
- Uniswap 스왑: 약 150,000 Gas
- NFT 민팅: 약 100,000~200,000 Gas
EIP-1559(London 포크) 이후 수수료 구조가 Base Fee + Priority Fee로 변경되었으며, Base Fee는 소각(burn)되어 ETH의 공급량을 줄이는 효과를 냅니다.
3.5 The Merge — PoS 전환
2022년 9월, 이더리움은 PoW에서 PoS로 합의 메커니즘을 전환했습니다(The Merge). 이를 통해:
- 에너지 소비 약 99.95% 감소
- 검증자가 되려면 최소 32 ETH를 스테이킹
- 연간 ETH 발행률 대폭 감소
- 블록 시간이 약 12초로 안정화
Merge 이후에도 Surge, Verge, Purge, Splurge 등 이더리움 로드맵이 계속 진행 중이며, 궁극적으로 초당 10만 건 이상의 트랜잭션 처리를 목표로 합니다.
4. Layer 2 스케일링
4.1 왜 Layer 2가 필요한가?
이더리움 메인넷(Layer 1)은 초당 약 1530건의 트랜잭션만 처리할 수 있습니다. 사용자가 몰리면 Gas 가격이 폭등하여 단순 전송에도 수십 달러의 수수료가 발생합니다. Layer 2는 **메인넷의 보안을 유지하면서 처리량을 수십수백 배로 확장**하는 솔루션입니다.
4.2 Rollup
Rollup은 여러 트랜잭션을 오프체인에서 처리한 후, 압축된 데이터를 Layer 1에 기록하는 방식입니다.
Optimistic Rollup
트랜잭션이 기본적으로 유효하다고 가정(optimistic)하고, 이의 제기 기간(challenge period, 약 7일) 동안 사기 증명(fraud proof)을 제출할 수 있습니다.
- 대표 프로젝트: Optimism, Arbitrum, Base
- 장점: EVM 호환성이 높아 기존 솔리디티 코드를 거의 수정 없이 배포 가능
- 단점: 출금 시 7일 대기 필요
ZK Rollup
영지식 증명(Zero-Knowledge Proof)을 사용하여 트랜잭션의 유효성을 수학적으로 증명합니다. Layer 1에 제출할 때 유효성 증명을 함께 올리므로 즉시 확정됩니다.
- 대표 프로젝트: zkSync, StarkNet, Polygon zkEVM, Scroll, Linea
- 장점: 즉시 확정(finality), 더 높은 보안성
- 단점: EVM 호환성 구현이 기술적으로 어려움
4.3 사이드체인과 Validium
사이드체인은 자체 합의 메커니즘을 가진 독립 체인입니다. 브릿지를 통해 메인넷과 자산을 주고받습니다. Polygon PoS가 대표적인 예입니다.
Validium은 ZK 증명은 사용하되 데이터를 오프체인에 저장하여 비용을 더 줄이는 방식입니다. 데이터 가용성(DA)을 외부에 맡기므로 보안과 비용 사이의 트레이드오프가 있습니다.
4.4 Layer 2 비교
| 솔루션 | 대표 프로젝트 | TPS | 출금 시간 | EVM 호환 |
|---|---|---|---|---|
| Optimistic Rollup | Arbitrum, Optimism | 수천 | 7일 | 높음 |
| ZK Rollup | zkSync, StarkNet | 수천~수만 | 분 단위 | 발전 중 |
| 사이드체인 | Polygon PoS | 수천 | 분~시간 | 높음 |
| Validium | zkPorter, StarkEx | 수만 | 분 단위 | 제한적 |
5. DeFi — 탈중앙 금융
5.1 DeFi란?
DeFi(Decentralized Finance)는 은행, 증권사, 보험사 등 전통 금융 중개자 없이 스마트 컨트랙트로 금융 서비스를 제공하는 생태계입니다. 인터넷 연결과 지갑만 있으면 누구나 참여할 수 있습니다.
5.2 DEX — 탈중앙 거래소
중앙화 거래소(CEX)와 달리, DEX는 주문장(order book) 대신 AMM(Automated Market Maker) 모델을 주로 사용합니다.
Uniswap의 핵심 공식:
x * y = k
x = 토큰 A의 수량
y = 토큰 B의 수량
k = 상수(유동성 풀 크기)
사용자가 토큰 A를 넣고 토큰 B를 꺼내면, x가 증가하고 y가 감소하면서 가격이 자동으로 조정됩니다. 이 단순한 공식이 중앙 관리자 없이 24시간 무중단 거래를 가능하게 합니다.
주요 DEX:
- Uniswap: 이더리움 기반 AMM의 선구자, V3에서 집중 유동성 도입
- Curve Finance: 스테이블코인 스왑에 최적화
- dYdX: 파생상품(선물/옵션) DEX
- Raydium / Jupiter: 솔라나 기반 DEX
5.3 렌딩 프로토콜
Aave와 Compound 같은 렌딩 프로토콜은 다음과 같이 작동합니다:
- 대출자(lender)가 자산을 풀에 예치
- 차입자(borrower)가 담보를 제공하고 대출
- 이자율은 수요/공급에 따라 알고리즘으로 결정
- 담보율이 일정 수준 이하로 떨어지면 자동 청산
[유동성 풀]
예치자 A: 100 ETH -> 이자 수령
예치자 B: 50 ETH -> 이자 수령
차입자 C: 200 USDC 담보 -> 1 ETH 대출
(담보율: 약 150%)
담보가치 하락 시 -> 자동 청산 실행
5.4 스테이블코인
스테이블코인은 가격 변동성을 줄이기 위해 달러 등에 페그(peg)된 토큰입니다.
| 유형 | 대표 | 메커니즘 |
|---|---|---|
| 법정화폐 담보 | USDT, USDC | 1:1 달러 준비금 |
| 암호자산 담보 | DAI | 과담보 CDP로 발행 |
| 알고리즘 | FRAX | 부분 담보 + 알고리즘 |
2022년 Terra/LUNA 사태에서 알고리즘 스테이블코인 UST가 디페깅되며 약 400억 달러가 증발한 사건은, DeFi의 시스템 리스크를 잘 보여주는 사례입니다.
5.5 유동성 풀과 이자 농사
유동성 공급자(LP)가 토큰 쌍을 풀에 예치하면 거래 수수료의 일부를 보상으로 받습니다. 여기에 프로토콜 토큰 보상까지 더해지면 이것이 **이자 농사(Yield Farming)**입니다.
주의할 점은 **비영구적 손실(Impermanent Loss)**입니다. 예치한 토큰 쌍의 가격이 크게 벌어지면 단순 보유 대비 손실이 발생할 수 있습니다.
6. NFT — 디지털 소유권
6.1 NFT란?
NFT(Non-Fungible Token)는 대체 불가능한 고유 토큰입니다. 일반 토큰(ERC-20)은 서로 교환 가능하지만, NFT(ERC-721)는 각각 고유한 식별자를 가집니다.
// ERC-721 핵심 인터페이스 (간략화)
interface IERC721 {
function ownerOf(uint256 tokenId) external view returns (address);
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
}
6.2 NFT의 활용 분야
디지털 아트와 수집품: 가장 널리 알려진 사례입니다. 크립토펑크, BAYC 등이 수백만 달러에 거래되기도 했습니다.
게임 아이템: 게임 내 아이템이나 캐릭터를 NFT로 발행하여 진정한 소유권과 거래 가능성을 부여합니다. Axie Infinity가 초기 대표 사례입니다.
음악/콘텐츠: 아티스트가 중간 유통 과정 없이 팬에게 직접 판매하고, 2차 거래 시에도 로열티를 자동으로 수령합니다.
도메인 이름: ENS(Ethereum Name Service)를 통해 yourname.eth 같은 도메인을 NFT로 소유합니다.
실물 자산 증명: 부동산 소유권, 행사 티켓, 멤버십 등을 NFT로 발급하는 시도가 진행 중입니다.
6.3 유틸리티 NFT
초기 NFT 시장이 투기 중심이었다면, 현재는 실질적인 유틸리티를 제공하는 방향으로 진화하고 있습니다.
- 커뮤니티 멤버십 및 접근 권한
- 실물 상품 교환 가능한 토큰
- 이벤트 입장 티켓(POAP 등)
- 투표 및 거버넌스 참여권
6.4 NFT 시장의 현재
2021~2022년의 과열 이후 NFT 시장은 상당한 조정을 겪었습니다. 거래량은 정점 대비 크게 감소했지만, 기술 인프라는 오히려 성숙해졌습니다. ERC-721에서 ERC-1155(멀티 토큰), ERC-6551(토큰 바운드 어카운트) 등 표준이 계속 발전하고 있습니다.
7. DAO — 탈중앙 자율 조직
7.1 DAO의 개념
DAO(Decentralized Autonomous Organization)는 스마트 컨트랙트에 의해 운영되는 조직입니다. 전통적 조직의 이사회나 CEO 대신, 토큰 홀더들의 투표로 의사결정을 합니다.
[DAO 의사결정 흐름]
1. 구성원이 제안(Proposal) 작성
2. 토큰 홀더 투표 (기간 설정, 예: 7일)
3. 정족수 충족 + 찬성 다수 -> 실행
4. 스마트 컨트랙트가 자동 실행 (자금 이체, 파라미터 변경 등)
7.2 거버넌스 토큰
거버넌스 토큰은 DAO의 의사결정에 참여할 수 있는 권리를 부여합니다.
대표적인 거버넌스 토큰:
- UNI: Uniswap 프로토콜 거버넌스
- AAVE: Aave 렌딩 프로토콜 거버넌스
- MKR: MakerDAO (DAI 발행 관리)
- ARB: Arbitrum 체인 거버넌스
- ENS: Ethereum Name Service 거버넌스
7.3 투표 메커니즘
단순 다수결 외에도 다양한 투표 방식이 연구되고 있습니다.
이차 투표(Quadratic Voting): 투표에 토큰을 사용하되, n표를 행사하려면 n의 제곱만큼의 토큰이 필요합니다. 소수의 고래(whale)가 투표를 독점하는 것을 방지합니다.
1표: 1 토큰 필요
2표: 4 토큰 필요
3표: 9 토큰 필요
위임 투표(Delegated Voting): 자신의 투표권을 전문가에게 위임하는 방식입니다. 모든 안건에 직접 투표하기 어려운 참여자를 위해 설계되었습니다.
7.4 DAO의 도전 과제
- 투표 참여율 저조: 대부분의 DAO에서 실제 투표 참여율은 10% 미만
- 플루토크라시(금권정치): 토큰 대량 보유자가 의사결정을 좌우
- 법적 지위 불명확: 기존 법체계에서 DAO의 법인격 문제
- 느린 의사결정: 온체인 투표는 수일~수주 소요
8. Web3 비전 vs 현실
8.1 Web의 진화
| 세대 | 특징 | 대표 서비스 |
|---|---|---|
| Web1 | 읽기 전용, 정적 페이지 | Yahoo, GeoCities |
| Web2 | 읽기+쓰기, 플랫폼 중심 | Google, Facebook, YouTube |
| Web3 | 읽기+쓰기+소유, 탈중앙 | Uniswap, ENS, Lens Protocol |
Web3의 핵심 약속은 **"사용자가 자신의 데이터와 디지털 자산을 진정으로 소유한다"**는 것입니다.
8.2 Web3의 이상
- 데이터 주권: 플랫폼이 아닌 사용자가 데이터 소유
- 검열 저항: 중앙 권력에 의한 콘텐츠 삭제 불가
- 경제적 참여: 플랫폼 사용자가 네트워크 가치를 공유
- 신원 자주권: DID(탈중앙 신원)로 자신의 정체성을 직접 관리
- 조합 가능성(Composability): 프로토콜 간 레고처럼 조합
8.3 현실적 과제
UX의 벽: 시드 문구 관리, Gas 수수료, 복잡한 트랜잭션 서명 등 일반 사용자에게 진입 장벽이 높습니다.
확장성: Layer 2가 발전했지만, 아직 Web2 수준의 사용자 경험에는 미치지 못합니다.
보안 사고: 스마트 컨트랙트 해킹, 브릿지 취약점, 피싱 등으로 매년 수십억 달러의 피해가 발생합니다.
환경 문제: PoS 전환으로 크게 개선되었지만, 비트코인 채굴의 에너지 소비는 여전히 논란입니다.
규제 불확실성: 각국 정부의 규제 방향이 아직 확립되지 않아 사업 환경이 불안정합니다.
8.4 탈중앙화의 역설
Web3가 표방하는 탈중앙화에도 현실에는 중앙화된 지점이 존재합니다:
- Infura/Alchemy 같은 소수의 노드 서비스 제공자에 의존
- 메타마스크 같은 지배적 지갑 소프트웨어
- 소수 거대 채굴 풀의 해시레이트 집중
- VC 투자에 따른 토큰 분배 편중
- 스마트 컨트랙트의 관리자 키(admin key) 존재
9. 2026 블록체인 트렌드
9.1 RWA — 실물 자산 토큰화
2025~2026년 블록체인 업계의 가장 큰 화두는 RWA(Real World Assets) 토큰화입니다. 부동산, 채권, 주식, 미술품 등 실물 자산을 온체인 토큰으로 발행하는 것입니다.
- 블랙록 BUIDL 펀드: 미국 국채를 토큰화한 온체인 펀드
- Ondo Finance: 토큰화된 미국 국채/채권 상품
- Centrifuge: 기업 대출과 인보이스를 토큰화
RWA의 장점:
- 24/7 거래 가능
- 분할 소유 가능 (비싼 부동산의 일부를 소유)
- 글로벌 접근성 향상
- 투명한 감사 추적(audit trail)
9.2 제도권 진입
2024년 비트코인 현물 ETF 승인을 시작으로, 전통 금융 기관의 블록체인 참여가 급가속화되었습니다.
- 글로벌 은행들의 토큰화 플랫폼 구축
- 기관 투자자용 커스터디(수탁) 서비스 확대
- 스테이블코인 결제 인프라 도입
- 규제 프레임워크 정비 (EU MiCA, 미국 FIT21 등)
9.3 CBDC — 중앙은행 디지털 화폐
전 세계 중앙은행들이 CBDC(Central Bank Digital Currency) 연구/발행을 진행 중입니다.
- 디지털 위안(e-CNY): 중국에서 이미 시범 운영 중
- 디지털 유로: ECB가 준비 단계 진행 중
- 디지털 원: 한국은행이 파일럿 프로그램 진행 중
CBDC는 블록체인 기술을 활용하되, 중앙은행이 발행/관리하는 법정 화폐입니다. 탈중앙화 암호화폐와는 철학적으로 반대되지만, 블록체인 인프라의 대중화에는 기여할 수 있습니다.
9.4 AI와 블록체인의 융합
AI의 급성장과 함께 블록체인과의 결합 사례가 늘고 있습니다:
- AI 에이전트 결제: AI 에이전트가 암호화폐로 자율적으로 결제
- 탈중앙 AI 학습: 데이터 제공자가 토큰 보상을 받으며 AI 학습에 기여
- 온체인 AI 추론 검증: AI 모델의 추론 과정을 블록체인으로 검증
- AI DAO: AI가 DAO 거버넌스 프로세스를 보조하거나 자율 실행
9.5 계정 추상화(Account Abstraction)
ERC-4337로 대표되는 계정 추상화는 Web3 UX의 게임 체인저입니다:
- 시드 문구 대신 소셜 로그인으로 지갑 생성
- Gas 수수료를 프로젝트가 대납(Paymaster)
- 트랜잭션 일괄 처리(Batched Transactions)
- 지출 한도, 시간 잠금 등 맞춤형 보안 규칙 설정
10. 개발자를 위한 블록체인
10.1 스마트 컨트랙트 언어
Solidity는 이더리움 및 EVM 호환 체인의 사실상 표준 언어입니다.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor(uint256 initialSupply) ERC20("MyToken", "MTK") {
_mint(msg.sender, initialSupply * 10 ** decimals());
}
}
그 외 언어:
- Vyper: Python 스타일의 이더리움 언어, 보안에 중점
- Rust: Solana(Anchor 프레임워크) 및 NEAR에서 사용
- Move: Aptos, Sui에서 사용하는 자원 지향 언어
- Cairo: StarkNet 전용 언어
10.2 개발 도구
Hardhat — 가장 널리 쓰이는 이더리움 개발 환경
# 프로젝트 초기화
npx hardhat init
# 컨트랙트 컴파일
npx hardhat compile
# 테스트 실행
npx hardhat test
# 로컬 네트워크 실행
npx hardhat node
# 배포
npx hardhat run scripts/deploy.js --network sepolia
Foundry — Rust 기반 고속 개발 도구
# 프로젝트 초기화
forge init my-project
# 빌드
forge build
# 테스트 (Solidity로 테스트 작성)
forge test -vvv
# 배포
forge script script/Deploy.s.sol --rpc-url sepolia --broadcast
10.3 프론트엔드 연동
Ethers.js는 이더리움과 상호작용하기 위한 JavaScript 라이브러리입니다.
import { ethers } from "ethers";
// 지갑 연결
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();
const address = await signer.getAddress();
console.log("Connected:", address);
// 컨트랙트 호출
const contract = new ethers.Contract(contractAddress, abi, signer);
const result = await contract.get();
console.log("Stored value:", result.toString());
Wagmi + Viem 조합이 최근 React 기반 dApp 개발에서 인기를 얻고 있습니다.
// wagmi를 사용한 지갑 연결 (React Hook)
import { useAccount, useConnect, useDisconnect } from "wagmi";
function WalletConnect() {
const { address, isConnected } = useAccount();
const { connect, connectors } = useConnect();
const { disconnect } = useDisconnect();
if (isConnected) {
return (
<div>
<p>Connected: {address}</p>
<button onClick={() => disconnect()}>Disconnect</button>
</div>
);
}
return (
<button onClick={() => connect({ connector: connectors[0] })}>
Connect Wallet
</button>
);
}
10.4 보안 베스트 프랙티스
스마트 컨트랙트 보안은 매우 중요합니다. 배포 후 수정이 어렵고, 취약점이 곧 자산 손실로 이어집니다.
주요 취약점:
| 취약점 | 설명 |
|---|---|
| 재진입(Reentrancy) | 외부 호출 중 상태 변경 전에 재호출되는 공격 |
| 정수 오버/언더플로 | Solidity 0.8 이전 버전에서 발생 |
| 접근 제어 미흡 | 관리자 함수에 권한 검사 누락 |
| 오라클 조작 | 가격 피드 등 외부 데이터 조작 |
| 플래시론 공격 | 무담보 대출을 이용한 가격 조작 |
보안 도구:
- Slither: 정적 분석 도구
- Mythril: 기호 실행 기반 보안 분석
- OpenZeppelin: 감사된 보안 표준 라이브러리
- Echidna: 퍼즈 테스팅 도구
10.5 블록체인 학습 로드맵
1단계: 기초
- 블록체인 원리, 암호학 기초
- Solidity 문법, Remix IDE 사용
- ERC-20, ERC-721 표준 이해
2단계: 개발 실전
- Hardhat 또는 Foundry 환경 구축
- 테스트 작성 및 배포
- Ethers.js / Viem으로 프론트엔드 연동
3단계: DeFi / NFT 프로젝트
- AMM, 렌딩 프로토콜 구현
- NFT 마켓플레이스 구축
- 가스 최적화
4단계: 심화
- 업그레이드 가능한 컨트랙트 (Proxy 패턴)
- 크로스체인 통신
- ZK 증명 활용
- MEV(Miner Extractable Value) 이해
마치며
블록체인 기술은 초기의 과열과 거품을 지나 성숙 단계에 접어들고 있습니다. RWA 토큰화, 제도권 참여, 계정 추상화를 통한 UX 개선 등이 맞물리면서, 블록체인은 더 이상 암호화폐 투기의 도구가 아니라 금융 인프라의 한 축으로 자리잡아 가고 있습니다.
개발자에게 블록체인은 여전히 도전적이지만 매력적인 분야입니다. Solidity를 배우고, DeFi 프로토콜의 구조를 이해하고, 스마트 컨트랙트 보안을 체득하는 것은 앞으로의 기술 경력에 큰 자산이 될 것입니다.
Web3가 궁극적으로 약속하는 "개인이 진정으로 디지털 자산을 소유하는 인터넷"이 완전히 실현될지는 아직 미지수입니다. 하지만 그 여정에서 만들어지는 기술적 혁신들, 영지식 증명, 분산 합의, 프로그래머블 머니는 이미 현실 세계를 변화시키고 있습니다.
블록체인 퀴즈 10선
Q1. 블록체인의 불변성을 보장하는 핵심 원리는?
각 블록의 헤더에 이전 블록의 해시를 포함시키는 구조입니다. 하나의 블록을 수정하면 그 이후의 모든 블록의 해시도 변경되므로, 사실상 변조가 불가능합니다.
Q2. PoW와 PoS의 가장 큰 차이점은?
PoW는 계산 능력(해시 파워)으로, PoS는 지분(스테이킹)으로 블록 생성 권한을 결정합니다. PoS는 PoW 대비 99% 이상 에너지를 절약합니다.
Q3. 비트코인의 총 발행량은?
2,100만 BTC입니다. 이 한도는 프로토콜에 하드코딩되어 있습니다.
Q4. 스마트 컨트랙트의 정의는?
미리 정의된 조건이 충족되면 자동으로 실행되는 블록체인 위의 프로그램 코드입니다.
Q5. Optimistic Rollup과 ZK Rollup의 차이는?
Optimistic Rollup은 트랜잭션이 유효하다고 가정하고 이의 제기 기간을 둡니다. ZK Rollup은 영지식 증명으로 유효성을 수학적으로 증명합니다.
Q6. Uniswap의 AMM 공식은?
x * y = k 입니다. x와 y는 풀에 있는 두 토큰의 수량, k는 상수입니다.
Q7. 비영구적 손실(Impermanent Loss)이란?
유동성 풀에 토큰을 예치한 후, 토큰 가격이 변동하면서 단순 보유 대비 가치가 줄어드는 현상입니다.
Q8. DAO에서 이차 투표의 목적은?
대량 토큰 보유자가 투표를 독점하는 것을 방지하기 위해, n표를 행사하려면 n의 제곱 토큰이 필요하도록 설계된 방식입니다.
Q9. 계정 추상화(ERC-4337)의 핵심 장점은?
시드 문구 대신 소셜 로그인, Gas 대납, 트랜잭션 일괄 처리 등 Web2 수준의 사용자 경험을 Web3에서 구현할 수 있게 합니다.
Q10. RWA 토큰화란?
부동산, 채권, 주식 등 실물 자산을 블록체인 토큰으로 발행하여 24시간 거래 가능하고 분할 소유할 수 있게 하는 것입니다.
Blockchain & Web3 Fully Explained — How Bitcoin, Ethereum, DeFi, NFTs, and DAOs Work
Table of Contents
- Blockchain Fundamentals
- Bitcoin
- Ethereum and Smart Contracts
- Layer 2 Scaling
- DeFi — Decentralized Finance
- NFTs — Digital Ownership
- DAOs — Decentralized Autonomous Organizations
- Web3 Vision vs Reality
- 2026 Blockchain Trends
- Blockchain for Developers
1. Blockchain Fundamentals
1.1 What Is a Blockchain?
A blockchain is a distributed ledger technology that bundles transaction records into blocks and chains them together. Without any central authority, all network participants share the same ledger, and once data is recorded, it is practically immutable.
Key properties:
| Property | Description |
|---|---|
| Decentralization | Data is distributed across thousands of nodes, not a single server |
| Immutability | Once a block is finalized, past records cannot be altered |
| Transparency | All transactions are publicly verifiable |
| Consensus-based | State transitions are decided through majority agreement |
1.2 Block Structure
Each block consists of a Header and a Body.
+------------------------------+
| Block Header |
| - Previous block hash |
| - Timestamp |
| - Nonce |
| - Merkle Root |
+------------------------------+
| Block Body |
| - Transaction 1 |
| - Transaction 2 |
| - ... |
+------------------------------+
Because the current block header includes the hash of the previous block, modifying any past block would require recalculating every subsequent block. This is the fundamental principle behind blockchain's immutability.
1.3 Hash Functions and Merkle Trees
The most critical cryptographic tool in blockchain is the hash function. Taking SHA-256 as an example, it produces a fixed-length (256-bit) output from any input, and even the smallest change in input produces a completely different hash.
import hashlib
data = "Hello, Blockchain!"
hash_value = hashlib.sha256(data.encode()).hexdigest()
print(hash_value)
# Output: a fixed-length 64-character hexadecimal string
A Merkle Tree repeatedly hashes pairs of transaction hashes to produce a single root hash. This allows efficient verification of whether a specific transaction is included in a block without downloading all the data.
1.4 Consensus Algorithms
Consensus algorithms determine "what goes into the next block" in a distributed network.
Proof of Work (PoW)
Miners repeatedly compute hashes to find a nonce value that satisfies certain conditions. Because this requires enormous computational resources, an attacker would need to control more than 51% of the total computing power to manipulate the network.
Goal: Find a nonce where hash starts with 0000
nonce=0 -> hash: a3f2b1c9... (does not meet condition)
nonce=1 -> hash: 8d1e7f4a... (does not meet condition)
...
nonce=N -> hash: 0000ab3f... (condition met! Block created!)
The advantage is proven security; the disadvantage is massive power consumption.
Proof of Stake (PoS)
Validators stake (deposit) a certain amount of tokens and earn the right to create blocks proportional to their stake. Energy consumption drops by over 99% compared to PoW, and malicious behavior results in slashing of staked assets.
Other variants include DPoS (Delegated Proof of Stake), PBFT (Practical Byzantine Fault Tolerance), and PoA (Proof of Authority).
1.5 Public vs Private Blockchains
| Type | Public | Private | Consortium |
|---|---|---|---|
| Access | Anyone | Permissioned only | Selected organizations |
| Consensus speed | Slow | Fast | Medium |
| Examples | Bitcoin, Ethereum | Hyperledger Fabric | R3 Corda |
| Decentralization | High | Low | Medium |
2. Bitcoin
2.1 Satoshi Nakamoto and the Birth of Bitcoin
In October 2008, a pseudonymous figure called Satoshi Nakamoto published a whitepaper titled "Bitcoin: A Peer-to-Peer Electronic Cash System." On January 3, 2009, the genesis block (Block 0) was mined, launching the Bitcoin network.
Bitcoin was designed to be a system that enables online payments without a trusted third party.
2.2 The UTXO Model
Bitcoin uses the UTXO (Unspent Transaction Output) model rather than an account balance model.
[Transaction Example]
Input: 5 BTC received from a previous TX (UTXO)
Output: 3 BTC to recipient (new UTXO created)
1.999 BTC back to sender (change UTXO)
0.001 BTC fee (goes to miner)
Every UTXO is either "spent" or "unspent." This model is advantageous for parallel processing and structurally prevents double spending.
2.3 The Halving
Bitcoin's block reward is halved approximately every four years (every 210,000 blocks).
| Year | Block Reward |
|---|---|
| 2009 | 50 BTC |
| 2012 | 25 BTC |
| 2016 | 12.5 BTC |
| 2020 | 6.25 BTC |
| 2024 | 3.125 BTC |
The total supply is capped at 21 million BTC, with the last bitcoin expected to be mined around 2140. This deflationary design is one reason Bitcoin is called "digital gold."
2.4 The Lightning Network
Bitcoin's main chain can process only about 7 transactions per second. The Lightning Network was created to solve this scalability problem.
Two parties open a payment channel, conduct unlimited transactions within the channel, and then record only the final balance on the main chain. This enables micropayments to be processed almost instantly with extremely low fees.
Alice --- [Payment Channel] --- Bob
| |
| Off-chain transactions |
| (instant, low cost) |
| |
+--- Final settlement ----> Main chain
3. Ethereum and Smart Contracts
3.1 Ethereum's Innovation
Proposed by Vitalik Buterin in 2013 and launched in 2015, Ethereum added programmable logic (smart contracts) to blockchain. If Bitcoin is "programmable money," Ethereum aims to be a "programmable world computer."
3.2 What Are Smart Contracts?
Smart contracts are code that automatically executes when predefined conditions are met. Once deployed on the blockchain, nobody can modify or stop them.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract SimpleStorage {
uint256 private storedValue;
event ValueChanged(uint256 newValue);
function set(uint256 value) public {
storedValue = value;
emit ValueChanged(value);
}
function get() public view returns (uint256) {
return storedValue;
}
}
This is a simple storage contract written in Solidity. The set function stores a value and get reads it. Once deployed, the code itself cannot be modified (except through upgrade patterns).
3.3 The EVM (Ethereum Virtual Machine)
The EVM is a Turing-complete virtual machine that runs identically on every node in the Ethereum network. It executes smart contract bytecode and guarantees deterministic execution so that all nodes reach the same result.
With many EVM-compatible chains (Polygon, BSC, Avalanche, Arbitrum, etc.), an ecosystem has formed where Solidity contracts can be deployed across multiple chains.
3.4 Gas and Fees
Every computation on Ethereum consumes Gas. Gas is a mechanism that prevents network abuse and rewards validators.
Transaction Cost = Gas Used x Gas Price (in Gwei)
Examples:
- Simple ETH transfer: 21,000 Gas
- ERC-20 token transfer: ~65,000 Gas
- Uniswap swap: ~150,000 Gas
- NFT minting: ~100,000-200,000 Gas
After EIP-1559 (London fork), the fee structure changed to Base Fee + Priority Fee, where the Base Fee is burned, reducing the ETH supply.
3.5 The Merge — Transition to PoS
In September 2022, Ethereum transitioned its consensus mechanism from PoW to PoS (The Merge). This resulted in:
- Approximately 99.95% reduction in energy consumption
- A minimum of 32 ETH required to become a validator
- Significantly reduced annual ETH issuance
- Block times stabilized at approximately 12 seconds
The Ethereum roadmap continues with the Surge, Verge, Purge, and Splurge, ultimately targeting over 100,000 transactions per second.
4. Layer 2 Scaling
4.1 Why Is Layer 2 Needed?
Ethereum's mainnet (Layer 1) can process only about 15-30 transactions per second. When usage surges, Gas prices skyrocket, making even simple transfers cost tens of dollars. Layer 2 solutions scale throughput by tens to hundreds of times while maintaining mainnet security.
4.2 Rollups
Rollups process multiple transactions off-chain and record compressed data on Layer 1.
Optimistic Rollups
Transactions are assumed valid by default (optimistic), with a challenge period (approximately 7 days) during which fraud proofs can be submitted.
- Representative projects: Optimism, Arbitrum, Base
- Advantage: High EVM compatibility allows deploying existing Solidity code with minimal changes
- Disadvantage: 7-day wait for withdrawals
ZK Rollups
Zero-Knowledge Proofs mathematically prove transaction validity. Validity proofs are submitted alongside data to Layer 1, enabling immediate finality.
- Representative projects: zkSync, StarkNet, Polygon zkEVM, Scroll, Linea
- Advantage: Immediate finality, higher security
- Disadvantage: Implementing EVM compatibility is technically challenging
4.3 Sidechains and Validium
Sidechains are independent chains with their own consensus mechanisms. Assets move between the mainnet and sidechain via bridges. Polygon PoS is a prime example.
Validium uses ZK proofs but stores data off-chain to further reduce costs. There is a trade-off between security and cost, as data availability (DA) is delegated externally.
4.4 Layer 2 Comparison
| Solution | Representative Projects | TPS | Withdrawal Time | EVM Compatible |
|---|---|---|---|---|
| Optimistic Rollup | Arbitrum, Optimism | Thousands | 7 days | High |
| ZK Rollup | zkSync, StarkNet | Thousands to tens of thousands | Minutes | Improving |
| Sidechain | Polygon PoS | Thousands | Minutes to hours | High |
| Validium | zkPorter, StarkEx | Tens of thousands | Minutes | Limited |
5. DeFi — Decentralized Finance
5.1 What Is DeFi?
DeFi (Decentralized Finance) is an ecosystem that provides financial services through smart contracts without traditional intermediaries like banks, brokerages, or insurance companies. Anyone with an internet connection and a wallet can participate.
5.2 DEX — Decentralized Exchanges
Unlike centralized exchanges (CEXs), DEXs primarily use the AMM (Automated Market Maker) model instead of order books.
Uniswap's core formula:
x * y = k
x = quantity of Token A
y = quantity of Token B
k = constant (liquidity pool size)
When a user deposits Token A and withdraws Token B, x increases and y decreases, automatically adjusting the price. This simple formula enables 24/7 trading without any central administrator.
Key DEXs:
- Uniswap: Pioneer of Ethereum-based AMMs; introduced concentrated liquidity in V3
- Curve Finance: Optimized for stablecoin swaps
- dYdX: Derivatives (futures/options) DEX
- Raydium / Jupiter: Solana-based DEXs
5.3 Lending Protocols
Lending protocols like Aave and Compound work as follows:
- Lenders deposit assets into a pool
- Borrowers provide collateral and take loans
- Interest rates are determined algorithmically based on supply and demand
- Automatic liquidation occurs when the collateral ratio falls below a threshold
[Liquidity Pool]
Lender A: 100 ETH -> earns interest
Lender B: 50 ETH -> earns interest
Borrower C: 200 USDC collateral -> borrows 1 ETH
(Collateral ratio: ~150%)
If collateral value drops -> automatic liquidation
5.4 Stablecoins
Stablecoins are tokens pegged to assets like the US dollar to reduce price volatility.
| Type | Examples | Mechanism |
|---|---|---|
| Fiat-collateralized | USDT, USDC | 1:1 dollar reserves |
| Crypto-collateralized | DAI | Over-collateralized CDPs |
| Algorithmic | FRAX | Partial collateral + algorithm |
The 2022 Terra/LUNA collapse, where the algorithmic stablecoin UST depegged and wiped out approximately 40 billion dollars, powerfully illustrated the systemic risks of DeFi.
5.5 Liquidity Pools and Yield Farming
Liquidity providers (LPs) deposit token pairs into pools and receive a share of trading fees as rewards. When protocol token rewards are added on top, this becomes Yield Farming.
An important caveat is Impermanent Loss: if the deposited token pair experiences significant price divergence, the LP may suffer losses compared to simply holding.
6. NFTs — Digital Ownership
6.1 What Are NFTs?
NFTs (Non-Fungible Tokens) are unique, non-interchangeable tokens. While regular tokens (ERC-20) are interchangeable, each NFT (ERC-721) has a unique identifier.
// ERC-721 core interface (simplified)
interface IERC721 {
function ownerOf(uint256 tokenId) external view returns (address);
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
}
6.2 NFT Use Cases
Digital Art and Collectibles: The most well-known use case. CryptoPunks and BAYC have sold for millions of dollars.
Gaming Items: In-game items and characters are issued as NFTs, granting true ownership and tradeability. Axie Infinity was an early representative example.
Music and Content: Artists sell directly to fans without intermediaries and automatically receive royalties on secondary sales.
Domain Names: Through ENS (Ethereum Name Service), users can own domains like yourname.eth as NFTs.
Real-World Asset Certificates: Experiments with issuing real estate ownership, event tickets, and memberships as NFTs are ongoing.
6.3 Utility NFTs
While the early NFT market was speculation-driven, the current trend is toward providing tangible utility.
- Community membership and access rights
- Tokens redeemable for physical goods
- Event admission tickets (POAPs, etc.)
- Voting and governance participation rights
6.4 The Current NFT Market
After the 2021-2022 hype, the NFT market went through a significant correction. Trading volumes have declined substantially from the peak, but the underlying technology infrastructure has matured. Standards continue to evolve from ERC-721 to ERC-1155 (multi-token) and ERC-6551 (token-bound accounts).
7. DAOs — Decentralized Autonomous Organizations
7.1 The DAO Concept
A DAO (Decentralized Autonomous Organization) is an organization governed by smart contracts. Instead of traditional boards of directors or CEOs, decisions are made through token holder votes.
[DAO Decision-Making Flow]
1. A member creates a Proposal
2. Token holders vote (set period, e.g., 7 days)
3. Quorum met + majority in favor -> execution
4. Smart contract auto-executes (fund transfers, parameter changes, etc.)
7.2 Governance Tokens
Governance tokens grant the right to participate in DAO decision-making.
Notable governance tokens:
- UNI: Uniswap protocol governance
- AAVE: Aave lending protocol governance
- MKR: MakerDAO (manages DAI issuance)
- ARB: Arbitrum chain governance
- ENS: Ethereum Name Service governance
7.3 Voting Mechanisms
Beyond simple majority voting, various methods are being explored.
Quadratic Voting: Tokens are used to vote, but casting n votes requires n-squared tokens. This prevents a few whales from monopolizing votes.
1 vote: 1 token required
2 votes: 4 tokens required
3 votes: 9 tokens required
Delegated Voting: A system where token holders delegate their voting power to experts. Designed for participants who cannot vote directly on every proposal.
7.4 Challenges Facing DAOs
- Low voter turnout: Most DAOs see actual participation rates below 10%
- Plutocracy: Large token holders dominate decisions
- Unclear legal status: Legal personhood of DAOs under existing frameworks
- Slow decision-making: On-chain voting takes days to weeks
8. Web3 Vision vs Reality
8.1 The Evolution of the Web
| Generation | Characteristics | Representative Services |
|---|---|---|
| Web1 | Read-only, static pages | Yahoo, GeoCities |
| Web2 | Read+Write, platform-centric | Google, Facebook, YouTube |
| Web3 | Read+Write+Own, decentralized | Uniswap, ENS, Lens Protocol |
The core promise of Web3 is that users truly own their data and digital assets.
8.2 The Web3 Ideal
- Data sovereignty: Users own their data, not platforms
- Censorship resistance: Content cannot be deleted by central authorities
- Economic participation: Users share in network value
- Self-sovereign identity: Managing your own identity through DIDs
- Composability: Combining protocols like building blocks
8.3 Real-World Challenges
The UX barrier: Seed phrase management, Gas fees, and complex transaction signing present high entry barriers for average users.
Scalability: While Layer 2 has improved, the user experience still falls short of Web2 standards.
Security incidents: Smart contract hacks, bridge vulnerabilities, and phishing cause billions of dollars in losses annually.
Environmental concerns: The PoS transition has greatly improved things, but Bitcoin mining energy consumption remains contentious.
Regulatory uncertainty: Without established regulatory frameworks across jurisdictions, the business environment remains unstable.
8.4 The Decentralization Paradox
Despite Web3's goal of decentralization, centralized points exist in practice:
- Dependence on a few node service providers like Infura and Alchemy
- Dominant wallet software like MetaMask
- Hash rate concentration among a few large mining pools
- Token distribution skewed by VC investment
- The existence of admin keys in smart contracts
9. 2026 Blockchain Trends
9.1 RWA — Real World Asset Tokenization
The biggest topic in the 2025-2026 blockchain industry is RWA (Real World Assets) tokenization — issuing real estate, bonds, equities, and art as on-chain tokens.
- BlackRock BUIDL Fund: An on-chain fund tokenizing US Treasuries
- Ondo Finance: Tokenized US Treasury and bond products
- Centrifuge: Tokenizing corporate loans and invoices
Benefits of RWA:
- 24/7 trading
- Fractional ownership (own a portion of expensive real estate)
- Improved global accessibility
- Transparent audit trail
9.2 Institutional Adoption
Starting with the approval of Bitcoin spot ETFs in 2024, traditional financial institutions have rapidly accelerated their blockchain participation.
- Global banks building tokenization platforms
- Expansion of institutional-grade custody services
- Introduction of stablecoin payment infrastructure
- Development of regulatory frameworks (EU MiCA, US FIT21, etc.)
9.3 CBDCs — Central Bank Digital Currencies
Central banks worldwide are researching and issuing CBDCs (Central Bank Digital Currencies).
- Digital yuan (e-CNY): Already in pilot operation in China
- Digital euro: ECB in preparation phase
- Digital won: Bank of Korea conducting pilot programs
CBDCs use blockchain technology but are legal tender issued and managed by central banks. While philosophically opposed to decentralized cryptocurrencies, they may contribute to the mainstream adoption of blockchain infrastructure.
9.4 Convergence of AI and Blockchain
With the rapid growth of AI, blockchain integration use cases are increasing:
- AI agent payments: AI agents autonomously transacting with cryptocurrency
- Decentralized AI training: Data providers earning token rewards for contributing to AI training
- On-chain AI inference verification: Verifying AI model inference processes via blockchain
- AI DAOs: AI assisting or autonomously executing DAO governance processes
9.5 Account Abstraction
Account abstraction, represented by ERC-4337, is a game changer for Web3 UX:
- Wallet creation via social login instead of seed phrases
- Gas fee sponsorship by projects (Paymaster)
- Batched transactions
- Custom security rules like spending limits and time locks
10. Blockchain for Developers
10.1 Smart Contract Languages
Solidity is the de facto standard language for Ethereum and EVM-compatible chains.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor(uint256 initialSupply) ERC20("MyToken", "MTK") {
_mint(msg.sender, initialSupply * 10 ** decimals());
}
}
Other languages:
- Vyper: Python-style Ethereum language focused on security
- Rust: Used on Solana (Anchor framework) and NEAR
- Move: Resource-oriented language used on Aptos and Sui
- Cairo: StarkNet-specific language
10.2 Development Tools
Hardhat — The most widely used Ethereum development environment
# Initialize project
npx hardhat init
# Compile contracts
npx hardhat compile
# Run tests
npx hardhat test
# Start local network
npx hardhat node
# Deploy
npx hardhat run scripts/deploy.js --network sepolia
Foundry — Rust-based high-speed development tools
# Initialize project
forge init my-project
# Build
forge build
# Test (tests written in Solidity)
forge test -vvv
# Deploy
forge script script/Deploy.s.sol --rpc-url sepolia --broadcast
10.3 Frontend Integration
Ethers.js is a JavaScript library for interacting with Ethereum.
import { ethers } from "ethers";
// Connect wallet
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();
const address = await signer.getAddress();
console.log("Connected:", address);
// Call contract
const contract = new ethers.Contract(contractAddress, abi, signer);
const result = await contract.get();
console.log("Stored value:", result.toString());
The Wagmi + Viem combination has recently gained popularity for React-based dApp development.
// Wallet connection with wagmi (React Hook)
import { useAccount, useConnect, useDisconnect } from "wagmi";
function WalletConnect() {
const { address, isConnected } = useAccount();
const { connect, connectors } = useConnect();
const { disconnect } = useDisconnect();
if (isConnected) {
return (
<div>
<p>Connected: {address}</p>
<button onClick={() => disconnect()}>Disconnect</button>
</div>
);
}
return (
<button onClick={() => connect({ connector: connectors[0] })}>
Connect Wallet
</button>
);
}
10.4 Security Best Practices
Smart contract security is critically important. Contracts are difficult to modify after deployment, and vulnerabilities directly translate to asset losses.
Key vulnerabilities:
| Vulnerability | Description |
|---|---|
| Reentrancy | Attack where a contract is re-called during an external call before state updates |
| Integer overflow/underflow | Occurs in Solidity versions before 0.8 |
| Insufficient access control | Missing authorization checks on admin functions |
| Oracle manipulation | Tampering with external data like price feeds |
| Flash loan attacks | Price manipulation using uncollateralized loans |
Security tools:
- Slither: Static analysis tool
- Mythril: Symbolic execution-based security analysis
- OpenZeppelin: Audited security standard library
- Echidna: Fuzz testing tool
10.5 Blockchain Learning Roadmap
Stage 1: Fundamentals
- Blockchain principles, cryptography basics
- Solidity syntax, Remix IDE
- ERC-20, ERC-721 standard understanding
Stage 2: Hands-on Development
- Set up Hardhat or Foundry environment
- Write tests and deploy
- Frontend integration with Ethers.js / Viem
Stage 3: DeFi / NFT Projects
- Implement AMMs and lending protocols
- Build an NFT marketplace
- Gas optimization
Stage 4: Advanced
- Upgradeable contracts (Proxy patterns)
- Cross-chain communication
- ZK proof utilization
- MEV (Miner Extractable Value) understanding
Conclusion
Blockchain technology is maturing beyond its early hype cycles. With RWA tokenization, institutional participation, and UX improvements through account abstraction converging, blockchain is no longer merely a vehicle for cryptocurrency speculation — it is becoming a pillar of financial infrastructure.
For developers, blockchain remains a challenging but rewarding field. Learning Solidity, understanding DeFi protocol architecture, and mastering smart contract security will be significant assets for future technology careers.
Whether Web3 will fully realize its ultimate promise of "an internet where individuals truly own their digital assets" remains to be seen. But the technological innovations emerging along the way — zero-knowledge proofs, distributed consensus, programmable money — are already transforming the real world.
Blockchain Quiz: 10 Questions
Q1. What is the core principle behind blockchain's immutability?
Each block header includes the hash of the previous block. Modifying one block would require recalculating every subsequent block's hash, making tampering practically impossible.
Q2. What is the biggest difference between PoW and PoS?
PoW determines block creation rights through computing power (hash rate), while PoS uses stake (staking). PoS saves over 99% of the energy compared to PoW.
Q3. What is Bitcoin's total supply?
21 million BTC. This cap is hardcoded in the protocol.
Q4. What is the definition of a smart contract?
A program on the blockchain that automatically executes when predefined conditions are met.
Q5. What is the difference between Optimistic Rollup and ZK Rollup?
Optimistic Rollup assumes transactions are valid and provides a challenge period. ZK Rollup uses zero-knowledge proofs to mathematically prove validity.
Q6. What is Uniswap's AMM formula?
x * y = k, where x and y are the quantities of the two tokens in the pool, and k is a constant.
Q7. What is Impermanent Loss?
A phenomenon where the value of tokens deposited in a liquidity pool decreases relative to simply holding them, due to price fluctuations.
Q8. What is the purpose of Quadratic Voting in DAOs?
To prevent large token holders from monopolizing votes by requiring n-squared tokens to cast n votes.
Q9. What is the key benefit of Account Abstraction (ERC-4337)?
It enables Web2-level user experiences in Web3, including social login instead of seed phrases, gas sponsorship, and batched transactions.
Q10. What is RWA tokenization?
Issuing real-world assets like real estate, bonds, and equities as blockchain tokens, enabling 24/7 trading and fractional ownership.