มูลค่าที่สกัดได้ของคนงานเหมือง (MEV) และเงินที่ตั้งโปรแกรมได้: ความดี ความชั่ว และความน่าเกลียด

By Bitcoin นิตยสาร - 3 months ago - Reading Time: 11 minutes

มูลค่าที่สกัดได้ของคนงานเหมือง (MEV) และเงินที่ตั้งโปรแกรมได้: ความดี ความชั่ว และความน่าเกลียด

หลักของ Bitcoin’s security model relies on this basic game theory—miners, armed with their digital pickaxes, are in a relentless chase for profit. And it’s this pursuit that keeps the network secure. Basic vanilla mining involves producing blocks to earn the block rewards and transaction fees, but have you ever considered that miners might have other ways to extract value from the blockchain beyond this standard mining process? Are there other avenues for profit on the blockchain where miners can leverage their unique position as validators?

MEV คืออะไร?

ในระบบพิสูจน์การทำงาน”Miner Extractable มูลค่า"(MEV) เป็นคำที่อธิบายถึงผลกำไรที่นักขุดสามารถรับได้จากการจัดการวิธีจัดลำดับความสำคัญ ยกเว้น จัดเรียงใหม่ หรือเปลี่ยนแปลงธุรกรรมในบล็อกที่พวกเขาขุด อย่างไรก็ตาม เนื่องจาก Ethereum อัปเกรดเป็น Ethereum 2.0 ซึ่งย้ายเครือข่ายเป็นแบบ Proof-of-Stake แนวคิดของ MEV จึงได้ใช้ชื่อใหม่ และปัจจุบันเรียกว่า “Maximal Extractable Value” ในระบบ Proof-of-Stake ในบริบทนี้ ผู้เสนอบล็อกแทนที่จะเป็นผู้ขุด—ซึ่งเป็นผู้ตรวจสอบ—ที่มีโอกาสดึงค่านี้ออกมา

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

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

These opportunities might not always be easy to spot, but the more value that can be extracted through analyzing the chain, the stronger the incentive becomes for research teams equipped with bots to do this work. Over time, this disparity in miner's profit-making ability creates a trend toward centralization within the network. Ultimately undermining the core principle of the blockchain: decentralization.

This is exactly the scenario the Bitcoin developer community is aiming to prevent when considering how best to manage more expressivity on Bitcoin.

ทำไมเราถึงต้องการเงินที่ตั้งโปรแกรมได้?

ประวัติศาสตร์ Bitcoin has operated with relatively simple smart contracts. However, this model struggles with even moderately complex transactions. Bitcoin Script can only validate authentication data, it doesn’t have the capability to impose speed limits on transactions or define coin destinations because Bitcoin Script doesn’t have access to transaction data.

As a somewhat separate issue, working with and writing Bitcoin smart contracts can be challenging for users who don't fully grasp its security requirements. A proposed feature, known as ‘vaults,’ aims to solve some of these pain points by introducing time-locked conditions for transactions. Essentially, vaults could serve as an emergency “escape hatch,” allowing users to recover their funds in the event of compromised private keys. But features like this are only possible with more expressivity.

Ethereum is widely recognized for its highly expressive scripting capabilities, but it also notably struggles with the issue of MEV. Most users generally assume that Bitcoin has no MEV, in stark contrast to Ethereum, which is viewed as a wild frontier for it. But is this the full story?

สัญญาอัจฉริยะที่แสดงออกมากขึ้นจะจูงใจสถานการณ์ MEV มากขึ้นโดยอัตโนมัติหรือไม่

มีปัจจัยหลายประการที่ส่งผลต่อ MEV: (1) ความโปร่งใสของ mempool (2) ความโปร่งใสของสัญญาอัจฉริยะ และ (3) การแสดงออกของสัญญาอัจฉริยะ แต่ละปัจจัยเหล่านี้เปิดช่องใหม่สำหรับ MEV เราจะตรวจสอบแต่ละข้อที่นี่

ข้อเสีย: (1) ความโปร่งใสของ Mempool

Like Bitcoin's mempool, the mempools of most blockchains are fully transparent, open, and visible, so that everyone can see what transactions are pending before being validated and confirmed in a block. Bitcoin blocks typically take about 10 minutes to find, which theoretically gives miners that same amount of time to take advantage and front-run.

In practice, on Bitcoin, this isn’t a source of MEV for a few reasons: (1) Bitcoin transactions are simple enough that no miners have a significant analytic advantage over other miners, and (2) Bitcoin transactions generally don’t execute multi-asset transactions such as swaps or open trades that could be front-run.

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

ข้อเสีย: (2) ความโปร่งใสของสัญญาอัจฉริยะ

In Bitcoin “smart contracts” are the simple locking and unlocking mechanism inherent in Bitcoin ต้นฉบับ. The transaction values, sender, and receiver details are all publicly visible on the blockchain. While this complete and naked transparency isn’t ideal from a privacy perspective, it’s part of how Bitcoin allows all participants in the network to verify the full state of the blockchain. Any observer can analyze these contract details, potentially opening the door to certain MEV-related strategies.

