PYUSD.VN — Stablecoin & On-chain Payment
⚙️ C2 · PYUSD Technical · Cập nhật 2026-03-15 · 13 phút đọc

PYUSD Smart Contract — ERC-20 & SPL Token Chi tiết

Upgradeable proxy · Admin roles · Mint/Burn mechanism · Audit Halborn & Trail of Bits · Developer guide
📌 TL;DR

PYUSD tồn tại trên 2 blockchain với 2 contract riêng biệt: ERC-20 trên Ethereum (0x6c3ea9036406852006290770BEdFcAbA0e23A0e8) và SPL Token trên Solana (2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo). Cả hai có chức năng mint, burn, freeze và wipe theo yêu cầu của NYDFS. Codebase dựa trên USDP (Pax Dollar) đã proven từ 2018. Không có complex DeFi logic — đơn giản, attack surface nhỏ hơn.

🔍Tổng quan: PYUSD trên 2 blockchain

Tiêu chíEthereum (ERC-20)Solana (SPL Token)
Contract address0x6c3ea9036406852006290770BEdFcAbA0e23A0e82b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo
Token standardERC-20 (OpenZeppelin based)SPL Token (Solana Program Library)
Decimals66
Network fee (avg)$2–15 gas<$0.001
Finality~15 giây + confirmations~0.4 giây
Exploreretherscan.iosolscan.io
DeFi TVL (3/2026)~$170M (Aave, Curve, Uniswap)~$200M (Kamino, Raydium, Jupiter)

Hai contract hoạt động độc lập — không có native bridge. Để chuyển PYUSD Ethereum sang Solana, cần dùng bridge protocol (xem PYUSD Bridge ETH↔Solana). Supply trên mỗi chain được Paxos quản lý riêng — tổng cộng mới ra tổng circulation.

ERC-20 trên Ethereum — Chi tiết kỹ thuật

Upgradeable Proxy Pattern

PYUSD ERC-20 dùng upgradeable proxy pattern — có Proxy contract và Implementation contract riêng biệt. Điều này cho phép Paxos upgrade logic (thêm tính năng, fix bug) mà không thay đổi contract address người dùng đã save. Cùng address = cùng balance = không cần update ví hay sàn.

Trade-off: Paxos có quyền thay đổi logic contract. Nhưng upgrade yêu cầu Owner multisig (nhiều private keys) và lịch sử đến nay không có upgrade nào làm hại user.

Key functions trong PYUSD ERC-20

ERC-20 Standard functionsfunction transfer(address to, uint256 value) public returns (bool) function approve(address spender, uint256 value) public returns (bool) function transferFrom(address from, address to, uint256 value) public returns (bool) function balanceOf(address who) public view returns (uint256) function allowance(address owner, address spender) public view returns (uint256)
PYUSD-specific extensions (Paxos)// Supply management — chỉ supplyController có quyền function increaseSupply(uint256 _value) public onlySupplyController returns (bool) function decreaseSupply(uint256 _value) public onlySupplyController returns (bool) // Compliance — chỉ assetProtectionRole có quyền function freeze(address _addr) public onlyAssetProtectionRole function wipeFrozenAddress(address _addr) public onlyAssetProtectionRole function isFrozen(address _addr) public view returns (bool) // Emergency function pause() public onlyOwner function unpause() public onlyOwner

SPL Token trên Solana — Chi tiết kỹ thuật

PYUSD trên Solana là SPL Token — standard token của Solana Program Library. Khác với ERC-20 (custom contract logic), SPL Token dùng shared program của Solana, chỉ customize thông qua mint authority và freeze authority.

SPL Token — key parametersMint Address: 2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo Decimals: 6 Mint Authority: Paxos controlled address (để mint PYUSD mới) Freeze Authority: Paxos controlled address (NYDFS AML requirement) // Các operations chính spl-token mint [mint-address] [amount] [recipient] // Paxos admin only spl-token freeze [account] // Paxos compliance team only spl-token thaw [account] // Unfreeze spl-token burn [account] [amount]

Tại sao Solana phí rẻ hơn Ethereum ~10,000 lần?

Ethereum: mỗi transaction phải trả gas — cạnh tranh theo auction, base fee tính theo EIP-1559. Congestion cao → gas fee tăng đột biến lên $50–100 trong peak. PYUSD transfer trên Ethereum: ~21,000 gas × $0.01–0.07/gwei = $2–15 thông thường, nhưng có thể lên $50+ khi network busy.

Solana: fixed fee 5,000 lamports (~$0.001 tại SOL price $200). Không có auction mechanism. Solana xử lý 50,000 TPS vs Ethereum ~15 TPS — không bao giờ congestion đến mức fee tăng. Lý do: Proof-of-History + parallel transaction processing.

Khi nào chọn Ethereum vs Solana?

Use caseChain tốt hơnLý do
Transfer nhỏ (<$100)SolanaFee Ethereum có thể >10% value
Transfer lớn (>$10,000)Cả hai tương đươngFee không đáng kể so với amount
DeFi yield farmingSolana (phí) / ETH (TVL lớn hơn)Phụ thuộc protocol bạn dùng
Long-term hodl / securityEthereumNetwork effect và security lâu đời hơn
PayPal app integrationCả haiPayPal hỗ trợ cả ETH và SOL PYUSD

👑Admin Roles và Quyền hạn

