อีเทอเรียม: แพลตฟอร์มสัญญาอัจฉริยะและแอปพลิเคชันแบบกระจายศูนย์รุ่นถัดไป

Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform

Von Vitalik Buterin · 2013

Abstract

Satoshi Nakamoto's development of Bitcoin in 2009 has often been hailed as a radical development in money and currency, being the first example of a digital asset which simultaneously has no backing or intrinsic value and no centralized issuer or controller. However, another, arguably more important, part of the Bitcoin experiment is the underlying blockchain technology as a tool of distributed consensus, and attention is rapidly starting to shift to this other aspect of Bitcoin. Commonly cited alternative applications of blockchain technology include using on-blockchain digital assets to represent custom currencies and financial instruments (colored coins), the ownership of an underlying physical device (smart property), non-fungible assets such as domain names (Namecoin), as well as more complex applications involving having digital assets being directly controlled by a piece of code implementing arbitrary rules (smart contracts) or even blockchain-based decentralized autonomous organizations (DAOs).

What Ethereum intends to provide is a blockchain with a built-in fully fledged Turing-complete programming language that can be used to create "contracts" that can be used to encode arbitrary state transition functions, allowing users to create any of the systems described above, as well as many others that we have not yet imagined, simply by writing up the logic in a few lines of code. A bare-bones version of Namecoin can be written in two lines of code, and other protocols like currencies and reputation systems can be built in under twenty lines. Smart contracts, cryptographic "boxes" that contain value and only unlock it if certain conditions are met, can also be built on top of the platform, with vastly more power than that offered by Bitcoin scripting because of the added powers of Turing-completeness, value-awareness, blockchain-awareness, and state.

Abstract

Ethereum เป็นแพลตฟอร์ม cryptocurrency และแอปพลิเคชันแบบกระจายศูนย์รุ่นถัดไป ที่นำเสนอ blockchain พร้อมภาษาโปรแกรมมิ่ง Turing-complete ในตัว ซึ่งอนุญาตให้ทุกคนเขียน smart contract และแอปพลิเคชันแบบกระจายศูนย์ที่สามารถสร้างกฎเกณฑ์ตามอำเภอใจสำหรับการเป็นเจ้าของ รูปแบบธุรกรรม และ state transition function ได้

นวัตกรรมพื้นฐานของ Ethereum คือการรวมเทคโนโลยี blockchain ที่ริเริ่มโดย Bitcoin เข้ากับสภาพแวดล้อมการเขียนโปรแกรมอเนกประสงค์ ในขณะที่ Bitcoin มอบระบบ state transition แบบง่ายสำหรับการโอนเงินตราจากบัญชีหนึ่งไปยังอีกบัญชีหนึ่ง Ethereum มอบแพลตฟอร์มที่นักพัฒนาสามารถสร้างแอปพลิเคชันแบบกระจายศูนย์ทุกประเภทที่จินตนาการได้ ตั้งแต่สกุลเงินทางเลือกและเครื่องมือทางการเงิน ไปจนถึงระบบจดทะเบียนโดเมนและองค์กรแบบกระจายศูนย์

Ethereum บรรลุเป้าหมายนี้โดยการสร้างสิ่งที่เป็นชั้นพื้นฐานนามธรรมสูงสุด: blockchain พร้อมภาษาโปรแกรมมิ่ง Turing-complete ในตัว ที่อนุญาตให้ทุกคนเขียน smart contract และแอปพลิเคชันแบบกระจายศูนย์ที่สามารถสร้างกฎเกณฑ์ตามอำเภอใจสำหรับการเป็นเจ้าของ รูปแบบธุรกรรม และ state transition function ได้ เวอร์ชันพื้นฐานของ Namecoin สามารถเขียนได้ในสองบรรทัดของโค้ด และโปรโตคอลอื่น ๆ เช่น สกุลเงินและระบบชื่อเสียงสามารถสร้างได้ในไม่ถึงยี่สิบบรรทัด

Introduction and Existing Concepts

The concept of decentralized digital currency, as well as alternative applications like property registries, has been around for decades. The anonymous e-cash protocols of the 1980s and the 1990s, mostly reliant on a cryptographic primitive known as Chaumian blinding, provided a currency with a high degree of privacy, but the protocols largely failed to gain traction because of their reliance on a centralized intermediary. In 1998, Wei Dai's b-money became the first proposal to introduce the idea of creating money through solving computational puzzles as well as decentralized consensus, but the proposal was scant on details as to how decentralized consensus could actually be implemented. In 2005, Hal Finney introduced a concept of reusable proofs of work, a system which uses ideas from b-money together with Adam Back's computationally difficult Hashcash puzzles to create a concept for a cryptocurrency, but once again fell short of the ideal by relying on trusted computing as a backend.

In 2009, a decentralized currency was for the first time implemented in practice by Satoshi Nakamoto, combining established primitives for managing ownership through public key cryptography with a consensus algorithm for keeping track of who owns coins, known as "proof of work." The mechanism behind proof of work was a breakthrough in the space because it simultaneously solved two problems. First, it provided a simple and moderately effective consensus algorithm, allowing nodes in the network to collectively agree on a set of canonical updates to the state of the Bitcoin ledger. Second, it provided a mechanism for allowing free entry into the consensus process, solving the political problem of deciding who gets to influence the consensus, while simultaneously preventing sybil attacks. It does this by substituting a formal barrier to participation, such as the requirement to be registered as a unique entity on a particular list, with an economic barrier -- the weight of a single node in the consensus voting process is directly proportional to the computing power that the node brings. Since then, an alternative approach has been proposed called proof of stake, calculating the weight of a node as being proportional to its currency holdings and not computational resources; the discussion of the relative merits of the two approaches is beyond the scope of this paper but it should be noted that both approaches can be used to serve as the backbone of a cryptocurrency.

The Bitcoin blockchain has proven remarkably robust in practice over the subsequent years of operation, but it is inherently limited in what it can accomplish beyond simple value transfer. Bitcoin's scripting language is intentionally designed to be restrictive, lacking loops, Turing-completeness, and many other features that would be necessary to build more complex applications. This limitation, while providing safety from certain classes of attacks, severely restricts what can be built on top of Bitcoin. Over the following years, numerous attempts to extend Bitcoin's functionality emerged: colored coins sought to use the Bitcoin blockchain to track ownership of alternative assets, Namecoin attempted to create a decentralized name registration database, and various metacoin protocols aimed to build additional layers on top of Bitcoin's transaction format. While these approaches showed promise, they were ultimately constrained by Bitcoin's scripting capabilities and the inability to access blockchain data from within scripts.

What Ethereum intends to provide is a blockchain with a built-in fully fledged Turing-complete programming language that can be used to create "contracts" that can be used to encode arbitrary state transition functions, allowing users to create any of the systems described above, as well as many others that we have not yet imagined, simply by writing up the logic in a few lines of code.

Introduction and Existing Concepts

แนวคิดของสกุลเงินดิจิทัลแบบกระจายอำนาจ รวมถึงแอปพลิเคชันทางเลือก เช่น การลงทะเบียนทรัพย์สิน มีมานานหลายทศวรรษแล้ว โปรโตคอล e-cash ที่ไม่ระบุชื่อในช่วงทศวรรษ 1980 และ 1990 ซึ่งส่วนใหญ่อาศัยการเข้ารหัสแบบดั้งเดิมที่เรียกว่า Chaumian blinding ทำให้สกุลเงินมีความเป็นส่วนตัวในระดับสูง แต่โปรโตคอลส่วนใหญ่ล้มเหลวในการรับแรงดึงเนื่องจากการพึ่งพาตัวกลางแบบรวมศูนย์ ในปี 1998 b-money ของ Wei Dai กลายเป็นข้อเสนอแรกที่แนะนำแนวคิดในการสร้างเงินผ่านการไขปริศนาทางการคำนวณ เช่นเดียวกับฉันทามติแบบกระจายอำนาจ แต่ข้อเสนอดังกล่าวยังไม่มีรายละเอียดมากนักเกี่ยวกับวิธีการนำฉันทามติแบบกระจายอำนาจไปใช้จริง

ในปี 2009 สกุลเงินแบบกระจายอำนาจถูกนำมาใช้ในทางปฏิบัติเป็นครั้งแรกโดย Satoshi Nakamoto โดยรวมเอาหลักการพื้นฐานที่กำหนดไว้สำหรับการจัดการความเป็นเจ้าของผ่านการเข้ารหัสคีย์สาธารณะเข้ากับอัลกอริธึมที่เป็นเอกฉันท์สำหรับการติดตามว่าใครเป็นเจ้าของเหรียญ หรือที่เรียกว่า "หลักฐานการทำงาน" กลไกเบื้องหลังการพิสูจน์การทำงานถือเป็นความก้าวหน้าในด้านนี้ เนื่องจากสามารถแก้ไขปัญหาสองประการไปพร้อมๆ กัน ประการแรก ให้อัลกอริธึมฉันทามติที่เรียบง่ายและมีประสิทธิภาพปานกลาง ซึ่งช่วยให้โหนดในเครือข่ายตกลงร่วมกันเกี่ยวกับชุดการอัปเดตตามรูปแบบบัญญัติสำหรับสถานะของ Bitcoin ledger ประการที่สอง เป็นกลไกในการอนุญาตให้เข้าสู่กระบวนการฉันทามติอย่างเสรี แก้ปัญหาทางการเมืองในการตัดสินใจว่าใครจะมีอิทธิพลต่อฉันทามติ ขณะเดียวกันก็ป้องกันการโจมตีของซีบิลไปพร้อมๆ กัน

บล็อกเชน Bitcoin ได้รับการพิสูจน์แล้วว่าแข็งแกร่งอย่างน่าทึ่งตลอดระยะเวลาหลายปีของการดำเนินงาน แต่ก็มีข้อจำกัดโดยเนื้อแท้ ภาษาสคริปต์ของ Bitcoin ได้รับการออกแบบโดยเจตนาให้มีข้อจำกัดและไม่สมบูรณ์ ขาดการวนซ้ำ และคุณสมบัติอื่นๆ มากมายที่จำเป็นต่อการสร้างแอปพลิเคชันที่ซับซ้อนมากขึ้น ข้อจำกัดนี้มีไว้เพื่อป้องกันการวนซ้ำไม่สิ้นสุดและการโจมตีทางคอมพิวเตอร์ในรูปแบบอื่นๆ แต่จะจำกัดสิ่งที่สามารถสร้างบน Bitcoin ได้อย่างเข้มงวด

ในช่วงห้าปีที่ผ่านมา มีความพยายามหลายครั้งในการขยายฟังก์ชันการทำงานของ Bitcoin เหรียญสีพยายามใช้บล็อคเชน Bitcoin เพื่อติดตามความเป็นเจ้าของสินทรัพย์ทางเลือก Namecoin พยายามสร้างฐานข้อมูลการลงทะเบียนชื่อแบบกระจายอำนาจ และโปรโตคอล metacoin ต่างๆ ที่มีวัตถุประสงค์เพื่อสร้างเลเยอร์เพิ่มเติมที่ด้านบนของ Bitcoin แม้ว่าแนวทางเหล่านี้แสดงให้เห็นแนวโน้มที่ดี แต่ท้ายที่สุดแล้วแนวทางเหล่านี้ถูกจำกัดด้วยความสามารถในการเขียนสคริปต์ของ Bitcoin และไม่สามารถเข้าถึงข้อมูลบล็อกเชนจากภายในสคริปต์ได้

สิ่งที่ Ethereum ตั้งใจที่จะมอบให้คือบล็อกเชนที่มีภาษาการเขียนโปรแกรมทัวริงที่สมบูรณ์ในตัว ซึ่งสามารถใช้เพื่อสร้าง "สัญญา" ที่สามารถใช้เพื่อเข้ารหัสฟังก์ชันการเปลี่ยนสถานะตามอำเภอใจ ช่วยให้ผู้ใช้สามารถสร้างระบบใดๆ ที่อธิบายไว้ข้างต้น เช่นเดียวกับระบบอื่นๆ อีกมากมายที่เรายังไม่ได้จินตนาการ เพียงแค่เขียนตรรกะในโค้ดเพียงไม่กี่บรรทัด

Bitcoin As A State Transition System