แต่ Bitcoin scripting language is, by design, quite limited, focusing primarily on the basic functions of sending and receiving funds, and validating transactions with signatures or hashlocks. This simplicity inherently limits the scope for MEV strategies on Bitcoin, making such opportunities relatively scarce compared to other chains.

Platforms like Ethereum, Solana, and Cardano also have fully transparent smart contracts, but they diverge from Bitcoin by also having highly complex and expressive scripting languages. Their Turing-complete systems make it possible to theoretically execute virtually any computational task which has come to include: self-executing contracts, integration of real-world data through oracles, decentralized applications (dApps), layer-2 tokens, swaps within DEXs, and automated market makers (AMMs). These come together to foster a rich environment for MEV opportunities. Zero-knowledge-proof-based schemes, such as STARKex, could theoretically avoid some of these issues, but this trade-off would come with other complexities.

สิ่งที่น่าเกลียด: (3) การแสดงออกของสัญญาอัจฉริยะ

The MEV opportunities are so lucrative on some chains that there are “MEV trading firms” bringing in “high five figures, mid six figures” in profits a month. This trend has become so prominent that there are public dashboards dedicated to scanning for profitable opportunities on Ethereum and โซลานา. Their profitability is generated by executing the full basket of MEV strategies: front-running, sandwich trading, token arbitrage, back-running, and liquidations to name a few. Each exploiting a different smart contract dynamics for profit.

กลยุทธ์ MEV บางส่วนเหล่านี้ใช้ได้กับทั้งเลเยอร์ 1 และเลเยอร์ 2

Generalized Front-Running: Bots scan the mempool for profitable transactions, and then front-run the original transaction for a profit.Sandwich Trading: The attacker places orders both before and after a large transaction to manipulate asset prices for profit. This strategy leverages the predictable price movement caused by the large transaction.

ดังนั้นกลยุทธ์บางอย่างจะมีลักษณะเฉพาะสำหรับโทเค็นเลเยอร์ 2 และสัญญาอัจฉริยะ

Arbitrage Across Different DEXs: Bots exploit price differences for the same asset on various DEXs by buying low on one and selling high on another.Back-running in DeFi Bonding Curves: MEV bots capitalize on predictable price rises in DeFi bonding curves by placing transactions immediately after large ones, buying during uptrends, and selling for profit. DeFi Liquidations: MEV bots spot opportunities in DeFi lending where collateral values fall below set thresholds, allowing validator's to prioritize their transactions for buying the liquidated collateral at lower prices.

ความซับซ้อนของสัญญามีส่วนอย่างมากต่อความท้าทายที่เกี่ยวข้องกับ MEV

Re-entrancy Attacks: These attacks exploit smart contract logic flaws, allowing attackers to repeatedly call a function before the first execution completes, extracting funds multiple times. In the context of MEV, skilled individuals can significantly profit from this, particularly in contracts with substantial funds.Interconnected Contracts and Global State: On platforms like Ethereum, smart contracts can interact, leading to chain reactions across several contracts from a single transaction. This interconnectivity enables complex MEV strategies, where a transaction in one contract may impact another, offering a chain reaction of profit opportunities.

ส่วนหนึ่งของปัญหาที่นี่คือมูลค่ารวมที่สร้างโดยโทเค็นและ dApps ที่สร้างบนเลเยอร์ 2 มักจะเกินมูลค่าของสินทรัพย์ดั้งเดิมของ blockchain บนเลเยอร์ 1 ซึ่งบ่อนทำลายแรงจูงใจของผู้ตรวจสอบในการเลือกและยืนยันธุรกรรมโดยอิงตามค่าธรรมเนียมล้วนๆ

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

โอกาสของ MEV เหล่านี้เกิดขึ้นโดยธรรมชาติเป็นผลพลอยได้จากสัญญาอัจฉริยะที่มีความหมายสูง หรือมีทางเลือกอื่นในการฝันถึงเงินที่สามารถตั้งโปรแกรมได้อย่างสมบูรณ์หรือไม่?

Short of avoiding protocols with highly expressive smart contracts and layer-2 tokens, users can avoid some of these risks by utilizing protocols that support ธุรกรรมที่เป็นความลับ, like Liquid, that conceal transaction details. But unlike these platforms with more expressive scripting languages, Bitcoin lacks the ability to do things you would expect to be able to do with programmable money.

ข้อดี: การแลกเปลี่ยนกับเงินที่ตั้งโปรแกรมได้

When considering the evolution of smart contracts on Bitcoin the options we’re given are to (1) push the complexity off-chain, (2) cautiously integrate narrow or limited covenant functionalities, or (3) embrace the path of full expressivity. Let’s explore some of the proposals from each of these options.

