Files
2nd/10_Wiki/Topics/AI_and_ML/Blockchain.md
T
Antigravity Agent f8b21af4be Wiki cleanup: error-doc removal, dedup merge, link normalization
10_Wiki/Topics 대규모 정리:
- 오류 캡처/미완성 stub 문서 227개 제거
- 교차폴더 중복 43클러스터 병합 (63파일 → redirect)
- 링크명 정규화: 깨진 링크 수정·redirect 직결·개념 매핑 ~2,400건
- 카테고리 MOC 6개 신규 생성
- Graph 섹션 미해결 related-keyword 링크 10,058건 제거

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 23:52:15 +09:00

290 lines
8.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: wiki-2026-0508-blockchain
title: Blockchain
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [블록체인, distributed ledger, smart contract, Ethereum, Bitcoin, web3, ZK proof, rollup]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [blockchain, ethereum, bitcoin, smart-contract, web3, zk-rollup, defi, nft, ai-blockchain]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: Solidity / Rust
framework: Ethereum / Solana / Cosmos
---
# Blockchain
## 📌 한 줄 통찰
> **"매 신뢰 의 technical implementation"**. 매 central authority X — 매 distributed + 매 cryptographic verification. 매 currency 의 base. 매 smart contract → 매 programmable trust. 매 modern: 매 ZK rollup + AI provenance.
## 📖 핵심
### 매 핵심 mechanism
1. **Decentralization**: 매 single server X.
2. **Immutability**: 매 hash chain 의 변경 의 X.
3. **Consensus**: 매 누가 매 next block.
4. **Cryptographic verification**: 매 transaction 의 sign.
5. **Transparency**: 매 public ledger.
### Consensus algorithm
| Algorithm | 매 사용 |
|---|---|
| Proof of Work (PoW) | Bitcoin, 매 energy ↑ |
| Proof of Stake (PoS) | Ethereum 2.0, 매 energy ↓ |
| Delegated PoS (DPoS) | EOS, Tron |
| Proof of Authority (PoA) | private chain |
| BFT (PBFT, Tendermint) | Cosmos, Hyperledger |
| Avalanche | Avalanche L1 |
### 매 evolution
1. **Bitcoin** (2009): 매 digital currency.
2. **Ethereum** (2015): 매 smart contract.
3. **L2 / Rollup** (2021+): 매 scale.
4. **ZK Rollup** (2023+): 매 zero-knowledge.
5. **Modular** (2024+): 매 Celestia 등 의 specialization.
### 매 stack (Ethereum)
- **L1**: Ethereum mainnet.
- **L2 Optimistic**: Arbitrum, Optimism, Base.
- **L2 ZK**: zkSync, StarkNet, Polygon zkEVM, Scroll.
- **L3**: app-specific rollup.
- **Bridge**: 매 cross-chain.
- **Oracle**: Chainlink, Pyth.
### 매 EVM 대 alternative
- **EVM** (Solidity): 매 dominant.
- **Solana** (Rust + Sealevel): 매 high TPS.
- **Aptos / Sui** (Move): 매 secure 모음.
- **Cosmos** (Tendermint): 매 sovereignty.
- **Near**: 매 sharded.
### 매 application
- **DeFi**: lending, DEX (Uniswap), derivatives.
- **NFT**: art, gaming, identity.
- **DAO**: governance.
- **Stablecoin**: USDC, USDT, DAI.
- **Gaming**: 매 ownership.
- **Identity**: 매 self-sovereign.
- **Provenance**: 매 supply chain, art.
### AI × Blockchain
1. **Provenance**: 매 training data 의 source.
2. **Royalty**: 매 contributor 의 보상.
3. **Decentralized inference**: 매 Bittensor.
4. **Compute marketplace**: 매 Render, Akash.
5. **AI agent payment**: 매 X402, 매 micropayment.
6. **Verifiable inference** (ZK-ML): 매 proof.
### 매 modern issue
1. **Energy** (PoW): 매 Bitcoin 의 GW-scale.
2. **Scaling**: 매 L1 의 limit.
3. **UX**: 매 wallet, 매 gas, 매 seed phrase.
4. **Regulation**: 매 SEC vs CFTC, 매 EU MiCA.
5. **Hack**: 매 매 year 의 Billion-scale theft.
6. **Speculation**: 매 utility ≠ 매 price.
### 매 ZK proof (modern)
- **zk-SNARK** (Groth16, Plonk): 매 succinct.
- **zk-STARK**: 매 transparent (no trusted setup), 매 post-quantum.
- 매 응용: 매 rollup, 매 privacy, 매 ML inference verify.
## 💻 패턴
### Solidity (smart contract)
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract SimpleStorage {
uint256 private value;
address public owner;
event ValueChanged(uint256 newValue, address indexed setter);
constructor() {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner, "Not owner");
_;
}
function set(uint256 _value) external onlyOwner {
value = _value;
emit ValueChanged(_value, msg.sender);
}
function get() external view returns (uint256) {
return value;
}
}
```
### Hardhat (Ethereum dev)
```js
// hardhat.config.js
module.exports = {
solidity: '0.8.20',
networks: {
sepolia: { url: process.env.SEPOLIA_RPC, accounts: [process.env.PRIVATE_KEY] },
mainnet: { url: process.env.MAINNET_RPC, accounts: [process.env.PRIVATE_KEY] },
},
};
// scripts/deploy.js
const hre = require('hardhat');
async function main() {
const Storage = await hre.ethers.getContractFactory('SimpleStorage');
const storage = await Storage.deploy();
await storage.waitForDeployment();
console.log('Deployed to:', await storage.getAddress());
}
main().catch(console.error);
```
### viem (frontend interaction)
```ts
import { createPublicClient, createWalletClient, http, parseAbi } from 'viem';
import { mainnet } from 'viem/chains';
const client = createPublicClient({ chain: mainnet, transport: http() });
const abi = parseAbi(['function get() view returns (uint256)']);
const value = await client.readContract({
address: '0x...',
abi,
functionName: 'get',
});
```
### NFT (ERC-721)
```solidity
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract MyNFT is ERC721 {
uint256 public nextTokenId;
constructor() ERC721("MyNFT", "MNFT") {}
function mint(address to) external {
_safeMint(to, nextTokenId++);
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
return string(abi.encodePacked('ipfs://my-cid/', _toString(tokenId), '.json'));
}
}
```
### DAO governance (Snapshot)
```ts
// 매 token holder 의 vote
const proposal = {
title: 'Increase treasury allocation',
choices: ['For', 'Against', 'Abstain'],
start: Date.now(),
end: Date.now() + 7 * 86400 * 1000,
snapshot: latestBlock,
network: '1',
strategies: [
{ name: 'erc20-balance-of', params: { address: tokenAddress, decimals: 18 } },
],
};
// 매 IPFS 의 post + 매 sign.
```
### ZK-ML proof (verify inference)
```python
# 매 EZKL 의 ONNX 의 ZK proof 로 변환
import ezkl
import torch
# 매 model export
torch.onnx.export(model, dummy_input, 'model.onnx')
# 매 setup
ezkl.gen_settings('model.onnx', 'settings.json')
ezkl.compile_circuit('model.onnx', 'circuit.ezkl', 'settings.json')
# 매 prove
ezkl.prove('input.json', 'circuit.ezkl', 'pk.key', 'proof.json')
# 매 verify (on-chain or off-chain)
ezkl.verify('proof.json', 'settings.json', 'vk.key')
```
→ 매 inference correctness 의 zero-knowledge.
### Provenance (content authenticity)
```solidity
contract ContentProvenance {
struct Record {
string contentHash; // keccak256 of content
address creator;
uint256 timestamp;
string metadataURI; // ipfs://...
}
mapping(bytes32 => Record) public records;
function register(string calldata contentHash, string calldata metadataURI) external {
bytes32 id = keccak256(abi.encodePacked(contentHash, msg.sender));
records[id] = Record(contentHash, msg.sender, block.timestamp, metadataURI);
}
}
```
## 🤔 결정 기준
| 응용 | Chain |
|---|---|
| DeFi (max liquidity) | Ethereum L1 |
| Cheap UX | L2 (Base, Arbitrum) |
| High TPS | Solana |
| Privacy | zkSync, StarkNet, Aztec |
| Gaming | L2 / sidechain |
| Enterprise / consortium | Hyperledger / Polygon CDK |
| AI inference | Bittensor, EZKL |
| Stablecoin | Ethereum + L2 |
**기본값**: L2 (Base / Arbitrum) 의 entry. 매 use case 의 specific chain.
## 🔗 Graph
- 부모: [[Distributed-Systems]] · [[Practical-Cryptography|Cryptography]] · [[Web3]]
- 변형: [[Bitcoin]] · [[Ethereum]] · [[Cosmos]]
- 응용: [[DAO]] · [[Smart-Contract]]
- AI 결합: [[Content-Provenance]] · [[C2PA]]
- Adjacent: [[Anarchism]] · [[Authenticity]]
## 🤖 LLM 활용
**언제**: 매 web3 system design. 매 smart contract review. 매 AI 의 provenance / royalty.
**언제 X**: 매 simple problem (centralized 의 enough). 매 high TPS + low latency 의 strict.
## ❌ 안티패턴
- **Centralized 의 force on blockchain**: 매 cost ↑, 매 benefit X.
- **No audit (smart contract)**: 매 hack risk.
- **Unchecked external call**: 매 reentrancy.
- **On-chain large data**: 매 cost (use IPFS).
- **No upgrade plan**: 매 immutable bug.
- **Speculation 의 only**: 매 utility X.
- **PoW 의 default**: 매 energy 의 unjustified.
## 🧪 검증 / 중복
- Verified (Ethereum yellow paper, Solana whitepaper, zk-rollup papers).
- 신뢰도 A.
- Related: [[Smart-Contract]] · [[ZK-ML]] · [[DAO]] · [[Authenticity]] · [[Anarchism]].
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — consensus + L2 + AI×Blockchain + 매 Solidity / viem / EZKL code |