From a technical standpoint, the ledger of a cryptocurrency such as Bitcoin can be thought of as a state transition system, where there is a "state" consisting of the ownership status of all existing bitcoins and a "state transition function" that takes a state and a transaction and outputs a new state which is the result. In a standard banking system, for example, the state is a balance sheet, a transaction is a request to move \(X from A to B, and the state transition function reduces the value in A's account by \)X and increases the value in B's account by \(X. If A's account has less than \)X in the first place, the state transition function returns an error. Hence, one can formally define:

APPLY(S,TX) - S' or ERROR

In the banking system defined above:

APPLY({ Alice: \(50, Bob: \)50 },send \(20 from Alice to Bob") = { Alice: \)30, Bob: $70 }

But:

APPLY({ Alice: \(50, Bob: \)50 },send $70 from Alice to Bob) = ERROR

The "state" in Bitcoin is the collection of all coins (technically, "unspent transaction outputs" or UTXO) that have been minted and not yet spent, with each UTXO having a denomination and an owner (defined by a 20-byte address which is essentially a cryptographic public key). A transaction contains one or more inputs, with each input containing a reference to an existing UTXO and a cryptographic signature produced by the private key associated with the owner's address, and one or more outputs, with each output containing a new UTXO to be added to the state.

Ethereum state transition diagram showing how transactions transform blockchain state

The state transition function APPLY(S,TX) - S' can be defined roughly as follows:

  1. For each input in TX:
  2. If the referenced UTXO is not in S, return an error.
  3. If the provided signature does not match the owner of the UTXO, return an error.
  4. If the sum of the denominations of all input UTXO is less than the sum of the denominations of all output UTXO, return an error.
  5. Return S with all input UTXO removed and all output UTXO added.

The first half of the first step prevents transaction senders from spending coins that do not exist, the second half of the first step prevents transaction senders from spending other people's coins, and the second step enforces conservation of value. In order to use this for payment, the protocol is as follows. Suppose Alice wants to send 11.7 BTC to Bob. First, Alice will look for a set of available UTXO that she owns that totals up to at least 11.7 BTC. Realistically, Alice will not be able to get exactly 11.7 BTC; say that the smallest she can get is 6+4+2=12. She then creates a transaction with those three inputs and two outputs. The first output will be 11.7 BTC with Bob's address as its owner, and the second output will be the remaining 0.3 BTC "change", with the owner being Alice herself.

Bitcoin As A State Transition System

จากมุมมองทางเทคนิค ledger ของสกุลเงินดิจิทัล เช่น Bitcoin สามารถถือเป็นระบบการเปลี่ยนสถานะ โดยมี "สถานะ" ประกอบด้วยสถานะความเป็นเจ้าของของ bitcoins ที่มีอยู่ทั้งหมด และ "ฟังก์ชันการเปลี่ยนสถานะ" ที่รับสถานะและธุรกรรม และส่งออกสถานะใหม่ซึ่งเป็นผลลัพธ์ ตัวอย่างเช่น ในระบบธนาคารมาตรฐาน รัฐคืองบดุล ธุรกรรมคือการร้องขอให้ย้าย \(X จาก A ไป B และฟังก์ชันการเปลี่ยนสถานะจะลดมูลค่าในบัญชีของ A ลง \)X และเพิ่มมูลค่าในบัญชีของ B ลง \(X หากบัญชีของ A มีน้อยกว่า \)X ในตอนแรก ฟังก์ชันการเปลี่ยนสถานะจะส่งกลับข้อผิดพลาด

Ethereum state transition diagram showing how transactions transform blockchain state

"สถานะ" ใน Bitcoin คือการรวบรวมเหรียญทั้งหมด (ในทางเทคนิค "เอาต์พุตธุรกรรมที่ยังไม่ได้ใช้" หรือ UTXO) ที่ได้รับการสร้างเสร็จและยังไม่ได้ใช้ โดยแต่ละ UTXO มีสกุลเงินและเจ้าของ (กำหนดโดยที่อยู่ 20 ไบต์ ซึ่งโดยพื้นฐานแล้วคือคีย์สาธารณะที่เข้ารหัส) ธุรกรรมประกอบด้วยอินพุตหนึ่งรายการขึ้นไป โดยแต่ละอินพุตประกอบด้วยการอ้างอิงถึง UTXO ที่มีอยู่และลายเซ็นการเข้ารหัสที่สร้างโดยคีย์ส่วนตัวที่เกี่ยวข้องกับที่อยู่ของเจ้าของ และเอาต์พุตอย่างน้อยหนึ่งรายการ โดยแต่ละเอาต์พุตจะมี UTXO ใหม่ที่จะเพิ่มลงในสถานะ

ฟังก์ชันการเปลี่ยนสถานะ APPLY(S,TX) - S' สามารถกำหนดได้คร่าวๆ ดังนี้:

  1. สำหรับแต่ละอินพุตใน TX หาก UTXO ที่อ้างอิงไม่ได้อยู่ใน S ให้ส่งกลับข้อผิดพลาด
  2. หากลายเซ็นที่ให้ไว้ไม่ตรงกับเจ้าของ UTXO ให้ส่งคืนข้อผิดพลาด
  3. หากผลรวมของส่วนของอินพุต UTXO ทั้งหมดน้อยกว่าผลรวมของส่วนของเอาต์พุต UTXO ทั้งหมด ให้ส่งกลับข้อผิดพลาด
  4. ส่งคืน S โดยเอาอินพุต UTXO ทั้งหมดออกและเพิ่ม UTXO เอาต์พุตทั้งหมด

ครึ่งแรกของขั้นตอนแรกจะป้องกันไม่ให้ผู้ส่งธุรกรรมใช้เหรียญที่ไม่มีอยู่จริง ครึ่งหลังของขั้นตอนแรกจะป้องกันไม่ให้ผู้ส่งธุรกรรมใช้เหรียญของผู้อื่น และขั้นตอนที่สองบังคับใช้การอนุรักษ์มูลค่า เพื่อใช้ในการชำระเงิน โปรโตคอลจะเป็นดังนี้: สมมติว่าอลิซต้องการส่ง 11.7 BTC ให้กับ Bob ก่อนอื่น Alice จะมองหาชุดของ UTXO ที่มีอยู่ซึ่งเธอเป็นเจ้าของ ซึ่งมีมูลค่ารวมอย่างน้อย 11.7 BTC ตามความเป็นจริงแล้ว Alice จะไม่สามารถรับ 11.7 BTC ได้อย่างแน่นอน บอกว่าค่าที่เล็กที่สุดที่เธอหาได้คือ 6+4+2=12 จากนั้นเธอก็สร้างธุรกรรมด้วยอินพุตสามรายการและเอาต์พุตสองรายการ เอาต์พุตแรกจะเป็น 11.7 BTC โดยมีที่อยู่ของ Bob เป็นเจ้าของ และเอาต์พุตที่สองจะเป็น "การเปลี่ยนแปลง" ที่เหลือ 0.3 BTC โดยเจ้าของคืออลิซเอง

Mining

If we had access to a trustworthy centralized service, this system would be trivial to implement; it could simply be coded exactly as described, using a centralized server's hard drive to keep track of the state. However, with Bitcoin we are trying to build a decentralized currency system, so we will need to combine the state transaction system with a consensus system in order to ensure that everyone agrees on the order of transactions. Bitcoin's decentralized consensus process requires nodes in the network to continuously attempt to produce packages of transactions called "blocks." The network is intended to produce roughly one block every ten minutes, with each block containing a timestamp, a nonce, a reference to (i.e. hash of) the previous block and a list of all of the transactions that have taken place since the previous block. Over time, this creates a persistent, ever-growing, "blockchain" that constantly updates to represent the latest state of the Bitcoin ledger.

Ethereum block structure showing linked blocks with timestamps nonces and transactions

The algorithm for checking if a block is valid, expressed in this paradigm, is as follows:

  1. Check if the previous block referenced by the block exists and is valid.
  2. Check that the timestamp of the block is greater than that of the previous block and less than 2 hours into the future.
  3. Check that the proof of work on the block is valid.
  4. Let S[0] be the state at the end of the previous block.
  5. Suppose TX is the block's transaction list with n transactions. For all i in 0...n-1, set S[i+1] = APPLY(S[i],TX[i]). If any application returns an error, exit and return false.
  6. Return true, and register S[n] as the state at the end of this block.

Essentially, each transaction in the block must provide a valid state transition from what was the canonical state before the transaction was executed to some new state. Note that the state is not encoded in the block in any way; it is purely an abstraction to be remembered by the validating node and can only be (securely) computed for any block by starting from the genesis state and sequentially applying every transaction in every block. Additionally, note that the order in which the miner includes transactions into the block matters; if there are two transactions A and B in a block such that B spends a UTXO created by A, then the block will be valid if A comes before B but not otherwise.

The one validity condition present in the above list that is not found in other systems is the requirement for "proof of work." The precise condition is that the double-SHA256 hash of every block, treated as a 256-bit number, must be less than a dynamically adjusted target, which as of the time of this writing is approximately \(2^{187}\). The purpose of this is to make block creation computationally "hard," thereby preventing sybil attackers from remaking the entire blockchain in their favor. Because SHA256 is designed to be a completely unpredictable pseudorandom function, the only way to create a valid block is simply trial and error, repeatedly incrementing the nonce and seeing if the new hash matches.

At the current target of \(\sim 2^{187}\), the network must make an average of \(\sim 2^{69}\) tries before a valid block is found; in general, the target is recalibrated by the network every 2016 blocks so that on average a new block is produced by some node in the network every ten minutes. In order to compensate miners for this computational work, the miner of every block is entitled to include a transaction giving themselves 25 BTC out of nowhere. Additionally, if any transaction has a higher total denomination in its inputs than in its outputs, the difference also goes to the miner as a "transaction fee." Incidentally, this is also the only mechanism by which BTC are issued; the genesis state contained no coins at all.

In order to better understand the purpose of mining, let us examine what happens in the event of a malicious attacker. Since Bitcoin's underlying cryptography is known to be secure, the attacker will target the one part of the Bitcoin system that is not protected by cryptography directly: the order of transactions. The attacker's strategy is simple:

  1. Send 100 BTC to a merchant in exchange for some product (preferably a rapid-delivery digital good).
  2. Wait for the delivery of the product.
  3. Produce another transaction sending the same 100 BTC to himself.
  4. Try to convince the network that his transaction to himself was the one that came first.

Once step (1) has taken place, after a few minutes some miner will include the transaction in a block, say block number 270000. After about one hour, five more blocks will have been added to the chain after that block, with each of those blocks indirectly pointing to the transaction and thus "confirming" it. At this point, the merchant will accept the payment as finalized and deliver the product. Since we are assuming this is a digital good, delivery is instant. Now, the attacker creates another transaction sending the 100 BTC to himself. If the attacker simply releases it into the wild, the transaction will not be processed; miners will attempt to run APPLY(S,TX) and notice that TX consumes a UTXO which is no longer in the state. So instead, the attacker creates a "fork" of the blockchain, starting by mining another version of block 270000 pointing to the same block 269999 as a parent but with the new transaction in place of the old one. Because the block data is different, this requires redoing the proof of work. Furthermore, the attacker's new version of block 270000 has a different hash, so the original blocks 270001 to 270005 do not "point" to it; thus, the original chain and the attacker's new chain are completely separate. The rule is that in a fork the longest blockchain is taken to be the truth, and so legitimate miners will work on the 270005 chain while the attacker alone is working on the 270000 chain. In order for the attacker to make his blockchain the longest, he would need to have more computational power than the rest of the network combined in order to catch up (hence, "51% attack").

Mining

หากเราเข้าถึงบริการแบบรวมศูนย์ที่น่าเชื่อถือ ระบบนี้คงใช้งานไม่ได้ มันสามารถเขียนโค้ดได้ตรงตามที่อธิบายไว้ โดยใช้ฮาร์ดไดรฟ์ของเซิร์ฟเวอร์ส่วนกลางเพื่อติดตามสถานะ อย่างไรก็ตาม ด้วย Bitcoin เรากำลังพยายามสร้างระบบสกุลเงินที่กระจายอำนาจ ดังนั้นเราจะต้องรวมระบบธุรกรรมของรัฐเข้ากับระบบฉันทามติเพื่อให้แน่ใจว่าทุกคนเห็นด้วยกับลำดับของธุรกรรม กระบวนการฉันทามติแบบกระจายอำนาจของ Bitcoin กำหนดให้โหนดในเครือข่ายพยายามสร้างแพ็คเกจธุรกรรมที่เรียกว่า "บล็อก" อย่างต่อเนื่อง เครือข่ายมีวัตถุประสงค์เพื่อสร้างประมาณหนึ่งบล็อกทุกๆ สิบนาที โดยแต่ละบล็อกมีการประทับเวลา nonce การอ้างอิงถึง (เช่น แฮชของ) บล็อกก่อนหน้า และรายการธุรกรรมทั้งหมดที่เกิดขึ้นตั้งแต่บล็อกก่อนหน้า

Ethereum block structure showing linked blocks with timestamps nonces and transactions

เมื่อเวลาผ่านไป สิ่งนี้จะสร้าง "บล็อกเชน" ที่ต่อเนื่องและเติบโตอย่างต่อเนื่อง โดยมีการอัปเดตอย่างต่อเนื่องเพื่อแสดงสถานะล่าสุดของ Bitcoin ledger อัลกอริธึมสำหรับการตรวจสอบว่าบล็อกนั้นถูกต้องหรือไม่ ซึ่งแสดงในกระบวนทัศน์นี้มีดังนี้:

  1. ตรวจสอบว่าบล็อกก่อนหน้าที่บล็อกอ้างอิงนั้นมีอยู่และถูกต้องหรือไม่
  2. ตรวจสอบว่าการประทับเวลาของบล็อกนั้นมากกว่าของบล็อกก่อนหน้าและน้อยกว่า 2 ชั่วโมงในอนาคต
  3. ตรวจสอบว่าหลักฐานการทำงานบนบล็อกนั้นถูกต้อง
  4. ให้ S เป็นสถานะที่ส่วนท้ายของบล็อกก่อนหน้า
  5. สมมติว่า TX คือรายการธุรกรรมของบล็อกที่มีธุรกรรม n รายการ สำหรับ i ทั้งหมดใน 0...n-1 ให้ตั้งค่า S = APPLY(S,TX[i]) หากแอปพลิเคชันใดส่งคืนข้อผิดพลาด ให้ออกและส่งคืนค่าเท็จ
  6. คืนค่าเป็นจริง และลงทะเบียน S เป็นสถานะที่ส่วนท้ายของบล็อกนี้

โดยพื้นฐานแล้ว แต่ละธุรกรรมในบล็อกจะต้องจัดให้มีการเปลี่ยนสถานะที่ถูกต้องจากสถานะมาตรฐานก่อนที่ธุรกรรมจะถูกดำเนินการไปสู่สถานะใหม่ โปรดทราบว่าสถานะไม่ได้ถูกเข้ารหัสในบล็อก แต่อย่างใด มันเป็นนามธรรมล้วนๆ ที่ต้องจดจำโดยโหนดตรวจสอบความถูกต้อง และสามารถคำนวณได้ (อย่างปลอดภัย) สำหรับบล็อกใดๆ โดยเริ่มจากสถานะกำเนิดและใช้ทุกธุรกรรมตามลำดับในทุกบล็อก

นักขุดจะได้รับรางวัลสำหรับงานคำนวณด้วย bitcoins ที่สร้างขึ้นใหม่พร้อมการทำธุรกรรม">ค่าธรรมเนียมการทำธุรกรรม กระบวนการขุดมีดังต่อไปนี้: นักขุดใช้ส่วนหัวของบล็อกและแฮชมันซ้ำ ๆ ด้วยค่า nonce ที่แตกต่างกันจนกระทั่งพวกเขาพบแฮชที่ต่ำกว่าเป้าหมายความยากที่แน่นอน เมื่อนักขุดพบแฮชดังกล่าว พวกเขาจะออกอากาศบล็อกไปยังเครือข่าย และโหนดอื่น ๆ จะตรวจสอบว่าแฮชนั้นถูกต้องและธุรกรรมทั้งหมดในบล็อกนั้นถูกต้อง เป้าหมายความยากจะถูกปรับโดยอัตโนมัติโดยโปรโตคอลทุก ๆ บล็อกในปี 2559 (ประมาณสองสัปดาห์) เพื่อให้แน่ใจว่าบล็อกนั้นมีอัตราคงที่โดยประมาณ

โปรดทราบว่าในระยะยาว ความปลอดภัยของบล็อกเชนขึ้นอยู่กับนักขุดที่มีแรงจูงใจทางการเงินให้ประพฤติตนอย่างซื่อสัตย์ หากผู้โจมตีควบคุมพลังการขุดของเครือข่ายมากกว่า 50% พวกเขาก็สามารถดำเนินการ "โจมตี 51%" ได้ด้วยการสร้างบล็อคเชนทางเลือกที่เติบโตเร็วกว่าเชนที่ซื่อสัตย์ อย่างไรก็ตาม การโจมตีดังกล่าวจะต้องใช้ทรัพยากรคอมพิวเตอร์จำนวนมหาศาล และอาจส่งผลให้รางวัลการขุดของผู้โจมตีไร้ค่า เนื่องจากเครือข่ายสูญเสียความมั่นใจในความสมบูรณ์ของบล็อคเชน

Merkle Trees

Merkle trees are a fundamental data structure used in Bitcoin blocks to enable efficient and secure verification of transaction inclusion. A Merkle tree is a binary tree of hashes where the leaf nodes contain hashes of individual transactions, and each interior node contains the hash of its two children, recursively building up to a single root hash that is stored in the block-header/" class="glossary-link" data-slug="block-header" title="block header">block header. This hierarchical structure allows anyone to verify that a specific transaction is included in a block by downloading only the Merkle branch—the chain of hashes from the transaction up to the root—rather than downloading all transactions in the block.

Simplified Payment Verification using Merkle tree branch proofs for transaction verification

The efficiency gains are substantial: while a full Bitcoin node must store the entire blockchain (approximately 15GB as of 2013), a simplified payment verification (SPV) node only needs to download block headers containing Merkle roots, requiring just 4MB of data. To verify a transaction, an SPV node requests the Merkle branch from full nodes, which requires only \(O(\log n)\) data where \(n\) is the number of transactions in a block. This logarithmic scaling makes it feasible to run lightweight clients on mobile devices and low-resource environments.

Bitcoin's use of Merkle trees demonstrates a key principle: cryptographic structures can dramatically reduce the trust and resource requirements for participating in a decentralized network. This same principle underlies Ethereum's design, where Merkle trees are used not only for transactions but also for state and receipt storage, enabling even more sophisticated light client protocols.

Merkle Trees

ต้นไม้ Merkle เป็นโครงสร้างข้อมูลพื้นฐานที่ใช้ในบล็อก Bitcoin เพื่อให้สามารถยืนยันการรวมธุรกรรมได้อย่างมีประสิทธิภาพและปลอดภัย Merkle tree เป็นแผนผังไบนารี่ของแฮช โดยที่ leaf nodes มีแฮชของธุรกรรมแต่ละรายการ และโหนดภายในแต่ละโหนดมีแฮชของลูกสองคนของมัน โดยสร้างแบบวนซ้ำจนกลายเป็นแฮชรูทเดี่ยวที่ถูกเก็บไว้ในส่วนหัวของบล็อก โครงสร้างแบบลำดับชั้นนี้ช่วยให้ใครก็ตามสามารถตรวจสอบได้ว่าธุรกรรมใดรวมอยู่ในบล็อกโดยการดาวน์โหลดเฉพาะสาขา Merkle ซึ่งเป็นสายโซ่ของแฮชจากธุรกรรมจนถึงราก แทนที่จะดาวน์โหลดธุรกรรมทั้งหมดในบล็อก

Simplified Payment Verification using Merkle tree branch proofs for transaction verification

ประสิทธิภาพที่เพิ่มขึ้นมีนัยสำคัญ: แม้ว่าโหนด Bitcoin แบบเต็มจะต้องจัดเก็บบล็อกเชนทั้งหมด (ประมาณ 15GB ในปี 2013) แต่โหนดการตรวจสอบการชำระเงิน (SPV) แบบง่ายขึ้นจะต้องดาวน์โหลดส่วนหัวของบล็อกที่มีรากของ Merkle เท่านั้น ซึ่งต้องการข้อมูลเพียง 4MB ในการตรวจสอบธุรกรรม โหนด SPV จะร้องขอสาขา Merkle จากโหนดแบบเต็ม ซึ่งต้องการเฉพาะข้อมูล O(log n) โดยที่ n คือจำนวนธุรกรรมในบล็อก มาตราส่วนลอการิทึมนี้ทำให้สามารถรันไคลเอนต์แบบน้ำหนักเบาบนอุปกรณ์มือถือและสภาพแวดล้อมที่มีทรัพยากรต่ำได้

การใช้แผนผัง Merkle ของ Bitcoin แสดงให้เห็นถึงหลักการสำคัญ: โครงสร้างการเข้ารหัสสามารถลดความไว้วางใจและความต้องการทรัพยากรสำหรับการเข้าร่วมในเครือข่ายแบบกระจายอำนาจได้อย่างมาก หลักการเดียวกันนี้รองรับการออกแบบของ Ethereum โดยที่แผนผัง Merkle ไม่เพียงแต่ใช้สำหรับธุรกรรมเท่านั้น แต่ยังใช้สำหรับการจัดเก็บสถานะและใบเสร็จรับเงินด้วย ซึ่งช่วยให้โปรโตคอลไคลเอ็นต์แบบ light มีความซับซ้อนมากยิ่งขึ้น

Alternative Blockchain Applications

The success of Bitcoin's blockchain inspired numerous attempts to extend the concept beyond simple currency. Namecoin, launched in 2010, was one of the earliest examples—a decentralized name registration database built on a blockchain, allowing users to register names in a distributed namespace that no central authority could censor or revoke. Colored coins emerged as a way to represent alternative assets on the Bitcoin blockchain by "tagging" specific transaction outputs to represent ownership of real-world assets, company shares, or other cryptocurrencies. Metacoins and meta-protocols like Mastercoin (later Omni) layered additional functionality on top of Bitcoin by encoding extra data in Bitcoin transactions and building separate protocol rules on top.

However, all these approaches suffered from fundamental limitations imposed by Bitcoin's architecture. The Bitcoin scripting language is intentionally restricted—it cannot access blockchain state, lacks loops and complex control flow, and provides limited introspection into transaction values. Building sophisticated applications required awkward workarounds: encoding metadata in transaction fields never intended for that purpose, relying on off-chain infrastructure for complex logic, or accepting severe limitations on what the protocol could accomplish.

These constraints motivated the search for a more general-purpose blockchain platform. Rather than building yet another special-purpose protocol on top of Bitcoin's limited foundation, Ethereum takes a different approach: providing a blockchain with a built-in Turing-complete programming language, allowing anyone to write smart contracts and decentralized applications with arbitrary rules for ownership, transaction formats, and state transition functions.

Alternative Blockchain Applications

ความสำเร็จของบล็อกเชนของ Bitcoin เป็นแรงบันดาลใจให้เกิดความพยายามมากมายในการขยายแนวคิดไปไกลกว่าสกุลเงินธรรมดา Namecoin เปิดตัวในปี 2010 เป็นหนึ่งในตัวอย่างแรกสุด ฐานข้อมูลการลงทะเบียนชื่อแบบกระจายอำนาจที่สร้างขึ้นบนบล็อกเชน ช่วยให้ผู้ใช้สามารถลงทะเบียนชื่อในเนมสเปซแบบกระจายที่ไม่มีหน่วยงานกลางใดสามารถเซ็นเซอร์หรือเพิกถอนได้ เหรียญสีกลายเป็นวิธีหนึ่งในการนำเสนอสินทรัพย์ทางเลือกบนบล็อกเชน Bitcoin โดยการ "แท็ก" ผลลัพธ์ของธุรกรรมเฉพาะเพื่อแสดงถึงความเป็นเจ้าของสินทรัพย์ในโลกแห่งความเป็นจริง หุ้นบริษัท หรือสกุลเงินดิจิตอลอื่น ๆ Metacoins และเมตาโปรโตคอล เช่น Mastercoin (ต่อมาคือ Omni) แบ่งชั้นฟังก์ชันการทำงานเพิ่มเติมไว้ด้านบนสุดของ Bitcoin โดยการเข้ารหัสข้อมูลเพิ่มเติมในธุรกรรม Bitcoin และสร้างกฎโปรโตคอลแยกต่างหากไว้ด้านบน

อย่างไรก็ตาม วิธีการทั้งหมดนี้ได้รับผลกระทบจากข้อจำกัดพื้นฐานที่กำหนดโดยสถาปัตยกรรมของ Bitcoin ภาษาสคริปต์ Bitcoin ถูกจำกัดโดยเจตนา เนื่องจากไม่สามารถเข้าถึงสถานะบล็อกเชน ขาดลูปและโฟลว์การควบคุมที่ซับซ้อน และให้การพิจารณามูลค่าธุรกรรมอย่างจำกัด การสร้างแอปพลิเคชันที่ซับซ้อนจำเป็นต้องมีวิธีแก้ปัญหาชั่วคราว: การเข้ารหัสข้อมูลเมตาในฟิลด์ธุรกรรมที่ไม่เคยมีจุดประสงค์เพื่อจุดประสงค์นั้น อาศัยโครงสร้างพื้นฐานนอกเครือข่ายสำหรับตรรกะที่ซับซ้อน หรือการยอมรับข้อจำกัดที่รุนแรงเกี่ยวกับสิ่งที่โปรโตคอลสามารถทำได้สำเร็จ

ข้อจำกัดเหล่านี้กระตุ้นให้เกิดการค้นหาแพลตฟอร์มบล็อกเชนที่มีจุดประสงค์ทั่วไปมากขึ้น แทนที่จะสร้างโปรโตคอลที่มีจุดประสงค์พิเศษอื่นนอกเหนือจากรากฐานอันจำกัดของ Bitcoin Ethereum ใช้วิธีการที่แตกต่างออกไป: มอบบล็อกเชนด้วยภาษาการเขียนโปรแกรมที่สมบูรณ์ในตัวของ Turing ช่วยให้ใครก็ตามสามารถเขียนสัญญาอัจฉริยะและแอปพลิเคชันที่กระจายอำนาจด้วยกฎที่กำหนดเองสำหรับการเป็นเจ้าของ รูปแบบธุรกรรม และฟังก์ชันการเปลี่ยนสถานะ

Scripting

Bitcoin Script, the language used to define spending conditions for Bitcoin transactions, is intentionally designed with severe limitations. It is not Turing-complete—most notably, it lacks loops and complex control flow structures. The language operates as a simple stack-based execution environment where operations push and pop values, evaluate cryptographic conditions, and ultimately return true or false to determine whether a transaction is valid. While this simplicity provides security benefits and makes formal analysis easier, it also makes many types of applications impossible to implement.

These limitations fall into three main categories. First, the lack of Turing-completeness prevents implementing complex state machines, decision trees, or any algorithm requiring iteration. Second, value-blindness means that scripts cannot specify fine-grained control over withdrawal amounts—a UTXO can only be spent in its entirety, with change sent to a new output. A script cannot, for example, limit withdrawals to a maximum of X per day while leaving the remainder locked. Third, the lack of blockchain state awareness means that UTXO are either spent or unspent with no intermediate states, making multi-stage contracts impossible to implement purely on-chain.

These constraints make sophisticated applications like decentralized autonomous organizations, savings wallets with withdrawal limits, decentralized exchanges, or prediction markets either impossible or require awkward off-chain mechanisms. An advanced financial contract might require access to market data, the ability to maintain internal state across multiple transactions, and complex conditional logic—none of which Bitcoin Script can provide. Ethereum removes these limitations by providing a Turing-complete language with full access to blockchain state.

Scripting

สคริปต์ Bitcoin ซึ่งเป็นภาษาที่ใช้ในการกำหนดเงื่อนไขการใช้จ่ายสำหรับธุรกรรม Bitcoin ได้รับการออกแบบโดยตั้งใจโดยมีข้อจำกัดที่เข้มงวด มันไม่ใช่ทัวริงที่สมบูรณ์ โดยเฉพาะอย่างยิ่ง มันขาดลูปและโครงสร้างโฟลว์การควบคุมที่ซับซ้อน ภาษาทำงานเป็นสภาพแวดล้อมการดำเนินการแบบอิงสแต็กอย่างง่าย โดยที่การดำเนินการดันและป๊อปค่า ประเมินเงื่อนไขการเข้ารหัส และส่งคืนค่าจริงหรือเท็จในท้ายที่สุดเพื่อพิจารณาว่าธุรกรรมนั้นถูกต้องหรือไม่ แม้ว่าความเรียบง่ายนี้จะให้ประโยชน์ด้านความปลอดภัยและทำให้การวิเคราะห์อย่างเป็นทางการง่ายขึ้น แต่ก็ยังทำให้แอปพลิเคชันหลายประเภทไม่สามารถนำไปใช้ได้

ข้อจำกัดเหล่านี้แบ่งออกเป็นสามประเภทหลัก ประการแรก การขาดความสมบูรณ์ของทัวริงจะขัดขวางการนำเครื่องสถานะที่ซับซ้อน แผนผังการตัดสินใจ หรืออัลกอริทึมใดๆ ที่ต้องการการวนซ้ำ ประการที่สอง การมองไม่เห็นคุณค่าหมายความว่าสคริปต์ไม่สามารถระบุการควบคุมจำนวนเงินที่ถอนอย่างละเอียดได้ โดย UTXO สามารถใช้ได้ทั้งหมดเท่านั้น โดยจะส่งการเปลี่ยนแปลงไปยังเอาต์พุตใหม่ ตัวอย่างเช่น สคริปต์ไม่สามารถจำกัดการถอนได้สูงสุด X ต่อวัน โดยปล่อยให้ส่วนที่เหลือถูกล็อคไว้ ประการที่สาม การขาดการรับรู้ถึงสถานะบล็อคเชน หมายความว่า UTXO ถูกใช้ไปหรือไม่ถูกใช้โดยไม่มีสถานะตัวกลาง ทำให้สัญญาแบบหลายขั้นตอนเป็นไปไม่ได้ที่จะนำไปใช้แบบออนไลน์ล้วนๆ

ข้อจำกัดเหล่านี้ทำให้แอปพลิเคชันที่ซับซ้อน เช่น องค์กรอิสระแบบกระจายอำนาจ, กระเป๋าเงินออมทรัพย์ที่มีขีดจำกัดการถอน, การแลกเปลี่ยนแบบกระจายอำนาจ หรือตลาดการคาดการณ์ เป็นไปไม่ได้หรือต้องใช้กลไกนอกเครือข่ายที่น่าอึดอัดใจ สัญญาทางการเงินขั้นสูงอาจต้องการการเข้าถึงข้อมูลตลาด ความสามารถในการรักษาสถานะภายในของธุรกรรมหลายรายการ และตรรกะเงื่อนไขที่ซับซ้อน ซึ่งสคริปต์ Bitcoin ไม่สามารถให้ได้ Ethereum ลบข้อจำกัดเหล่านี้ด้วยการจัดเตรียมภาษาทัวริงที่สมบูรณ์พร้อมการเข้าถึงสถานะบล็อกเชนอย่างเต็มรูปแบบ

Ethereum

Ethereum's fundamental goal is to provide a blockchain with a built-in Turing-complete programming language that allows anyone to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats, and state transition functions. Rather than designing a protocol for specific applications like currency, name registration, or asset trading, Ethereum provides a foundational layer—a blockchain-based distributed computing platform that developers can use to build any application they can imagine.

The architecture differs fundamentally from Bitcoin's UTXO model. Ethereum uses an account-based system where the blockchain state consists of a mapping from addresses to account objects. Each account has a balance, a transaction counter (nonce), and for contract accounts, associated code and storage. The platform includes a built-in Turing-complete programming language for writing contract code that executes in the Ethereum Virtual Machine (EVM), a stack-based execution environment that processes transactions and state transitions.

This generality enables a vast range of applications: alternative cryptocurrencies with custom issuance rules, financial derivatives and stablecoins, identity and reputation systems, decentralized file storage, decentralized autonomous organizations (DAOs), and much more. The whitepaper emphasizes that Ethereum is not optimized for any particular use case but instead provides the fundamental building blocks—accounts, transactions, a Turing-complete language, and gas-metered execution—that developers can combine to create whatever applications the ecosystem demands.

Ethereum

เป้าหมายพื้นฐานของ Ethereum คือการจัดเตรียมบล็อกเชนด้วยภาษาโปรแกรมทัวริงที่สมบูรณ์ในตัว ซึ่งช่วยให้ใครก็ตามสามารถเขียนสัญญาอัจฉริยะและแอปพลิเคชันแบบกระจายอำนาจ ซึ่งพวกเขาสามารถสร้างกฎตามอำเภอใจของตนเองสำหรับการเป็นเจ้าของ รูปแบบธุรกรรม และฟังก์ชันการเปลี่ยนสถานะ แทนที่จะออกแบบโปรโตคอลสำหรับแอปพลิเคชันเฉพาะ เช่น สกุลเงิน การจดทะเบียนชื่อ หรือการซื้อขายสินทรัพย์ Ethereum มอบเลเยอร์พื้นฐาน ซึ่งเป็นแพลตฟอร์มการประมวลผลแบบกระจายบนบล็อกเชนที่นักพัฒนาสามารถใช้เพื่อสร้างแอปพลิเคชันใดๆ ที่พวกเขาสามารถจินตนาการได้

สถาปัตยกรรมแตกต่างโดยพื้นฐานจากโมเดล UTXO ของ Bitcoin Ethereum ใช้ระบบตามบัญชีโดยที่สถานะบล็อกเชนประกอบด้วยการแมปจากที่อยู่ไปยังออบเจ็กต์บัญชี แต่ละบัญชีมียอดคงเหลือ ตัวนับธุรกรรม (nonce) และสำหรับบัญชีสัญญา รหัสที่เกี่ยวข้องและพื้นที่เก็บข้อมูล แพลตฟอร์มดังกล่าวประกอบด้วยภาษาการเขียนโปรแกรมทัวริงที่สมบูรณ์ในตัวสำหรับการเขียนโค้ดสัญญาที่ดำเนินการใน Ethereum Virtual Machine (EVM) ซึ่งเป็นสภาพแวดล้อมการดำเนินการแบบสแต็กที่ประมวลผลธุรกรรมและการเปลี่ยนสถานะ

ลักษณะทั่วไปนี้ทำให้เกิดการใช้งานที่หลากหลาย: สกุลเงินดิจิทัลทางเลือกที่มีกฎการออกแบบกำหนดเอง อนุพันธ์ทางการเงินและเหรียญเสถียร ระบบข้อมูลประจำตัวและชื่อเสียง พื้นที่จัดเก็บไฟล์แบบกระจายอำนาจ องค์กรอิสระแบบกระจายอำนาจ (DAO) และอื่นๆ อีกมากมาย เอกสารไวท์เปเปอร์เน้นย้ำว่า Ethereum ไม่ได้รับการปรับให้เหมาะสมสำหรับกรณีการใช้งานเฉพาะใดๆ แต่กลับจัดเตรียมบล็อคส่วนประกอบพื้นฐาน เช่น บัญชี ธุรกรรม ภาษาที่สมบูรณ์ของทัวริง และการดำเนินการตามปริมาณก๊าซ ซึ่งนักพัฒนาสามารถนำมารวมกันเพื่อสร้างแอปพลิเคชันใดก็ตามที่ระบบนิเวศต้องการ

Ethereum Accounts

In Ethereum, the state is made up of accounts, and there are two fundamental types. Externally owned accounts (EOAs) are controlled by private keys and have no associated code—they represent human users or external entities interacting with the blockchain. Contract accounts are controlled by their contract code and are activated when they receive a message or transaction. Both types share a common structure: every account has a nonce (a counter used to ensure each transaction can only be processed once), an ether balance, and for contracts specifically, contract code and persistent storage.

Ether is the primary internal cryptocurrency of Ethereum, serving as both a medium of value transfer and the fundamental unit for paying transaction fees (gas). Unlike Bitcoin's UTXO model where value is distributed across multiple unspent outputs, Ethereum accounts maintain a simple balance that increases when they receive ether and decreases when they send it. This account-based model simplifies many types of applications, particularly those requiring persistent state or complex access control, though it introduces different security considerations compared to Bitcoin's approach.

The distinction between EOAs and contract accounts is crucial to understanding Ethereum's operation. EOAs can initiate transactions by creating and signing messages with their private keys, paying gas fees to have their transactions included in blocks. Contract accounts cannot initiate transactions themselves but can send messages to other contracts in response to receiving a transaction or message, enabling complex chains of execution where a single external transaction triggers multiple contract-to-contract interactions.

Ethereum Accounts

ใน Ethereum รัฐประกอบด้วยบัญชี และมีประเภทพื้นฐานอยู่ 2 ประเภท บัญชีที่เป็นเจ้าของภายนอก (EOA) ถูกควบคุมโดยคีย์ส่วนตัวและไม่มีรหัสที่เกี่ยวข้อง—บัญชีเหล่านี้เป็นตัวแทนของผู้ใช้ที่เป็นมนุษย์หรือหน่วยงานภายนอกที่มีการโต้ตอบกับบล็อกเชน บัญชีสัญญาจะถูกควบคุมโดยรหัสสัญญาและจะเปิดใช้งานเมื่อได้รับข้อความหรือธุรกรรม ทั้งสองประเภทมีโครงสร้างร่วมกัน: ทุกบัญชีมี nonce (ตัวนับที่ใช้เพื่อให้แน่ใจว่าแต่ละธุรกรรมสามารถประมวลผลได้เพียงครั้งเดียว), ยอดคงเหลือ Ether และสำหรับสัญญาโดยเฉพาะ รหัสสัญญาและพื้นที่จัดเก็บถาวร

อีเธอร์เป็นสกุลเงินดิจิทัลภายในหลักของ Ethereum ซึ่งทำหน้าที่เป็นทั้งสื่อกลางในการโอนมูลค่าและเป็นหน่วยพื้นฐานสำหรับการจ่ายค่าธรรมเนียมการทำธุรกรรม (ก๊าซ) ต่างจากโมเดล UTXO ของ Bitcoin ที่มูลค่าจะถูกกระจายไปยังเอาต์พุตที่ยังไม่ได้ใช้หลายรายการ บัญชี Ethereum จะรักษายอดคงเหลือแบบง่าย ๆ ซึ่งจะเพิ่มขึ้นเมื่อได้รับอีเทอร์และลดลงเมื่อส่ง โมเดลตามบัญชีนี้ช่วยลดความซับซ้อนของแอปพลิเคชันหลายประเภท โดยเฉพาะอย่างยิ่งแอปพลิเคชันที่ต้องการสถานะถาวรหรือการควบคุมการเข้าถึงที่ซับซ้อน แม้ว่าจะมีข้อควรพิจารณาด้านความปลอดภัยที่แตกต่างกันเมื่อเปรียบเทียบกับแนวทางของ Bitcoin

ความแตกต่างระหว่าง EOA และบัญชีสัญญามีความสำคัญต่อการทำความเข้าใจการดำเนินงานของ Ethereum EOA สามารถเริ่มต้นธุรกรรมได้โดยการสร้างและลงนามข้อความด้วยคีย์ส่วนตัว โดยจ่ายค่าธรรมเนียมก๊าซเพื่อให้ธุรกรรมรวมอยู่ในบล็อก บัญชีสัญญาไม่สามารถเริ่มการทำธุรกรรมได้ด้วยตนเอง แต่สามารถส่งข้อความไปยังสัญญาอื่น ๆ เพื่อตอบสนองการรับธุรกรรมหรือข้อความ ทำให้เกิดห่วงโซ่การดำเนินการที่ซับซ้อน โดยที่ธุรกรรมภายนอกรายการเดียวทำให้เกิดการโต้ตอบระหว่างสัญญากับสัญญาหลายครั้ง

Messages and Transactions

Transactions in Ethereum are signed data packages created by externally owned accounts and broadcast to the network. A transaction contains the recipient address, a cryptographic signature proving the sender's identity, the amount of ether to transfer, an optional data field (crucial for interacting with contracts), STARTGAS (the maximum number of computational steps the transaction is allowed to take), and GASPRICE (the fee per computational step the sender is willing to pay). Miners collect these transactions, validate them, execute them, and include them in blocks, receiving the gas fees as compensation.

Messages are conceptually similar to transactions but are produced by contracts rather than external actors. When a contract's code executes, it can send messages to other contracts—these internal messages contain the sender (the contract address), recipient, an amount of ether to transfer, an optional data payload, and a STARTGAS limit. Messages enable contract-to-contract communication, allowing complex applications to be built from multiple interacting contracts rather than monolithic programs.

The gas mechanism is crucial for preventing abuse: every computational step, storage operation, and data byte in a transaction consumes gas. If a transaction runs out of gas before completing, all state changes are reverted (except the gas payment to the miner), preventing infinite loops or excessive computation from grinding the network to a halt. The sender specifies both the total gas budget (STARTGAS) and the price they're willing to pay per unit (GASPRICE), and any unused gas is refunded after execution completes.

Messages and Transactions

ธุรกรรมใน Ethereum เป็นแพ็คเกจข้อมูลที่ลงนามซึ่งสร้างโดยบัญชีที่เป็นเจ้าของภายนอกและออกอากาศไปยังเครือข่าย ธุรกรรมประกอบด้วยที่อยู่ผู้รับ ลายเซ็นเข้ารหัสที่พิสูจน์ตัวตนของผู้ส่ง จำนวนอีเทอร์ที่จะถ่ายโอน ช่องข้อมูลเสริม (สำคัญสำหรับการโต้ตอบกับสัญญา) STARTGAS (จำนวนขั้นตอนการคำนวณสูงสุดที่ธุรกรรมได้รับอนุญาตให้ทำ) และ GASPRICE (ค่าธรรมเนียมต่อขั้นตอนการคำนวณที่ผู้ส่งยินดีจ่าย) นักขุดรวบรวมธุรกรรมเหล่านี้ ตรวจสอบ ดำเนินการ และรวมไว้ในบล็อก โดยรับค่าธรรมเนียมก๊าซเป็นการชดเชย

ข้อความมีแนวคิดคล้ายกับธุรกรรม แต่จัดทำโดยสัญญามากกว่าผู้แสดงภายนอก เมื่อโค้ดของสัญญาดำเนินการ จะสามารถส่งข้อความไปยังสัญญาอื่นได้ ข้อความภายในเหล่านี้ประกอบด้วยผู้ส่ง (ที่อยู่ของสัญญา) ผู้รับ จำนวนอีเธอร์ที่จะถ่ายโอน เพย์โหลดข้อมูลเสริม และขีดจำกัด STARTGAS ข้อความช่วยให้สามารถสื่อสารตามสัญญาต่อสัญญาได้ ทำให้สามารถสร้างแอปพลิเคชันที่ซับซ้อนได้จากสัญญาที่มีการโต้ตอบหลายสัญญา แทนที่จะเป็นโปรแกรมแบบเสาหิน

กลไกของแก๊สมีความสำคัญอย่างยิ่งในการป้องกันการละเมิด: ทุกขั้นตอนการคำนวณ การดำเนินการจัดเก็บ และไบต์ข้อมูลในธุรกรรมต้องใช้แก๊ส หากธุรกรรมหมดก๊าซก่อนที่จะเสร็จสิ้น การเปลี่ยนแปลงสถานะทั้งหมดจะถูกคืนค่า (ยกเว้นการจ่ายก๊าซให้กับผู้ขุด) ป้องกันไม่ให้ลูปไม่สิ้นสุดหรือการคำนวณมากเกินไปทำให้เครือข่ายหยุดชะงัก ผู้ส่งระบุทั้งงบประมาณก๊าซทั้งหมด (STARTGAS) และราคาที่พวกเขายินดีจ่ายต่อหน่วย (GASPRICE) และก๊าซที่ไม่ได้ใช้จะได้รับคืนหลังจากการดำเนินการเสร็จสิ้น

Ethereum State Transition Function

The Ethereum state transition function APPLY(S,TX) - S' defines how a transaction transforms the blockchain state, and it follows a precise sequence of steps. First, the system checks transaction validity: verifying the signature is correct, confirming the nonce matches the sender's account nonce, and ensuring the sender has sufficient balance to pay the upfront cost (STARTGAS × GASPRICE plus the value being sent). If any check fails, the transaction is rejected before execution begins. If valid, the transaction fee is deducted from the sender's account, the sender's nonce is incremented, and an initial gas counter is set to STARTGAS minus a per-byte fee for the transaction data.

Ethereum state transition function showing gas deduction value transfer and code execution

Next, the system transfers the specified ether value from the sender to the recipient. If the recipient is an externally owned account, this completes the transaction. If the recipient is a contract account, the contract's code runs in the Ethereum Virtual Machine, consuming gas for each operation until either the code completes successfully, the code explicitly halts, or the gas runs out. During execution, the contract can read and modify its storage, send messages to other contracts, and create new contracts.

Finally, if the value transfer failed (insufficient balance) or code execution failed (running out of gas or hitting an error), all state changes are reverted—except that the sender still pays gas fees to the miner for the computation performed. If execution succeeded, the remaining gas is refunded to the sender, and the gas that was consumed is sent to the miner as a fee. This mechanism ensures that miners are compensated for computation while preventing runaway execution from consuming unbounded resources.

Ethereum State Transition Function

ฟังก์ชันการเปลี่ยนสถานะ Ethereum ใช้(S,TX) - S' กำหนดวิธีที่ธุรกรรมแปลงสถานะบล็อกเชน และเป็นไปตามลำดับขั้นตอนที่แม่นยำ ขั้นแรก ระบบจะตรวจสอบความถูกต้องของธุรกรรม: การตรวจสอบความถูกต้องของลายเซ็น การยืนยัน nonce ตรงกับบัญชี nonce ของผู้ส่ง และทำให้มั่นใจว่าผู้ส่งมียอดคงเหลือเพียงพอที่จะชำระค่าใช้จ่ายล่วงหน้า (STARTGAS × GASPRICE บวกมูลค่าที่ส่ง) หากการตรวจสอบล้มเหลว ธุรกรรมจะถูกปฏิเสธก่อนเริ่มดำเนินการ หากถูกต้อง การทำธุรกรรม">ค่าธรรมเนียมการทำธุรกรรมจะถูกหักออกจากบัญชีของผู้ส่ง nonce ของผู้ส่งจะเพิ่มขึ้น และตัวนับก๊าซเริ่มต้นจะถูกตั้งค่าเป็น STARTGAS ลบค่าธรรมเนียมต่อไบต์สำหรับข้อมูลธุรกรรม

Ethereum state transition function showing gas deduction value transfer and code execution

จากนั้นระบบจะโอนค่าอีเธอร์ที่ระบุจากผู้ส่งไปยังผู้รับ หากผู้รับเป็นบัญชีภายนอก การทำธุรกรรมจะเสร็จสมบูรณ์ หากผู้รับเป็นบัญชีสัญญา รหัสของสัญญาจะทำงานใน Ethereum Virtual Machine ซึ่งใช้แก๊สในการดำเนินการแต่ละครั้งจนกว่ารหัสจะเสร็จสมบูรณ์สำเร็จ รหัสหยุดลงอย่างชัดเจน หรือแก๊สหมด ในระหว่างการดำเนินการ สัญญาสามารถอ่านและแก้ไขพื้นที่เก็บข้อมูล ส่งข้อความไปยังสัญญาอื่น และสร้างสัญญาใหม่ได้

สุดท้ายนี้ หากการถ่ายโอนค่าล้มเหลว (ยอดคงเหลือไม่เพียงพอ) หรือการดำเนินการโค้ดล้มเหลว (แก๊สหมดหรือเกิดข้อผิดพลาด) การเปลี่ยนแปลงสถานะทั้งหมดจะถูกคืนกลับ ยกเว้นว่าผู้ส่งยังคงจ่ายค่าธรรมเนียมก๊าซให้กับนักขุดสำหรับการคำนวณที่ดำเนินการ หากการดำเนินการสำเร็จ ก๊าซที่เหลือจะถูกคืนให้กับผู้ส่ง และก๊าซที่ใช้ไปจะถูกส่งไปยังนักขุดโดยมีค่าธรรมเนียม กลไกนี้ช่วยให้แน่ใจว่านักขุดได้รับการชดเชยสำหรับการคำนวณ ในขณะเดียวกันก็ป้องกันการดำเนินการแบบควบคุมไม่ได้จากการใช้ทรัพยากรที่ไม่จำกัด

Code Execution

The Ethereum Virtual Machine (EVM) is the runtime environment where contract code executes—a low-level, stack-based virtual machine similar in concept to the Java Virtual Machine or WebAssembly. Contract code is stored as a sequence of bytes, where each byte represents an operation (opcode) that the EVM can execute. The execution model is deliberately simple and deterministic: every node running the EVM with the same input state and transaction must arrive at the same output state, ensuring consensus across the network.

The EVM provides three distinct types of storage for computation. The stack is a last-in-first-out (LIFO) structure limited to 1024 elements, used for immediate operation values. Memory is an infinitely expandable byte array that persists only for the duration of a single message call and is reset between executions. Storage is the persistent key-value store permanently associated with each account/" class="glossary-link" data-slug="contract-account" title="contract account">contract account, where contracts maintain their long-term state across transactions. These storage types are priced differently in gas—stack and memory operations are cheap, while storage operations are expensive to prevent blockchain bloat.

During execution, contract code has access to crucial context: it can read the message sender's address, the amount of ether sent, the data payload provided by the caller, and block-level properties like the current block number, timestamp, and miner address. The code can return an output byte array to the caller and can send messages to other contracts or create new contracts. This execution model is Turing-complete—loops and complex control flow are possible—but the gas mechanism ensures that all computation terminates in bounded time, solving the halting problem economically rather than through language restrictions.

Code Execution

Ethereum Virtual Machine (EVM) คือสภาพแวดล้อมรันไทม์ที่โค้ดสัญญาดำเนินการ ซึ่งเป็นเครื่องเสมือนแบบสแต็กระดับต่ำซึ่งมีแนวคิดคล้ายกับ Java Virtual Machine หรือ WebAssembly รหัสสัญญาจะถูกจัดเก็บเป็นลำดับไบต์ โดยแต่ละไบต์แสดงถึงการดำเนินการ (opcode) ที่ EVM สามารถดำเนินการได้ โมเดลการดำเนินการนั้นจงใจเรียบง่ายและกำหนดไว้ได้: ทุกโหนดที่ใช้งาน EVM ด้วยสถานะอินพุตและธุรกรรมเดียวกันจะต้องมาถึงที่สถานะเอาต์พุตเดียวกัน เพื่อให้แน่ใจว่าได้รับความเห็นพ้องต้องกันทั่วทั้งเครือข่าย

EVM มีพื้นที่จัดเก็บข้อมูลสามประเภทที่แตกต่างกันสำหรับการคำนวณ สแต็กเป็นโครงสร้างเข้าก่อนออกก่อน (LIFO) ซึ่งจำกัดอยู่ที่ 1,024 องค์ประกอบ ซึ่งใช้สำหรับค่าการดำเนินการทันที หน่วยความจำคืออาร์เรย์ไบต์ที่ขยายได้ไม่จำกัด ซึ่งจะคงอยู่ในช่วงเวลาของการเรียกข้อความเดียวเท่านั้น และจะถูกรีเซ็ตระหว่างการประมวลผล พื้นที่จัดเก็บข้อมูลคือการจัดเก็บคีย์-ค่าถาวรที่เชื่อมโยงอย่างถาวรกับบัญชีสัญญา">บัญชีสัญญาแต่ละบัญชี โดยที่สัญญาจะรักษาสถานะระยะยาวของธุรกรรมต่างๆ ประเภทพื้นที่จัดเก็บข้อมูลเหล่านี้มีราคาแตกต่างกันในการดำเนินการแบบแก๊ส สแต็กและการดำเนินการหน่วยความจำมีราคาถูก ในขณะที่การดำเนินการพื้นที่จัดเก็บข้อมูลมีราคาแพงเพื่อป้องกันการบวมของบล็อกเชน">บล็อกเชน

ในระหว่างการดำเนินการ รหัสสัญญาจะสามารถเข้าถึงบริบทที่สำคัญได้: สามารถอ่านที่อยู่ของผู้ส่งข้อความ จำนวนอีเทอร์ที่ส่ง เพย์โหลดข้อมูลที่ผู้โทรให้มา และคุณสมบัติระดับบล็อก เช่น หมายเลขบล็อกปัจจุบัน การประทับเวลา และที่อยู่ของนักขุด รหัสสามารถส่งคืนอาร์เรย์ไบต์เอาท์พุตไปยังผู้เรียกและสามารถส่งข้อความไปยังสัญญาอื่นหรือสร้างสัญญาใหม่ได้ โมเดลการดำเนินการนี้เป็นแบบทัวริงที่สมบูรณ์ โดยสามารถวนลูปและโฟลว์การควบคุมที่ซับซ้อนได้ แต่กลไกของแก๊สช่วยให้มั่นใจได้ว่าการคำนวณทั้งหมดยุติในเวลาที่กำหนด แก้ปัญหาการหยุดชะงักในเชิงเศรษฐกิจ แทนที่จะใช้ข้อจำกัดด้านภาษา

Blockchain and Mining

The Ethereum blockchain is fundamentally similar to Bitcoin's, serving as a database containing every transaction ever executed. However, while Bitcoin stores only a transaction list, Ethereum stores both the transaction list and the most recent state. Each block in Ethereum contains the previous block's hash, a state root (the root hash of the Patricia trie">Merkle Patricia trie representing the entire state), a transaction root, a receipt root (storing data from transaction execution), along with difficulty, timestamp, and nonce values. The state itself is a large Merkle Patricia trie mapping addresses to account objects, where each account has a balance, nonce, code (if present), and storage.

Ethereum APPLY BLOCK function processing transactions and updating state

Ethereum uses a modified version of the GHOST (Greedy Heaviest Observed Subtree) protocol to address security issues that arise from fast block times. In traditional longest-chain protocols, fast blocks lead to high stale rates, reducing network security and increasing centralization risks as large miners waste less computation on stales. GHOST includes stale blocks (called "uncles" in Ethereum) in the calculation of which chain is longest, and provides partial rewards to uncle blocks, incentivizing miners to reference them. This allows Ethereum to maintain a target block time of approximately 12 seconds while preserving network security.

The mining algorithm works similarly to Bitcoin's proof-of-work, requiring miners to find a nonce such that the hash of the block is below a certain difficulty target. However, Ethereum's memory-hard mining algorithm (Ethash) is designed to be ASIC-resistant, promoting a more decentralized mining ecosystem. The difficulty adjusts dynamically based on block times to maintain the ~12 second target, ensuring consistent block production while the GHOST protocol provides security guarantees despite the faster block times compared to Bitcoin's 10-minute average.

Blockchain and Mining

บล็อกเชน">บล็อกเชน Ethereum มีพื้นฐานคล้ายคลึงกับ Bitcoin โดยทำหน้าที่เป็นฐานข้อมูลที่รวบรวมทุกธุรกรรมที่เคยดำเนินการ อย่างไรก็ตาม แม้ว่า Bitcoin จะจัดเก็บเฉพาะรายการธุรกรรม แต่ Ethereum จะจัดเก็บทั้งรายการธุรกรรมและสถานะล่าสุด แต่ละบล็อกใน Ethereum ประกอบด้วยแฮชของบล็อกก่อนหน้า สถานะรูท (แฮชรูทของ Merkle Patricia trie ที่เป็นตัวแทนของสถานะทั้งหมด) รูทของธุรกรรม รูทการรับ (จัดเก็บข้อมูลจากการดำเนินการของธุรกรรม) พร้อมด้วยความยาก การประทับเวลา และค่า nonce รัฐนั้นเป็น Merkle Patricia ขนาดใหญ่ที่พยายามแมปที่อยู่กับออบเจ็กต์บัญชี โดยที่แต่ละบัญชีมียอดคงเหลือ nonce รหัส (ถ้ามี) และพื้นที่เก็บข้อมูล

Ethereum APPLY BLOCK function processing transactions and updating state

Ethereum ใช้เวอร์ชันแก้ไขของโปรโตคอล GHOST (Greedy Heaviest Observed Subtree) เพื่อแก้ไขปัญหาด้านความปลอดภัยที่เกิดจากเวลาบล็อกที่รวดเร็ว ในโปรโตคอลแบบสายโซ่ที่ยาวที่สุดแบบดั้งเดิม การบล็อกที่รวดเร็วทำให้เกิดอัตราการเก่าสูง ลดความปลอดภัยของเครือข่าย และเพิ่มความเสี่ยงจากการรวมศูนย์ เนื่องจากนักขุดรายใหญ่เสียการประมวลผลที่เก่าน้อยลง GHOST รวมบล็อกเก่า (เรียกว่า "ลุง" ใน Ethereum) ในการคำนวณว่าเชนใดยาวที่สุด และมอบรางวัลบางส่วนให้กับบล็อกลุง จูงใจนักขุดให้อ้างอิงถึงบล็อกเหล่านั้น ซึ่งช่วยให้ Ethereum สามารถรักษาเวลาบล็อกเป้าหมายได้ประมาณ 12 วินาที โดยยังคงรักษาความปลอดภัยของเครือข่ายไว้

อัลกอริธึมการขุดทำงานคล้ายกับ proof-of-work ของ Bitcoin โดยกำหนดให้นักขุดค้นหา nonce เพื่อให้แฮชของบล็อกอยู่ต่ำกว่าเป้าหมายความยากที่แน่นอน อย่างไรก็ตาม อัลกอริธึมการขุดด้วยหน่วยความจำอย่างหนัก (Ethash) ของ Ethereum ได้รับการออกแบบมาให้ทนทานต่อ ASIC โดยส่งเสริมระบบนิเวศการขุดแบบกระจายอำนาจมากขึ้น ความยากจะปรับเปลี่ยนแบบไดนามิกตามเวลาบล็อกเพื่อรักษาเป้าหมาย ~12 วินาที เพื่อให้มั่นใจว่าการผลิตบล็อกมีความสม่ำเสมอ ในขณะที่โปรโตคอล GHOST ให้การรับประกันความปลอดภัย แม้ว่าเวลาบล็อกจะเร็วกว่าเมื่อเทียบกับค่าเฉลี่ย 10 นาทีของ Bitcoin

Applications

The applications that can be built on Ethereum fall into three broad categories. The first category is financial applications, providing users with more powerful ways to manage and enter contracts involving their money. This includes sub-currencies, financial derivatives, hedging contracts, savings wallets with withdrawal limits, wills that distribute funds automatically, and even employment contracts that calculate payment based on verified work completion. These applications leverage Ethereum's programmability to create complex financial instruments that would be impossible or extremely difficult to implement in traditional systems or even on Bitcoin.

The second category is semi-financial applications, where money is involved but there is also a substantial non-monetary component to what is being done. A perfect example is self-enforcing bounties for solutions to computational problems. Someone could post a computational problem along with a reward, and the contract could automatically verify submitted solutions and pay out the bounty to the first correct answer. This category bridges pure finance and other domains, using economic incentives to solve problems or coordinate behavior.

The third category is applications that have nothing to do with money at all, such as online voting and decentralized governance systems. These non-financial applications demonstrate Ethereum's flexibility as a general-purpose platform. Examples include decentralized domain name systems like Namecoin, reputation systems, decentralized file storage, and organizational governance tools. Of all these application types, token systems have emerged as the most common and fundamental, serving as building blocks for many other applications.

Applications

แอปพลิเคชันที่สามารถสร้างได้บน Ethereum แบ่งออกเป็นสามประเภทกว้างๆ หมวดหมู่แรกคือแอปพลิเคชันทางการเงิน ที่ให้วิธีที่มีประสิทธิภาพมากขึ้นแก่ผู้ใช้ในการจัดการและเข้าทำสัญญาที่เกี่ยวข้องกับเงินของพวกเขา ซึ่งรวมถึงสกุลเงินย่อย อนุพันธ์ทางการเงิน สัญญาป้องกันความเสี่ยง กระเป๋าเงินออมที่มีขีดจำกัดการถอน พินัยกรรมที่กระจายเงินโดยอัตโนมัติ และแม้แต่สัญญาการจ้างงานที่คำนวณการชำระเงินตามความสำเร็จของงานที่ตรวจสอบแล้ว แอปพลิเคชันเหล่านี้ใช้ประโยชน์จากความสามารถในการตั้งโปรแกรมของ Ethereum เพื่อสร้างเครื่องมือทางการเงินที่ซับซ้อนซึ่งเป็นไปไม่ได้หรือยากอย่างยิ่งที่จะนำไปใช้ในระบบดั้งเดิมหรือแม้แต่บน Bitcoin

ประเภทที่สองคือการสมัครกึ่งการเงิน ซึ่งเกี่ยวข้องกับเงิน แต่ก็มีองค์ประกอบที่ไม่เป็นตัวเงินที่สำคัญสำหรับสิ่งที่กำลังทำอยู่ ตัวอย่างที่สมบูรณ์แบบคือการบังคับใช้ค่าหัวด้วยตนเองสำหรับการแก้ปัญหาทางคอมพิวเตอร์ บางคนสามารถโพสต์ปัญหาด้านการคำนวณพร้อมกับรางวัล และสัญญาสามารถตรวจสอบวิธีแก้ปัญหาที่ส่งมาได้โดยอัตโนมัติ และจ่ายเงินรางวัลให้กับคำตอบที่ถูกต้องคนแรก หมวดหมู่นี้เชื่อมโยงการเงินที่บริสุทธิ์และโดเมนอื่นๆ โดยใช้สิ่งจูงใจทางเศรษฐกิจเพื่อแก้ไขปัญหาหรือประสานพฤติกรรม

หมวดหมู่ที่สามคือแอปพลิเคชันที่ไม่เกี่ยวข้องกับเงินเลย เช่น การลงคะแนนออนไลน์ และระบบการกำกับดูแลแบบกระจายอำนาจ แอปพลิเคชันที่ไม่ใช่ทางการเงินเหล่านี้แสดงให้เห็นถึงความยืดหยุ่นของ Ethereum ในฐานะแพลตฟอร์มอเนกประสงค์ ตัวอย่างได้แก่ ระบบชื่อโดเมนแบบกระจายอำนาจ เช่น Namecoin ระบบชื่อเสียง พื้นที่จัดเก็บไฟล์แบบกระจายอำนาจ และเครื่องมือการกำกับดูแลองค์กร ในบรรดาแอปพลิเคชันประเภทเหล่านี้ ระบบโทเค็นได้กลายเป็นระบบพื้นฐานและเป็นพื้นฐานที่สุด โดยทำหน้าที่เป็นองค์ประกอบหลักสำหรับแอปพลิเคชันอื่นๆ มากมาย

Token Systems

Token systems are surprisingly straightforward to implement on Ethereum, despite being one of the most powerful and common applications. At their core, token systems are simply a database with a single operation: subtract X units from account A and add X units to account B, with the condition that A had at least X units before the transaction and the transaction is authorized by A. The implementation requires maintaining a mapping of addresses to balances and providing a transfer function that performs the appropriate checks before moving tokens between accounts.

The contract code for a basic token system is remarkably simple and can be written in just a few lines. It consists of a data structure mapping addresses to balances, an initialization function that assigns initial token supply, and a transfer function that checks the sender's balance and authorization before executing the transfer. This simplicity stands in stark contrast to the complexity required to implement similar systems on Bitcoin, which would require significant workarounds and limitations due to Bitcoin's restricted scripting capabilities.

Tokens on Ethereum can represent virtually anything of value. They might represent sub-currencies with their own monetary policies, financial derivatives tracking external assets, company shares with dividend rights, loyalty points in customer programs, commodities like gold or oil, or even representations of physical property. The programmability of Ethereum allows these tokens to have arbitrary rules governing their behavior, such as transfer restrictions, automatic burning mechanisms, dividend distributions, or governance rights. This flexibility has made token systems the foundational building block for much of the Ethereum ecosystem.

Token Systems

ระบบโทเค็นนั้นตรงไปตรงมาอย่างน่าประหลาดใจที่จะนำไปใช้กับ Ethereum แม้จะเป็นหนึ่งในแอปพลิเคชันที่ทรงพลังและธรรมดาที่สุดก็ตาม ที่แกนหลัก ระบบโทเค็นเป็นเพียงฐานข้อมูลที่มีการดำเนินการเพียงครั้งเดียว: ลบหน่วย X ออกจากบัญชี A และเพิ่มหน่วย X ไปยังบัญชี B โดยมีเงื่อนไขว่า A มีหน่วยอย่างน้อย X ก่อนการทำธุรกรรมและธุรกรรมได้รับอนุญาตจาก A การนำไปใช้งานจำเป็นต้องมีการดูแลรักษาการแมปที่อยู่เพื่อสร้างยอดคงเหลือ และจัดเตรียมฟังก์ชันการถ่ายโอนที่ดำเนินการตรวจสอบที่เหมาะสมก่อนที่จะย้ายโทเค็นระหว่างบัญชี

รหัสสัญญาสำหรับระบบโทเค็นพื้นฐานนั้นเรียบง่ายอย่างน่าทึ่งและสามารถเขียนได้เพียงไม่กี่บรรทัด ประกอบด้วยที่อยู่การจับคู่โครงสร้างข้อมูลกับยอดคงเหลือ ฟังก์ชันการเริ่มต้นที่กำหนดการจ่ายโทเค็นเริ่มต้น และฟังก์ชันการถ่ายโอนที่จะตรวจสอบยอดคงเหลือและการอนุญาตของผู้ส่งก่อนดำเนินการถ่ายโอน ความเรียบง่ายนี้แตกต่างโดยสิ้นเชิงกับความซับซ้อนที่จำเป็นในการใช้งานระบบที่คล้ายกันบน Bitcoin ซึ่งจะต้องใช้วิธีแก้ปัญหาและข้อจำกัดที่สำคัญ เนื่องจากความสามารถในการเขียนสคริปต์ที่จำกัดของ Bitcoin

โทเค็นบน Ethereum สามารถเป็นตัวแทนอะไรก็ได้ที่มีมูลค่า ซึ่งอาจเป็นตัวแทนของสกุลเงินย่อยที่มีนโยบายการเงินของตนเอง อนุพันธ์ทางการเงินที่ติดตามสินทรัพย์ภายนอก หุ้นบริษัทที่มีสิทธิ์ในการจ่ายเงินปันผล คะแนนความภักดีในโปรแกรมของลูกค้า สินค้าโภคภัณฑ์ เช่น ทองคำหรือน้ำมัน หรือแม้แต่การนำเสนอทรัพย์สินทางกายภาพ ความสามารถในการตั้งโปรแกรมของ Ethereum ช่วยให้โทเค็นเหล่านี้มีกฎที่กำหนดเองซึ่งควบคุมพฤติกรรม เช่น ข้อจำกัดในการโอน กลไกการเบิร์นอัตโนมัติ การจ่ายเงินปันผล หรือสิทธิ์ในการกำกับดูแล ความยืดหยุ่นนี้ทำให้ระบบโทเค็นเป็นองค์ประกอบพื้นฐานสำหรับระบบนิเวศส่วนใหญ่ของ Ethereum

Financial Derivatives and Stable-Value Currencies

Financial derivatives represent one of the most fundamental and important applications of Ethereum smart contracts. A simple hedging contract demonstrates the basic mechanism: party A deposits a certain amount of ether worth \(1000, party B deposits an equivalent amount, and the contract records the USD value of ether at that moment using a data feed. After 30 days, the contract recalculates the value and sends ether worth \)1000 to A and the remainder to B. If the price of ether has risen, A receives fewer ether but maintains $1000 value; if it has fallen, A receives more ether to maintain that value. This allows A to hedge against volatility while B speculates on price movements.

The implementation of such contracts requires access to external data through oracle contracts or data feeds. These oracles provide price information, weather data, or other real-world information that contracts need to execute properly. While oracles introduce a trust dependency, they can be designed with redundancy and cryptoeconomic incentives to provide reliable data. The contract itself simply queries the oracle, performs calculations based on that data, and distributes funds according to its programmed logic.

Stablecoins and more complex financial instruments can be built using similar mechanisms. A stablecoin contract might maintain a reserve of ether and issue tokens pegged to a fiat currency, automatically adjusting supply or collateral requirements based on price feeds. Options contracts, futures, swaps, and other derivatives that would normally require complex legal frameworks and trusted intermediaries can instead be encoded as self-executing smart contracts. This programmable finance infrastructure enables sophisticated financial engineering while maintaining the transparency and security guarantees of blockchain technology.

Financial Derivatives and Stable-Value Currencies

อนุพันธ์ทางการเงินเป็นหนึ่งในการใช้งานพื้นฐานและสำคัญที่สุดของสัญญาอัจฉริยะ Ethereum สัญญาป้องกันความเสี่ยงแบบง่ายๆ สาธิตกลไกพื้นฐาน: ฝ่าย A ฝากเงินอีเทอร์จำนวนหนึ่งมูลค่า 1,000 ดอลลาร์ ฝ่าย B ฝากเงินในจำนวนที่เท่ากัน และสัญญาจะบันทึกมูลค่าอีเทอร์ USD ในขณะนั้นโดยใช้ฟีดข้อมูล หลังจากผ่านไป 30 วัน สัญญาจะคำนวณมูลค่าใหม่และส่งอีเทอร์มูลค่า 1,000 ดอลลาร์ให้กับ A และส่วนที่เหลือให้กับ B หากราคาของอีเทอร์เพิ่มขึ้น A จะได้รับอีเทอร์น้อยลงแต่จะคงมูลค่า 1,000 ดอลลาร์ไว้ ถ้ามันตกลงไป A จะได้รับอีเธอร์มากขึ้นเพื่อรักษามูลค่านั้น สิ่งนี้ทำให้ A ป้องกันความเสี่ยงจากความผันผวน ในขณะที่ B เก็งกำไรจากการเคลื่อนไหวของราคา

การดำเนินการตามสัญญาดังกล่าวจำเป็นต้องมีการเข้าถึงข้อมูลภายนอกผ่านสัญญาของ Oracle หรือฟีดข้อมูล ออราเคิลเหล่านี้ให้ข้อมูลราคา ข้อมูลสภาพอากาศ หรือข้อมูลในโลกแห่งความเป็นจริงอื่นๆ ที่สัญญาจำเป็นต้องดำเนินการอย่างถูกต้อง แม้ว่า Oracles จะแนะนำการพึ่งพาความน่าเชื่อถือ แต่ก็สามารถออกแบบโดยมีความซ้ำซ้อนและแรงจูงใจทางเศรษฐกิจแบบเข้ารหัสเพื่อให้ข้อมูลที่เชื่อถือได้ สัญญาเพียงสอบถาม Oracle ทำการคำนวณตามข้อมูลนั้น และกระจายเงินทุนตามตรรกะที่ตั้งโปรแกรมไว้

Stablecoins และเครื่องมือทางการเงินที่ซับซ้อนมากขึ้นสามารถสร้างได้โดยใช้กลไกที่คล้ายกัน สัญญา Stablecoin อาจรักษาปริมาณสำรองของ Ether และออกโทเค็นที่ผูกกับสกุลเงินคำสั่ง โดยจะปรับข้อกำหนดด้านอุปทานหรือหลักประกันโดยอัตโนมัติตามฟีดราคา สัญญาออปชั่น ฟิวเจอร์ส สวอป และอนุพันธ์อื่นๆ ที่ปกติต้องใช้กรอบกฎหมายที่ซับซ้อนและตัวกลางที่เชื่อถือได้ สามารถเข้ารหัสเป็นสัญญาอัจฉริยะที่ดำเนินการด้วยตนเองแทนได้ โครงสร้างพื้นฐานทางการเงินที่ตั้งโปรแกรมได้นี้ช่วยให้วิศวกรรมทางการเงินมีความซับซ้อน ในขณะเดียวกันก็รักษาความโปร่งใสและการรับประกันความปลอดภัยของเทคโนโลยีบล็อคเชน

Identity and Reputation Systems

A name registration system similar to Namecoin is trivially implementable on Ethereum and serves as the simplest example of an identity system. The contract maintains a database with a key-value table mapping names to associated data (such as IP addresses, public keys, or other information). Anyone can register a name by sending a transaction to the contract along with a small registration fee, provided that name is not already taken. The owner can update the associated data at any time, and names can be made transferable or permanent according to the rules encoded in the contract.

More advanced identity systems can be built on this foundation to include reputation scores, web of trust relationships, and decentralized identity verification. For example, a contract could maintain reputation scores based on verified transactions, peer ratings, or completion of tasks. These scores would be publicly visible and cryptographically tied to specific addresses, creating a portable reputation that follows users across applications. Web of trust systems could allow users to vouch for others' identities, building social graphs that help distinguish legitimate users from bad actors.

Such identity and reputation systems become particularly powerful when integrated with other applications. A marketplace could require minimum reputation scores for sellers, a loan platform could adjust interest rates based on borrower reputation, or a social network could use web of trust to filter spam and fraudulent content. By providing a shared infrastructure for identity that any application can query, Ethereum enables a new class of trust-based applications that don't rely on centralized identity providers or proprietary reputation systems.

Identity and Reputation Systems

ระบบการลงทะเบียนชื่อที่คล้ายกับ Namecoin สามารถนำไปใช้ได้เพียงเล็กน้อยบน Ethereum และทำหน้าที่เป็นตัวอย่างที่ง่ายที่สุดของระบบการระบุตัวตน สัญญาจะดูแลรักษาฐานข้อมูลที่มีชื่อการแมปตารางคีย์-ค่ากับข้อมูลที่เกี่ยวข้อง (เช่น ที่อยู่ IP คีย์สาธารณะ หรือข้อมูลอื่นๆ) ใครๆ ก็สามารถลงทะเบียนชื่อได้โดยส่งธุรกรรมไปยังสัญญาพร้อมกับค่าธรรมเนียมการลงทะเบียนเล็กน้อย โดยที่ชื่อนั้นยังไม่ได้ถูกนำไปใช้ เจ้าของสามารถอัปเดตข้อมูลที่เกี่ยวข้องได้ตลอดเวลา และชื่อสามารถโอนหรือถาวรได้ตามกฎที่เข้ารหัสในสัญญา

คุณสามารถสร้างระบบการระบุตัวตนขั้นสูงเพิ่มเติมบนรากฐานนี้เพื่อรวมคะแนนชื่อเสียง เว็บของความสัมพันธ์ที่ไว้วางใจ และการยืนยันตัวตนแบบกระจายอำนาจ ตัวอย่างเช่น สัญญาสามารถรักษาคะแนนชื่อเสียงตามธุรกรรมที่ตรวจสอบแล้ว การให้คะแนนโดยผู้ทรงคุณวุฒิ หรือความสมบูรณ์ของงาน คะแนนเหล่านี้จะเปิดเผยต่อสาธารณะและเชื่อมโยงกับที่อยู่เฉพาะด้วยการเข้ารหัส ทำให้เกิดชื่อเสียงแบบพกพาที่ติดตามผู้ใช้ทั่วทั้งแอปพลิเคชัน เว็บของระบบความน่าเชื่อถือสามารถอนุญาตให้ผู้ใช้รับรองตัวตนของผู้อื่น โดยสร้างกราฟทางสังคมที่ช่วยแยกแยะผู้ใช้ที่ถูกกฎหมายออกจากผู้ไม่ประสงค์ดี

ระบบการระบุตัวตนและชื่อเสียงดังกล่าวจะมีประสิทธิภาพเป็นพิเศษเมื่อรวมเข้ากับแอปพลิเคชันอื่นๆ ตลาดอาจต้องมีคะแนนชื่อเสียงขั้นต่ำสำหรับผู้ขาย แพลตฟอร์มสินเชื่อสามารถปรับอัตราดอกเบี้ยตามชื่อเสียงของผู้ยืม หรือเครือข่ายโซเชียลอาจใช้เว็บแห่งความไว้วางใจเพื่อกรองสแปมและเนื้อหาที่ฉ้อโกง ด้วยการจัดหาโครงสร้างพื้นฐานที่ใช้ร่วมกันสำหรับข้อมูลระบุตัวตนที่แอปพลิเคชันใดๆ สามารถตรวจสอบได้ Ethereum จึงเปิดใช้งานแอปพลิเคชันที่อิงความน่าเชื่อถือระดับใหม่ซึ่งไม่ต้องพึ่งพาผู้ให้บริการข้อมูลประจำตัวแบบรวมศูนย์หรือระบบชื่อเสียงที่เป็นกรรมสิทธิ์

Decentralized File Storage

Decentralized file storage can be implemented through Ethereum contracts that coordinate between users who need storage and providers who offer it. In a "decentralized Dropbox" model, users would pay a monthly fee to upload files, with the contract distributing payments to storage providers who prove they are actually storing the data. The proof mechanism works through periodic cryptographic challenges: the contract randomly selects portions of files and asks providers to supply Merkle tree proofs demonstrating they possess that data. Providers who fail challenges or go offline would lose their deposits and future payment stream.

This approach offers several advantages over centralized storage. Merkle tree proofs enable efficient verification—users and the contract can confirm file availability without downloading entire files. The system naturally distributes files across multiple independent providers, creating redundancy without requiring explicit replication protocols. Economic incentives align provider behavior with user needs: providers earn money by reliably storing data and lose money if they fail to do so. This eliminates the trust requirement inherent in centralized storage solutions.

Storage costs in such a system can potentially be lower than centralized alternatives for several reasons. The elimination of monopoly pricing allows market competition to drive costs down to near the actual cost of storage. Implicit redundancy from multiple users storing similar files can reduce total storage requirements. There's no need for expensive data center infrastructure or corporate overhead. However, challenges remain around payment mechanisms, ensuring adequate provider participation, and managing the tradeoff between redundancy and cost. Despite these challenges, decentralized storage demonstrates how Ethereum can coordinate complex multi-party interactions through economic incentives alone.

Decentralized File Storage

พื้นที่จัดเก็บไฟล์แบบกระจายอำนาจสามารถดำเนินการผ่านสัญญา Ethereum ที่ประสานงานระหว่างผู้ใช้ที่ต้องการพื้นที่เก็บข้อมูลและผู้ให้บริการที่เสนอพื้นที่ดังกล่าว ในรูปแบบ "Dropbox แบบกระจายอำนาจ" ผู้ใช้จะต้องจ่ายค่าธรรมเนียมรายเดือนในการอัพโหลดไฟล์ โดยสัญญาจะกระจายการชำระเงินให้กับผู้ให้บริการพื้นที่จัดเก็บข้อมูลที่พิสูจน์ได้ว่าพวกเขากำลังจัดเก็บข้อมูลอยู่จริง กลไกการพิสูจน์ทำงานผ่านความท้าทายในการเข้ารหัสเป็นระยะ: สัญญาจะสุ่มเลือกส่วนของไฟล์และขอให้ผู้ให้บริการจัดหาการพิสูจน์ต้นไม้ของ Merkle เพื่อแสดงให้เห็นว่าพวกเขามีข้อมูลนั้น ผู้ให้บริการที่ล้มเหลวในการท้าทายหรือออฟไลน์จะสูญเสียเงินฝากและกระแสการชำระเงินในอนาคต

วิธีการนี้มีข้อดีหลายประการเหนือการจัดเก็บข้อมูลแบบรวมศูนย์ การพิสูจน์ต้นไม้ของ Merkle ช่วยให้การตรวจสอบมีประสิทธิภาพ—ผู้ใช้และสัญญาสามารถยืนยันความพร้อมใช้งานของไฟล์ได้โดยไม่ต้องดาวน์โหลดไฟล์ทั้งหมด ระบบจะกระจายไฟล์ไปยังผู้ให้บริการอิสระหลายรายอย่างเป็นธรรมชาติ สร้างความซ้ำซ้อนโดยไม่ต้องใช้โปรโตคอลการจำลองแบบที่ชัดเจน สิ่งจูงใจทางเศรษฐกิจปรับพฤติกรรมของผู้ให้บริการให้สอดคล้องกับความต้องการของผู้ใช้: ผู้ให้บริการสร้างรายได้จากการจัดเก็บข้อมูลที่เชื่อถือได้ และสูญเสียเงินหากไม่ทำเช่นนั้น ซึ่งช่วยลดข้อกำหนดด้านความน่าเชื่อถือที่มีอยู่ในโซลูชันการจัดเก็บข้อมูลแบบรวมศูนย์

ต้นทุนการจัดเก็บข้อมูลในระบบดังกล่าวอาจต่ำกว่าทางเลือกแบบรวมศูนย์ด้วยเหตุผลหลายประการ การกำจัดการกำหนดราคาแบบผูกขาดทำให้การแข่งขันในตลาดสามารถลดต้นทุนให้ใกล้เคียงกับต้นทุนการจัดเก็บที่แท้จริงได้ ความซ้ำซ้อนโดยนัยจากผู้ใช้หลายรายที่จัดเก็บไฟล์ที่คล้ายกันสามารถลดความต้องการพื้นที่เก็บข้อมูลทั้งหมดได้ ไม่จำเป็นต้องมีโครงสร้างพื้นฐานศูนย์ข้อมูลที่มีราคาแพงหรือค่าใช้จ่ายขององค์กร อย่างไรก็ตาม ความท้าทายยังคงอยู่เกี่ยวกับกลไกการชำระเงิน การรับรองการมีส่วนร่วมของผู้ให้บริการอย่างเพียงพอ และการจัดการการแลกเปลี่ยนระหว่างความซ้ำซ้อนและต้นทุน แม้จะมีความท้าทายเหล่านี้ พื้นที่จัดเก็บข้อมูลแบบกระจายอำนาจแสดงให้เห็นว่า Ethereum สามารถประสานงานการโต้ตอบหลายฝ่ายที่ซับซ้อนผ่านสิ่งจูงใจทางเศรษฐกิจเพียงอย่างเดียวได้อย่างไร

Decentralized Autonomous Organizations

A Decentralized Autonomous Organization (DAO) is a virtual entity that has a set of members or shareholders who collectively have the right to spend the entity's funds and modify its code. A typical DAO operates with a simple rule: 67% of members are needed to make spending decisions or modify the organization's code. Members can submit proposals, vote on them, and if a proposal receives sufficient support, the contract automatically executes the decision. Membership shares can be transferable, allowing a liquid market for DAO participation, and different classes of shares can have different voting rights or economic claims.

The simplest DAO design is a self-modifying contract that maintains a list of members and requires a 2/3 majority vote to change any aspect of the contract, including its own voting rules. Members would submit code changes as transactions, other members would vote, and upon reaching the threshold, the contract would update itself. More sophisticated designs might include delegated voting systems where members can assign their voting power to representatives, or liquid democracy where votes can be delegated but reclaimed at any time for important decisions.

DAOs can serve various purposes beyond simple fund management. A DAO could function as a decentralized corporation, hiring contractors, purchasing services, and distributing profits to shareholders—all governed by smart contract code rather than traditional legal structures. It could operate as a decentralized investment fund, with members voting on which projects to fund. It could manage a commons resource, with stakeholders voting on allocation rules. The key insight is that by encoding governance rules in transparent, immutable code and tying them to economic stake, DAOs can coordinate group decisions without requiring traditional hierarchical management or legal enforcement.

Decentralized Autonomous Organizations

องค์กรอิสระแบบกระจายอำนาจ (DAO) เป็นนิติบุคคลเสมือนที่มีกลุ่มสมาชิกหรือผู้ถือหุ้นที่มีสิทธิร่วมกันในการใช้เงินทุนของนิติบุคคลและแก้ไขรหัส DAO ทั่วไปดำเนินการด้วยกฎง่ายๆ: สมาชิก 67% จำเป็นต้องตัดสินใจใช้จ่ายหรือแก้ไขรหัสขององค์กร สมาชิกสามารถส่งข้อเสนอ ลงคะแนนเสียง และหากข้อเสนอได้รับการสนับสนุนเพียงพอ สัญญาจะดำเนินการตัดสินใจโดยอัตโนมัติ หุ้นสมาชิกสามารถโอนได้ ทำให้ตลาดมีสภาพคล่องสำหรับการเข้าร่วม DAO และหุ้นประเภทต่างๆ สามารถมีสิทธิในการออกเสียงหรือสิทธิทางเศรษฐกิจที่แตกต่างกัน

การออกแบบ DAO ที่ง่ายที่สุดคือสัญญาที่ปรับเปลี่ยนได้เองซึ่งจะเก็บรักษารายชื่อสมาชิกและต้องใช้คะแนนเสียงข้างมาก 2/3 เพื่อเปลี่ยนแปลงแง่มุมใดๆ ของสัญญา รวมถึงกฎการลงคะแนนของตัวเองด้วย สมาชิกจะส่งการเปลี่ยนแปลงรหัสเป็นธุรกรรม สมาชิกคนอื่นๆ จะลงคะแนน และเมื่อถึงเกณฑ์ สัญญาจะอัปเดตตัวเอง การออกแบบที่ซับซ้อนมากขึ้นอาจรวมถึงระบบการลงคะแนนเสียงแบบมอบหมายซึ่งสมาชิกสามารถกำหนดอำนาจการลงคะแนนของตนให้กับตัวแทนได้ หรือระบบประชาธิปไตยแบบเหลวซึ่งสามารถมอบหมายคะแนนเสียงได้ แต่จะได้รับสิทธิ์คืนเมื่อใดก็ได้สำหรับการตัดสินใจที่สำคัญ

DAO สามารถตอบสนองวัตถุประสงค์ที่หลากหลายนอกเหนือจากการจัดการกองทุนธรรมดาๆ DAO สามารถทำหน้าที่เป็นบริษัทที่มีการกระจายอำนาจ จ้างผู้รับเหมา ซื้อบริการ และกระจายผลกำไรให้กับผู้ถือหุ้น ทั้งหมดนี้อยู่ภายใต้การควบคุมของรหัสสัญญาอัจฉริยะมากกว่าโครงสร้างทางกฎหมายแบบดั้งเดิม สามารถดำเนินการเป็นกองทุนรวมที่กระจายอำนาจได้ โดยสมาชิกจะลงคะแนนเสียงว่าโครงการใดที่จะให้ทุน สามารถจัดการทรัพยากรทั่วไปได้ โดยผู้มีส่วนได้ส่วนเสียลงคะแนนในกฎการจัดสรร ข้อมูลเชิงลึกที่สำคัญคือด้วยการเข้ารหัสกฎการกำกับดูแลด้วยโค้ดที่โปร่งใสและไม่เปลี่ยนรูป และเชื่อมโยงกับผลประโยชน์ทางเศรษฐกิจ DAO สามารถประสานงานการตัดสินใจของกลุ่มโดยไม่ต้องมีการจัดการแบบลำดับชั้นแบบดั้งเดิมหรือการบังคับใช้กฎหมาย

Further Applications

Beyond the major categories already discussed, Ethereum enables numerous other applications. Savings wallets with sophisticated security features can impose daily withdrawal limits while providing emergency keys for recovery, protecting users from theft while maintaining ultimate control. Crop insurance contracts can automatically pay farmers based on weather data feeds, eliminating claims processing and reducing administrative overhead. Peer-to-peer gambling applications can operate without any trusted intermediary, with smart contracts holding stakes and automatically paying winners based on verifiable random numbers or real-world event data.

On-chain prediction markets allow users to bet on future events, creating powerful forecasting mechanisms through the wisdom of crowds. These can be augmented with SchellingCoin-style protocols to create decentralized oracles: participants independently report data (like election results or weather conditions), and those whose reports match the majority receive rewards while outliers are penalized. This cryptoeconomic approach incentivizes honest reporting and can provide reliable real-world data to other contracts without requiring trust in any single oracle provider.

Multi-signature wallets represent another important application, enabling shared control of funds between multiple parties. A 2-of-3 multi-sig wallet might require any two of three designated parties to approve a transaction before funds can be spent, useful for escrow arrangements, corporate treasuries, or personal security. Decentralized marketplaces can combine identity systems, reputation scores, escrow contracts, and dispute resolution mechanisms to enable peer-to-peer commerce without centralized platforms. Each of these applications demonstrates how Ethereum's programmability enables new trust models and organizational structures.

Further Applications

นอกเหนือจากหมวดหมู่หลักๆ ที่กล่าวถึงแล้ว Ethereum ยังเปิดใช้งานแอปพลิเคชันอื่นๆ อีกมากมาย กระเป๋าเงินออมทรัพย์ที่มีคุณสมบัติความปลอดภัยที่ซับซ้อนสามารถกำหนดวงเงินการถอนรายวันได้ในขณะที่ให้กุญแจฉุกเฉินสำหรับการกู้คืน ปกป้องผู้ใช้จากการโจรกรรมในขณะที่ยังคงการควบคุมขั้นสูงสุด สัญญาประกันพืชผลสามารถจ่ายเงินให้เกษตรกรโดยอัตโนมัติตามฟีดข้อมูลสภาพอากาศ ขจัดการดำเนินการเรียกร้องค่าสินไหมทดแทน และลดค่าใช้จ่ายในการบริหารจัดการ แอปพลิเคชันการพนันแบบเพียร์ทูเพียร์สามารถทำงานได้โดยไม่ต้องมีคนกลางที่เชื่อถือได้ โดยมีสัญญาอัจฉริยะที่ถือหุ้นและจ่ายเงินให้ผู้ชนะโดยอัตโนมัติตามตัวเลขสุ่มที่ตรวจสอบได้หรือข้อมูลเหตุการณ์ในโลกแห่งความเป็นจริง

ตลาดการทำนายแบบออนไลน์ช่วยให้ผู้ใช้สามารถเดิมพันเหตุการณ์ในอนาคต สร้างกลไกการพยากรณ์ที่มีประสิทธิภาพผ่านภูมิปัญญาของฝูงชน สิ่งเหล่านี้สามารถเสริมด้วยโปรโตคอลสไตล์ SchellingCoin เพื่อสร้างออราเคิลแบบกระจายอำนาจ: ผู้เข้าร่วมรายงานข้อมูลอย่างอิสระ (เช่น ผลการเลือกตั้งหรือสภาพอากาศ) และผู้ที่มีรายงานตรงกับคนส่วนใหญ่จะได้รับรางวัลในขณะที่ค่าผิดปกติจะถูกลงโทษ แนวทางเศรษฐศาสตร์เข้ารหัสนี้กระตุ้นให้เกิดการรายงานที่ตรงไปตรงมา และสามารถให้ข้อมูลในโลกแห่งความเป็นจริงที่เชื่อถือได้แก่สัญญาอื่นๆ โดยไม่ต้องอาศัยความไว้วางใจจากผู้ให้บริการ Oracle รายใดรายหนึ่ง

กระเป๋าเงินหลายลายเซ็นเป็นตัวแทนของแอปพลิเคชันที่สำคัญอีกชนิดหนึ่ง ช่วยให้สามารถควบคุมเงินทุนร่วมกันระหว่างหลายฝ่ายได้ multi-sig wallet 2 ใน 3 อาจต้องมีฝ่ายที่ได้รับมอบหมายสองในสามฝ่ายอนุมัติธุรกรรมก่อนจึงจะสามารถใช้เงินทุนได้ ซึ่งมีประโยชน์สำหรับการจัดการเอสโครว์ คลังสมบัติของบริษัท หรือความปลอดภัยส่วนบุคคล ตลาดกลางแบบกระจายอำนาจสามารถรวมระบบการระบุตัวตน คะแนนชื่อเสียง สัญญาเอสโครว์ และกลไกการระงับข้อพิพาท เพื่อให้สามารถซื้อขายแบบเพียร์ทูเพียร์ได้โดยไม่ต้องมีแพลตฟอร์มแบบรวมศูนย์ แต่ละแอปพลิเคชันเหล่านี้แสดงให้เห็นว่าความสามารถในการโปรแกรมของ Ethereum ช่วยให้เกิดโมเดลความน่าเชื่อถือและโครงสร้างองค์กรแบบใหม่ได้อย่างไร

Miscellanea And Concerns

Ethereum's implementation of the modified GHOST protocol includes specific rules for uncle inclusion and rewards. Uncles must be direct children of the current block's ancestor (between 2 and 7 generations back), must be valid block headers, must be distinct from previous uncles, and must not be direct ancestors of the current block. Uncle blocks receive 87.5% of the standard block reward, while the including block receives an additional 3.125% per uncle included (up to two uncles). This incentive structure encourages miners to reference stale blocks they observe, strengthening network security while rewarding miners who experienced temporary bad luck with network propagation.

The transaction-fee/" class="glossary-link" data-slug="transaction-fee" title="fee">fee system is based on the concept of "gas," where every computational operation has a fixed gas cost. For example, a multiplication operation costs 5 gas, a SHA256 hash costs 20 gas, and every transaction has a base cost of 21,000 gas. Users specify both a gas limit (maximum gas they're willing to consume) and a gas price (how much ether they'll pay per unit of gas). This system serves multiple purposes: it prevents infinite loops and denial-of-service attacks by ensuring all computation is paid for, it creates a market for block space where users bid via gas prices, and it allows miners to set a minimum gas price they're willing to accept, protecting network resources.

Ethereum supply growth rate comparing linear issuance to Bitcoin decreasing growth

Scalability remains a significant concern, as every node/" class="glossary-link" data-slug="full-node" title="full node">full node must process every transaction to verify the state. Current blockchain architectures struggle to match centralized systems' transaction throughput. Potential solutions include state sharding, where different nodes process different subsets of transactions, and a transition from proof-of-work to proof-of-stake consensus, which could enable more efficient block production. Light clients using Merkle proofs can verify transactions without processing all blocks, but someone must still process everything. These scalability challenges represent active areas of research and development critical to Ethereum's long-term viability.

Miscellanea And Concerns

การใช้งานโปรโตคอล GHOST ที่ได้รับการแก้ไขของ Ethereum รวมถึงกฎเฉพาะสำหรับการเข้าร่วมและรางวัลของลุง ลุงต้องเป็นลูกโดยตรงของบรรพบุรุษของบล็อกปัจจุบัน (ระหว่าง 2 ถึง 7 รุ่นหลัง) ต้องเป็นส่วนหัวของบล็อกที่ถูกต้อง ต้องแตกต่างจากลุงคนก่อน และต้องไม่ใช่บรรพบุรุษโดยตรงของบล็อกปัจจุบัน บล็อกลุงจะได้รับรางวัลบล็อกมาตรฐาน 87.5% ในขณะที่บล็อกที่รวมจะได้รับเพิ่มอีก 3.125% ต่อลุงหนึ่งคน (สูงสุดสองคน) โครงสร้างสิ่งจูงใจนี้สนับสนุนให้นักขุดอ้างอิงบล็อกเก่าที่พวกเขาสังเกตเห็น ซึ่งช่วยเพิ่มความปลอดภัยให้กับเครือข่าย ในขณะเดียวกันก็ให้รางวัลแก่นักขุดที่ประสบโชคร้ายชั่วคราวจากการเผยแพร่เครือข่าย

ระบบค่าธรรมเนียมขึ้นอยู่กับแนวคิดของ "แก๊ส" ซึ่งการดำเนินการคำนวณทุกครั้งจะมีต้นทุนก๊าซคงที่ ตัวอย่างเช่น การดำเนินการคูณต้องใช้แก๊ส 5 ชิ้น แฮช SHA256 ต้องใช้แก๊ส 20 ชิ้น และทุกธุรกรรมมีต้นทุนฐานอยู่ที่ 21,000 Gas ผู้ใช้ระบุทั้งขีดจำกัดของก๊าซ (ก๊าซสูงสุดที่พวกเขายินดีใช้) และราคาก๊าซ (พวกเขาจะต้องจ่ายอีเทอร์เท่าไรต่อหน่วยของก๊าซ) ระบบนี้มีจุดประสงค์หลายประการ: ป้องกันการโจมตีแบบวนซ้ำไม่สิ้นสุดและการโจมตีแบบปฏิเสธการให้บริการโดยรับรองว่าการคำนวณทั้งหมดได้รับการชำระ สร้างตลาดสำหรับพื้นที่บล็อกที่ผู้ใช้เสนอราคาผ่านราคาน้ำมัน และช่วยให้ผู้ขุดสามารถกำหนดราคาก๊าซขั้นต่ำที่พวกเขายินดียอมรับ เพื่อปกป้องทรัพยากรเครือข่าย

Ethereum supply growth rate comparing linear issuance to Bitcoin decreasing growth

ความสามารถในการปรับขนาดยังคงเป็นข้อกังวลที่สำคัญ เนื่องจากทุกโหนดแบบเต็มจะต้องประมวลผลทุกธุรกรรมเพื่อตรวจสอบสถานะ สถาปัตยกรรมบล็อกเชนในปัจจุบันต้องดิ้นรนเพื่อให้ตรงกับปริมาณธุรกรรมของระบบรวมศูนย์ โซลูชันที่เป็นไปได้ ได้แก่ การแยกส่วนสถานะ โดยที่โหนดที่แตกต่างกันประมวลผลชุดย่อยของธุรกรรมที่แตกต่างกัน และการเปลี่ยนจาก proof-of-work ไปเป็นฉันทามติแบบ Proof-of-stake ซึ่งอาจช่วยให้การผลิตบล็อกมีประสิทธิภาพมากขึ้น ลูกค้า Light ที่ใช้การพิสูจน์ Merkle สามารถตรวจสอบธุรกรรมได้โดยไม่ต้องประมวลผลบล็อกทั้งหมด แต่บางคนยังต้องประมวลผลทุกอย่าง ความท้าทายด้านความสามารถในการปรับขนาดเหล่านี้แสดงถึงขอบเขตการวิจัยและพัฒนาที่มีความสำคัญต่อความมีชีวิตในระยะยาวของ Ethereum

Conclusion

The Ethereum protocol was originally conceived as an upgraded version of a cryptocurrency, providing advanced features like on-blockchain escrow, withdrawal limits, and financial contracts through a highly generalized programming language. However, the Ethereum protocol moves far beyond just currency. Protocols around decentralized file storage, decentralized computation, and decentralized prediction markets, among dozens of other concepts, have the potential to substantially increase the efficiency of the computational industry and provide a massive boost to other peer-to-peer protocols by adding for the first time an economic layer.

Rather than providing a limited set of operations designed for specific use cases, Ethereum provides a Turing-complete programming language that enables developers to build any application they can design. Want to invent your own financial derivative? Create your own currency? Establish a government on the blockchain? These are all trivially implementable with Ethereum's scripting system. The platform's power lies not in predicting what applications will be built, but in providing the foundational infrastructure that makes building them easy.

The concept of an arbitrary state transition function as implemented by the Ethereum protocol provides a platform with unique potential. Rather than being a closed-ended, single-purpose protocol intended for specific applications in data storage, gambling, or finance, Ethereum is open-ended by design, and we believe it is extremely well-suited to serving as a foundational layer for a large number of both financial and non-financial protocols in the years to come. The applications that will be built on Ethereum in the future may be ones we cannot even imagine today, and that open-ended possibility represents the true promise of the platform.

Conclusion

โปรโตคอล Ethereum เดิมทีถูกมองว่าเป็นเวอร์ชันอัปเกรดของสกุลเงินดิจิทัล โดยให้คุณสมบัติขั้นสูง เช่น เอสโครว์บนบล็อกเชน ขีดจำกัดการถอน และสัญญาทางการเงินผ่านภาษาการเขียนโปรแกรมทั่วไป อย่างไรก็ตาม โปรโตคอล Ethereum เคลื่อนไหวไปไกลกว่าแค่สกุลเงิน โปรโตคอลเกี่ยวกับการจัดเก็บไฟล์แบบกระจายอำนาจ การคำนวณแบบกระจายอำนาจ และตลาดการคาดการณ์แบบกระจายอำนาจ ท่ามกลางแนวคิดอื่นๆ มากมาย มีศักยภาพที่จะเพิ่มประสิทธิภาพอย่างมากของอุตสาหกรรมการคำนวณ และช่วยเพิ่มประสิทธิภาพของโปรโตคอลแบบเพียร์ทูเพียร์อื่นๆ ได้อย่างมาก โดยการเพิ่มชั้นทางเศรษฐกิจเป็นครั้งแรก

แทนที่จะจัดเตรียมชุดการดำเนินการที่จำกัดซึ่งออกแบบมาสำหรับกรณีการใช้งานเฉพาะ Ethereum จัดเตรียมภาษาการเขียนโปรแกรมทัวริงที่สมบูรณ์ซึ่งช่วยให้นักพัฒนาสามารถสร้างแอปพลิเคชันใดๆ ที่พวกเขาสามารถออกแบบได้ ต้องการประดิษฐ์อนุพันธ์ทางการเงินของคุณเองหรือไม่? สร้างสกุลเงินของคุณเองเหรอ? จัดตั้งรัฐบาลบนบล็อคเชนเหรอ? สิ่งเหล่านี้สามารถนำไปใช้ได้จริงกับระบบการเขียนสคริปต์ของ Ethereum พลังของแพลตฟอร์มไม่ได้อยู่ที่การคาดการณ์ว่าแอปพลิเคชันใดจะถูกสร้างขึ้น แต่อยู่ที่การจัดหาโครงสร้างพื้นฐานพื้นฐานที่ทำให้การสร้างเป็นเรื่องง่าย

แนวคิดของฟังก์ชันการเปลี่ยนสถานะตามอำเภอใจที่นำมาใช้โดยโปรโตคอล Ethereum มอบแพลตฟอร์มที่มีศักยภาพเฉพาะตัว แทนที่จะเป็นโปรโตคอลแบบปลายปิดที่มีจุดประสงค์เดียวสำหรับแอปพลิเคชันเฉพาะในการจัดเก็บข้อมูล การพนัน หรือการเงิน Ethereum เป็นโปรโตคอลปลายเปิดที่ได้รับการออกแบบ และเราเชื่อว่ามีความเหมาะสมอย่างยิ่งที่จะทำหน้าที่เป็นเลเยอร์พื้นฐานสำหรับโปรโตคอลทั้งทางการเงินและไม่ใช่ทางการเงินจำนวนมากในปีต่อๆ ไป แอปพลิเคชันที่จะสร้างขึ้นบน Ethereum ในอนาคตอาจเป็นแอปพลิเคชันที่เราไม่สามารถจินตนาการได้ในปัจจุบัน และความเป็นไปได้แบบปลายเปิดนั้นแสดงถึงคำมั่นสัญญาที่แท้จริงของแพลตฟอร์ม

References and Further Reading

The Ethereum whitepaper builds upon extensive prior work in cryptocurrency and distributed systems research. The foundational Bitcoin protocol is described in Satoshi Nakamoto's original 2008 paper "Bitcoin: A Peer-to-Peer Electronic Cash System," which introduced the concept of blockchain-based digital currency. Early attempts to extend Bitcoin's functionality include Namecoin, a decentralized name registration system demonstrating blockchain applications beyond currency, though limited by Bitcoin's restricted scripting capabilities.

The colored coins whitepaper proposed a method for representing alternative assets on the Bitcoin blockchain by "coloring" specific bitcoins to represent other assets, while Mastercoin attempted to create a protocol layer on top of Bitcoin for more complex financial instruments. Both highlighted the limitations of building on Bitcoin and motivated the need for a more flexible platform. The concept of decentralized autonomous corporations, explored in Bitcoin Magazine, provided theoretical foundations for organizational governance through smart contracts.

Key technical components include simplified payment verification (SPV) for light clients, Merkle trees for efficient data verification, and Patricia tries for Ethereum's state representation. The GHOST (Greedy Heaviest Observed Subtree) protocol, described in a 2013 cryptography paper, addresses security issues arising from fast block times and forms the basis for Ethereum's consensus mechanism. These references represent the intellectual foundations upon which Ethereum was built, combining insights from cryptocurrency, distributed systems, cryptography, and game theory to create a general-purpose blockchain platform.

References and Further Reading

เอกสารไวท์เปเปอร์ Ethereum สร้างขึ้นจากงานก่อนหน้านี้ที่กว้างขวางในการวิจัยระบบสกุลเงินดิจิทัลและแบบกระจาย โปรโตคอล Bitcoin พื้นฐานได้อธิบายไว้ในรายงานต้นฉบับปี 2008 ของ Satoshi Nakamoto เรื่อง "Bitcoin: A Peer-to-Peer Electronic Cash System" ซึ่งแนะนำแนวคิดของสกุลเงินดิจิทัลที่ใช้บล็อกเชน">บล็อกเชน ความพยายามในช่วงแรกๆ ในการขยายฟังก์ชันการทำงานของ Bitcoin ได้แก่ Namecoin ซึ่งเป็นระบบการลงทะเบียนชื่อแบบกระจายอำนาจที่สาธิตการใช้งานบล็อกเชนที่นอกเหนือไปจากสกุลเงิน แม้ว่าจะจำกัดด้วยความสามารถในการเขียนสคริปต์ที่จำกัดของ Bitcoin

เอกสารทางเทคนิคของเหรียญสีเสนอวิธีการแสดงสินทรัพย์ทางเลือกบนบล็อกเชน Bitcoin โดยการ "ระบายสี" บิตคอยน์เฉพาะเพื่อเป็นตัวแทนของสินทรัพย์อื่น ๆ ในขณะที่ Mastercoin พยายามสร้างเลเยอร์โปรโตคอลที่ด้านบนของ Bitcoin สำหรับเครื่องมือทางการเงินที่ซับซ้อนมากขึ้น ทั้งสองเน้นย้ำถึงข้อจำกัดของการสร้างบน Bitcoin และกระตุ้นให้เกิดความต้องการแพลตฟอร์มที่ยืดหยุ่นมากขึ้น แนวคิดขององค์กรอิสระที่มีการกระจายอำนาจ ซึ่งมีการสำรวจในนิตยสาร Bitcoin ได้ให้รากฐานทางทฤษฎีสำหรับการกำกับดูแลองค์กรผ่านสัญญาที่ชาญฉลาด

องค์ประกอบทางเทคนิคที่สำคัญ ได้แก่ การยืนยันการชำระเงินที่ง่ายขึ้น (SPV) สำหรับลูกค้ารายย่อย Merkle tree เพื่อการตรวจสอบข้อมูลที่มีประสิทธิภาพ และ Patricia พยายามให้ Ethereum เป็นตัวแทนของรัฐ โปรโตคอล GHOST (Greedy Heaviest Observed Subtree) ที่อธิบายไว้ในรายงานการเข้ารหัสปี 2013 กล่าวถึงปัญหาด้านความปลอดภัยที่เกิดจากเวลาบล็อกที่รวดเร็ว และสร้างพื้นฐานสำหรับกลไกฉันทามติของ Ethereum ข้อมูลอ้างอิงเหล่านี้แสดงถึงรากฐานทางปัญญาที่ Ethereum ถูกสร้างขึ้น โดยผสมผสานข้อมูลเชิงลึกจากสกุลเงินดิจิทัล ระบบแบบกระจาย การเข้ารหัส และทฤษฎีเกม เพื่อสร้างแพลตฟอร์มบล็อกเชนสำหรับวัตถุประสงค์ทั่วไป