(1) โครงสร้างใหม่สำหรับสัญญานอกเครือข่าย: ไม่กำหนดล่วงหน้า

Off-chain solutions, like the Lightning Network, aim to enhance Bitcoin’s scalability and functionality without burdening the mainchain, keeping transactions fast and fees low. This all sounds good so far.

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

Under the hood, APO is a new proposed type of sighash flag. Every Bitcoin transaction must have a signature to prove it’s legitimate. When creating this signature, you use a “sighash flag” to determine which parts of the transaction you’re signing. With APO a sender would sign all outputs and none of the inputs, to commit the outputs of the transaction, but not specifically which transaction the funds are going to come from.

APO enables เอลทู, allowing users to exchange pre-signed transactions off-chain. However APO may inadvertently introduce MEV by making transactions reorderable. As soon as you allow a signature that’s binding the transaction graph you have the ability to swap out transactions. Inputs can be swapped, as long as the new inputs are still compatible with the signature.

(2) ข้อตกลง: CAT + CSFS และ CTV

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

Recursive covenants allow coins to continually return to covenants of the same type.Non-recursive covenants limit this control to the next transaction, requiring the entire future path of the coins to be defined upfront.

CAT + CSFS is a covenant proposal that allows scripts to construct or define certain parts of a future transaction. CHECKSIGFROMSTACK (CSFS) verifies a signature against the data that OP_CAT constructed. By using CSFS to require the signature to match some dynamically constructed format from OP_CAT, we can define how these UTXOs can be spent in the future and create a recursive covenant, albeit clunkily.

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

One risk with recursive covenants might be possible to create a scenario where coins must follow a set of rules that repeat over and over, that get trapped in a loop without a way of getting out. Another is that, because covenants are transparent and self-executing they could open Bitcoin up to some of the MEV strategies we see on other chains.

ข่าวดีที่นี่คืออะไร?

ข่าวดีก็คือข้อเสนอเหล่านี้ล้วนนำเสนอการแสดงออกแบบใหม่!

ทีนี้ปริมาณการแสดงออกสูงสุดที่เราจะได้คือเท่าไร?

(3) การแสดงออกเต็มรูปแบบ: ความเรียบง่าย

ความง่าย is a blockchain-based programming language that differs from other scripting languages in that it is very low-level. It is not a language on top of Bitcoin Script or a new opcode within it, it’s an alternative to it. Theoretically, it’s possible to implement all covenant proposals within Simplicity, and implement many of the other contracts cypherpunks want from programmable money, but with less of the negative externalities of Ethereum.

Simplicity maintains Bitcoin’s design principle of self-contained transactions whereby programs do not have access to any information outside the transaction. Designed for both maximal expressiveness and safety, Simplicity supports formal verification and static analysis, giving users more reliable smart contracts.

Compare Simplicity to: (1) bitcoin covenant proposals and (2) scripting languages on other blockchains:

The covenant proposals on Bitcoin Script, though much simpler than Simplicity, lack the expressivity to handle fee estimation in Script, due to Bitcoin's lack of arithmetic functions. There is no way to multiply or divide, no conditionals or stack manipulations opcodes; it is also very hard to estimate a reasonable fee to be associated with a given contract or covenant. Users end up with spaghetti code, where 80% of their contract logic is dedicated to trying to determine what their fee rate should be. Making these covenant contracts super complicated and difficult to reason about.

The EVM has looping constructs which makes static analysis of gas usage very difficult. Whereas with Script or Simplicity, you can just count each opcode, or recursively add up the cost of each function. Because Simplicity has a formal model, you can formally reason about program behavior. You can't do this with Script even though you can do static analysis of resource usage.

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

The idea of advancing Bitcoin’s smart contract functionality is undeniably promising and exciting. But it’s important to acknowledge that all these proposals carry some degree of MEV risk—albeit likely not to the extent that we see on other chains. As we think about bringing more programmable money to Bitcoin, there are questions we have to ask:

Can we build a protocol with zero MEV risk, or is this an unattainable ideal?Given the inherent risks of MEV in many proposals, what level of MEV risk is acceptable?And finally, what represents the simplest proposal that offers the greatest degree of expressivity?

ข้อเสนอแต่ละข้อมีข้อดีและข้อเสียของตัวเอง อย่างไรก็ตาม ไม่ว่าเราจะดำเนินไปในทิศทางใด เราควรตั้งเป้าที่จะจัดลำดับความสำคัญของการรักษาความปลอดภัยและรักษาหลักการของการกระจายอำนาจอยู่เสมอ

สำหรับรายละเอียดการอัปเดตและข้อมูลเพิ่มเติม โปรดติดตามที่ การวิจัยกระแสบล็อค 𝕏 ฟีด.

This is a guest post by Kiara Bickers. Opinions expressed are entirely their own and do not necessarily reflect those of BTC Inc or Bitcoin นิตยสาร.

ต้นฉบับ: Bitcoin นิตยสาร