RoleQuyền hạnAi giữRisk nếu bị compromise
OwnerThay đổi các role khác, upgrade contractPaxos multisig (nhiều sigs)Cao — nhưng multisig giảm risk
Supply ControllerMint và Burn PYUSD (increaseSupply/decreaseSupply)Paxos operational addressRất cao — có thể mint không giới hạn
Asset Protection RoleFreeze address, Wipe frozen balancePaxos compliance teamTrung bình — có thể freeze user
PauserPause/unpause toàn bộ transfersPaxos emergency addressTrung bình — disruption tạm thời

Tất cả role addresses đều public trên Etherscan — có thể verify bất kỳ lúc nào. Supply Controller role là role nhạy cảm nhất — nếu bị compromise, kẻ tấn công có thể mint PYUSD vô hạn mà không có USD backing. Paxos bảo vệ bằng: hardware security modules (HSM), multi-party computation, và NYDFS operational security requirements.

🔐Audit History

AuditorNămScopeKết quả
Trail of Bits2018USDP codebase (gốc của PYUSD)Không có critical issues
Paxos internal2023PYUSD modifications từ USDPNo new vulnerabilities
Halborn Security2023PYUSD SPL Token (Solana)No critical findings

Tại sao codebase đơn giản = an toàn hơn?

PYUSD contract có khoảng 800 dòng Solidity — so với Aave V3 (~50,000 dòng) hay Uniswap V3 (~3,000 dòng). Ít code hơn = ít attack surface hơn = ít bug hơn. Hầu hết DeFi hacks lớn (Euler Finance $197M, Ronin Bridge $625M) xảy ra ở code phức tạp với nhiều interactions. PYUSD chỉ là token đơn giản — không có flash loans, không có oracle, không có AMM logic.

💻Hướng dẫn Developer — Integrate PYUSD

Nếu bạn đang build ứng dụng cần tích hợp PYUSD, đây là các điểm kỹ thuật quan trọng:

Decimals: 6, không phải 18

Lỗi phổ biến nhất: developer assume 18 decimals (ETH standard). PYUSD dùng 6 decimals giống USDC — 1 PYUSD = 1,000,000 units. Nếu code của bạn hardcode 18, sẽ hiển thị số sai.

Đọc balance PYUSD on-chain// Sai: assume 18 decimals const balance = rawBalance / 1e18; // WRONG // Đúng: dùng 6 decimals const balance = rawBalance / 1e6; // CORRECT // Tốt hơn: đọc decimals từ contract const decimals = await pyusdContract.decimals(); // Returns 6 const balance = rawBalance / (10 ** decimals); // Safe

Approve + TransferFrom pattern

Để protocol (DeFi) spend PYUSD thay bạn, cần approve trước. Sau EIP-2612, PYUSD có permit() function cho gasless approval — check contract có support không.

Frozen address handling

Nếu build DEX hay lending protocol, cần handle trường hợp địa chỉ bị freeze — transfer sẽ revert. Implement try/catch và error handling rõ ràng.

🔍On-chain Verification — Tự kiểm tra

  • Contract source code Ethereum: etherscan.io → search contract address → tab "Contract" → "Code" — source verified và readable
  • Total supply: etherscan.io → Token page → "Total Supply"
  • Holder count: etherscan.io → "Holders" tab — xem phân bố top holders
  • Recent transfers: etherscan.io → "Token Transfers" — mint events từ address 0x000...000
  • Solana SPL info: solscan.io → token address → "Token Info"
  • Cross-check với attestation: Total supply on-chain phải khớp với Paxos attestation report tháng gần nhất

Câu hỏi thường gặp

Không — hai token riêng biệt trên hai blockchain. Cả hai đều 1:1 với USD, do Paxos issue, nhưng không interoperable trực tiếp. Cần bridge để chuyển giữa hai chain. Total supply = ETH supply + Solana supply.
Có — ERC-20 dùng upgradeable proxy pattern. Paxos có thể upgrade implementation (thay logic) trong khi giữ nguyên address. Upgrade yêu cầu Owner multisig. Lịch sử: chưa có upgrade nào làm hại user. Upgradeability là trade-off: flexibility vs centralization.
1 PYUSD = 1,000,000 units on-chain (6 số 0 sau dấu phẩy). Khi thấy balance 1,000,000 trong raw contract data, thực tế là 1 PYUSD. Standard giống USDC. USDT dùng 6 decimals trên Ethereum (nhưng 18 trên Tron) — cẩn thận khi code multi-chain.
Có — source code verified và public. Ethereum: etherscan.io → search contract address 0x6c3ea9... → tab "Contract" → "Code". Không cần kỹ năng lập trình sâu để đọc function names, comments, và role structure.

📚Tài liệu tham khảo

  1. Etherscan (2026). PYUSD Token Contract. etherscan.io
  2. Solscan (2026). PYUSD SPL Token. solscan.io
  3. Paxos (2023). PYUSD Technical Documentation. paxos.com
  4. Halborn Security (2023). PYUSD Solana SPL Audit Report. halborn.com
  5. Trail of Bits (2018). Pax Dollar Smart Contract Audit. trailofbits.com
🔬
Tác giả & Biên soạn
ZRO Research — PYUSD.VN
Stablecoin & DeFi Research Analyst · Chuyên nghiên cứu on-chain payment, stablecoin cơ chế và ứng dụng tại thị trường Việt Nam
Smart ContractDeFi DevOn-chain Research
📅 Cập nhật: 15/03/2026
✅ Fact-checked