Smart contract là một tập hợp các điều khoản mà có khả năng tự động thực thi khi các điều kiện giữa các bên liên quan được thỏa mãn1. Contract được viết dưới dạng mã chương trình và tồn tại ở tất cả các node trong mạng lưới blockchain2.
Note
Toàn bộ các ghi chú bên dưới đều là về smart contract của Ethereum, một public blockchain.
Smart contract sau khi được deploy lên blockchain thì sẽ được gán với một địa chỉ định danh 160-bit. Cụ thể hơn, một smart contract ở trên blockchain sẽ bao gồm những thành phần sau: contract address, contract balance (smart contract cũng có thể nhận và gửi tiền), excutable code và một trạng thái3.
Minh họa cho cấu trúc của Ethererum smart contract:
Nguồn ảnh minh họa: Systematic Review of Security Vulnerabilities in Ethereum Blockchain Smart Contract.
Languages
Development Environment
Interaction
Resources
- PaulRBerg/create-eth-app: Create Ethereum-powered apps with one command (github.com)
- scaffold-eth/scaffold-eth: 🏗 forkable Ethereum dev stack focused on fast product iterations (github.com)
Footnotes
-
tham khảo https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart.contracts.html ↩
-
tham khảo An Overview of Smart Contract - Architecture, Applications, and Future Trends ↩
-
tham khảo Smart Contracts - Security Patterns in the Ethereum Ecosystem and Solidity ↩