區塊鏈交易排序的公平性挑戰




完美公平在交易排序中的不可能性

探討康多塞悖論如何揭示區塊鏈共識中完美公平的限制。

在分佈式系統的研究中,特別是在拜占庭共識和狀態機複製(SMR)方面,數十年來的重點主要集中在兩個主要目標上:一致性和活躍性。一致性意味著所有節點對相同的交易序列達成共識,而活躍性則確保系統不斷添加新的交易。然而,這些特性並不能阻止不良行為者在接收交易後改變其順序。

在公共區塊鏈中,傳統共識保證的這一缺口已成為一個嚴重問題。驗證者、區塊構建者或排序者可以利用其在區塊排序中的特權角色獲取經濟利益,這種行為稱為最大可提取價值(MEV)。這種操縱包括有利的前置交易、後置交易和夾擊交易。由於交易執行順序決定了去中心化金融(DeFi)應用的有效性或盈利性,因此交易排序的完整性對於維持公平性和信任至關重要。

為了解決這一關鍵的安全缺口,交易順序公平性被提出作為第三個基本共識屬性。公平排序協議確保最終的交易順序依賴於外部的客觀因素,如到達時間(或接收順序),並且抵抗敵對的重新排序。通過限制區塊提議者重新排序交易的權力,這些協議使區塊鏈更接近於透明、可預測和抵抗MEV的狀態。

康多塞悖論與理想公平的不可行性

最直觀且最強烈的公平概念是接收順序公平性(ROF)。ROF非正式地定義為「先到先執行」,這意味著如果足夠多的交易(tx)在大多數節點處先於另一個交易(tx′)到達,則系統必須在執行時將tx排在tx′之前。

然而,除非假設所有節點能夠瞬時通信(即在瞬時同步的外部網絡中運作),否則普遍接受的「順序公平」是根本不可能實現的。這一不可能性源於社會選擇理論中的一個驚人聯繫,特別是康多塞悖論。

康多塞悖論表明,即使每個單獨的節點保持交易的傳遞內部排序,系統中的集體偏好也可能導致所謂的非傳遞循環。例如,可能大多數節點在交易A之前接收到交易B,而大多數節點又在交易B之前接收到交易C,並且大多數節點又在交易C之前接收到交易A。因此,三個大多數偏好形成了一個循環(A→B→C→A)。這意味著對於交易A、B和C,沒有一個單一且一致的排序能同時滿足所有大多數偏好。

這一悖論展示了在異步網絡中完美實現接收順序公平的目標為何不可能,甚至在共享公共時鐘的同步網絡中,如果外部網絡延遲過長,也無法實現。這一不可能性要求採用較弱的公平定義,例如批次順序公平性。

Hedera Hashgraph與中位數時間戳的缺陷

Hedera採用Hashgraph共識算法,試圖近似強接收順序公平性(ROF)。它通過為每個交易分配一個最終時間戳,該時間戳是所有節點對該交易的本地時間戳的中位數計算得出的。

然而,這本質上容易受到操縱。單個惡意節點可以故意扭曲其本地時間戳,並反轉兩個交易的最終排序,即使所有誠實參與者都按正確順序接收到它們。

考慮一個簡單的例子,五個共識節點(A、B、C、D和E)中,節點E行為不端。兩個交易tx₁和tx₂被廣播到網絡。所有誠實節點在tx₂之前接收到tx₁,因此預期的最終順序應該是tx₁ → tx₂。

在這個例子中,對手將tx₁分配一個較晚的時間戳(3),而將tx₂分配一個較早的時間戳(2)以扭曲中位數。

當協議計算中位數時:

* 對於tx₁,時間戳(1, 1, 4, 4, 3)得出中位數為3。
* 對於tx₂,時間戳(2, 2, 5, 5, 2)得出中位數為2。

由於tx₁的最終時間戳(3)大於tx₂(2),因此協議輸出tx₂ → tx₁,從而反轉了所有誠實節點觀察到的真實順序。

這個簡單的例子顯示了一個關鍵缺陷:中位數函數雖然看似中立,但卻是造成不公平的真正原因,因為即使是一個不誠實的參與者也可以利用它來偏向最終的交易排序。

因此,Hashgraph經常宣稱的「公平時間戳」實際上是一種驚人地弱的公平概念。Hashgraph共識無法保證接收順序公平性,而是依賴於授權的驗證者集,而不是基於密碼學的保證。

實現實際保證

然而,為了繞過康多塞所展示的理論不可能性,實際的公平排序方案必須以某種方式放寬公平的定義。

Aequitas協議引入了區塊順序公平性(BOF)或批次順序公平性的標準。BOF規定,如果足夠多的節點在另一個交易tx′之前接收到交易tx,則tx必須在tx′之前或同時在區塊中交付,這意味著沒有誠實節點可以在tx之後的區塊中交付tx′。這將規則從「必須在之前交付」(ROF的要求)放寬為「必須不遲於交付」。

考慮三個共識節點(A、B和C)和三個交易:tx₁、tx₂和tx₃。如果至少有兩個節點(大多數)首先觀察到一個交易,則該交易被視為「更早接收」。

如果我們應用多數投票來確定全局順序:

* tx₁ → tx₂(A和C同意)
* tx₂ → tx₃(A和B同意)
* tx₃ → tx₁(B和C同意)

這些偏好創建了一個循環:tx₁ → tx₂ → tx₃ → tx₁。在這種情況下,沒有一個單一的順序可以同時滿足每個人的觀點,這意味著嚴格的ROF是不可能實現的。

BOF通過將所有衝突的交易分組到同一批次或區塊中來解決這個問題,而不是強迫一個交易在另一個交易之前。協議簡單地輸出:

區塊B₁ = {tx₁, tx₂, tx₃}

這意味著,從協議的角度來看,所有三個交易都被視為同時發生。在區塊內,使用確定性的決勝者(例如哈希值)來決定它們的執行順序。通過這樣做,BOF確保了每對交易的公平性,並保持最終交易日誌對所有人一致。每一筆交易的處理時間不遲於其前一筆交易。

這一小但重要的調整使得協議能夠處理交易排序衝突的情況,通過將這些衝突的交易分組到同一區塊或批次中。重要的是,這不會導致部分排序,因為每個節點仍然必須就一個單一的線性交易序列達成一致。當沒有此類衝突發生時,協議仍然實現了更強的ROF屬性。

雖然Aequitas成功實現了BOF,但它面臨著重大限制,特別是通信複雜性非常高,並且只能保證弱活躍性。弱活躍性意味著,只有在其所屬的整個康多塞循環完成後,交易的交付才有保證。如果循環「鏈接在一起」,這可能需要任意長的時間。

Themis協議被引入以強制執行相同的強BOF屬性,但改善了通信複雜性。Themis通過三種技術實現這一目標:批次解包、延遲排序和更強的批內保證。

在其標準形式中,Themis要求每個參與者與網絡中的大多數其他節點交換消息。所需的通信量隨著網絡參與者數量的平方增長。然而,在其優化版本SNARK-Themis中,節點使用簡潔的密碼學證明來驗證公平性,而無需直接與每個其他參與者通信。這減少了通信負擔,使其僅以線性增長,從而使Themis即使在大型網絡中也能高效擴展。

假設五個節點(A–E)參與共識,接收到三個交易:tx₁、tx₂和tx₃。由於網絡延遲,它們的本地順序不同。

如同Aequitas一樣,這些偏好創建了一個康多塞循環。但Themis並不等待整個循環被解決,而是使用一種稱為批次解包的方法來保持系統運行。它識別所有屬於循環的交易,並將它們分組為一組,稱為強連通組件(SCC)。在這種情況下,所有三個交易都屬於同一SCC,Themis將其輸出為一個進行中的批次,標記為批次B₁ = {tx₁, tx₂, tx₃}。

通過這樣做,Themis允許網絡在Batch B₁的內部順序仍在最終確定的同時繼續處理新交易。這確保了系統保持活躍,避免停滯。

概述:

完美的交易排序公平性概念看似簡單。誰的交易首先到達網絡,誰就應該首先被處理。然而,正如康多塞悖論所示,這一理想在現實的分佈式系統中無法成立。不同的節點以不同的順序看到交易,當這些觀點衝突時,沒有任何協議能夠在不妥協的情況下建立一個單一的、普遍「正確」的序列。

Hedera的Hashgraph試圖用中位數時間戳來近似這一理想,但該方法更多依賴於信任而非證明。單個不誠實的參與者可以扭曲中位數並翻轉交易順序,揭示「公平時間戳」並不真正公平。

Aequitas和Themis等協議推進了這一討論,承認了可以和不能實現的目標。它們不再追求不可能的事情,而是以某種方式重新定義公平,仍然在真實的網絡條件下保持順序的完整性。所產生的不是對公平的拒絕,而是其演變。這一演變清楚地劃定了感知公平與可證明公平之間的界限。它顯示出,去中心化系統中的真正交易順序完整性不能依賴於聲譽、驗證者信任或授權控制,而必須來自於嵌入在協議中的密碼學驗證。

這篇文章不包含投資建議或推薦。每一項投資和交易行為都涉及風險,讀者在做出決策時應進行自己的研究。

這篇文章僅供一般信息參考,並不旨在被視為法律或投資建議。文中表達的觀點、思想和意見僅代表作者本人,並不一定反映或代表Cointelegraph的觀點和意見。

Cointelegraph不支持本文的內容或文中提及的任何產品。讀者在對任何提及的產品或公司採取行動之前應進行自己的研究,並對其決策承擔全部責任。

以上文章由特價GPT API KEY所翻譯及撰寫。而圖片則由FLUX根據內容自動生成。

🎨 Nano Banana Pro 圖像生成器|打幾句說話就出圖

想畫人像、產品圖、插畫?SSFuture 圖像生成器支援 Flux Gemini Nano Banana Pro 改圖 / 合成, 打廣東話都得,仲可以沿用上一張圖繼續微調。

🆓 Flux 模型即玩,不用登入
🤖 登入後解鎖 Gemini 改圖
📷 支援上載參考圖再生成
⚡ 每天免費額度任你玩
✨ 即刻玩 AI 畫圖
Use the original face exactly as it is, without changing a details. A stunning, very fit female model with a sun-kissed, glowing tan (hyper-realistic, high-sheen skin texture).
• Attire: A strapless, high-waisted one-piece swimsuit (or very closely cut two-piece) in a dark navy or black color with prominent white polka dots. The suit has a cutout design around the midriff and a knotted/bow detail at the bust.
• Accessories:
• An oversized straw sun hat with a wide brim, featuring a colorful striped ribbon band.
• Large, chunky yellow or gold hoop earrings with a woven/textured design.
• Hair & Makeup: Classic glamour style. Bright, bold red lipstick. Hair is pulled back or tucked under the hat.
Setting & Composition
• Background: A solid, seamless, rich mustard yellow or deep ochre/orange-yellow color, providing a warm, high-contrast backdrop.
• Prop: The model is leaning on an antique or elaborate wooden armchair or chaise lounge with ornate carvings and textured, light gold/yellow upholstery (e.g., damask or brocade).
• Pose: Confident, classic, slightly leaning into the prop, looking directly at the camera with a bright, genuine smile. Three-quarter body shot.
Style & Lighting
• Lighting: Dramatic, high-key, professional studio lighting with a strong single light source to create deep shadows and extreme highlights, especially catching the sheen on the model's skin. The lighting emphasizes a sultry, glamorous mood.
• Aesthetic: High-fashion editorial, Pin-up, Retro 1950s Glamour, Vintage Summer.
• Keywords/Details: Hyper-detailed, photorealistic, cinematic lighting, rich texture, high contrast, high sheen. Generate an ultra-realistic, highly ultra-detailed, 8k resolution with 1080x1080 pixel portrait of me using the uploaded image for reference (preserved the likeness and the original face for reference) of a striking, ultra-sharp black and white studio portrait of a young woman with a powerful, direct gaze. She is seated gracefully on a seamless bright white floor, her legs crossed in a stylized, almost sculptural pose, with one knee raised and her hands clasped firmly over it. Her posture exudes a blend of strength and quiet contemplation. Her long, sleek, dark brown hair is meticulously parted down the middle, falling evenly over her shoulders, framing her face with elegant precision. Her makeup is refined and impactful, featuring intensely defined eyes with dark eyeliner, subtle shading, and prominent, well-groomed eyebrows. Her lips are natural, complementing her smooth, matte complexion. She is dressed in a simple, form-fitting black long-sleeved bodysuit, which accentuates the natural contours of her body without distraction. There are no accessories, maintaining a pure and minimalist aesthetic. *** The lighting is soft, even, and highly diffused, creating subtle, sculptural shadows that define her form and facial features without any harshness. The seamless pure white background provides an expansive, ethereal setting, isolating the subject and enhancing the monochromatic palette. The composition is a perfectly balanced medium full shot, centering the model and emphasizing the strong, symmetrical lines of her pose. The image is rendered with exquisite detail and clarity, from the individual strands of her hair to the subtle textures of her skin. The overall style is minimalist fine art portraiture, blending classic elegance with a contemporary edge, focusing on form, emotional depth, and timeless beauty. Generate an ultra-realistic, highly ultra-detailed, 8k resolution with 1080x1080 pixel portrait of me using the uploaded image for reference (preserved the likeness and the original face for reference) of a striking, high-resolution portrait of a young woman with long, flowing wavy brunette hair, seated gracefully on a simple black wooden chair in a dimly lit studio. She wears an oversized, off-white knitted sweater that drapes loosely over her frame, slipping off one shoulder to reveal smooth skin and add a subtle touch of sensuality. Her pose is elegant and contemplative: one arm rests gently on the chair’s backrest while her hand delicately supports her chin, and her gaze is directed thoughtfully toward the side, creating an intimate and introspective mood. The lighting is expertly crafted with a single soft, directional light source positioned to the side, casting gentle shadows that sculpt her form and highlight the texture of the knitwear and the natural contours of her legs and arms. This chiaroscuro effect enhances the depth and dimensionality of the image, emphasizing the softness of her skin and the intricate weave of the sweater. The background is a smooth, muted dark gray, providing a minimalist and distraction-free backdrop that contrasts beautifully with her light-colored apparel and warm skin tones. *** The composition is a full-body vertical frame that captures the model’s seated posture with perfect balance, positioning her slightly off-center to create visual interest and harmony. The overall color palette is subdued and warm, featuring neutral tones that evoke a sense of calm and understated elegance. The image is impeccably sharp, showcasing fine details such as the delicate waves of her hair, the subtle folds in the fabric, and the natural texture of her skin. The style is classic and timeless, blending modern minimalism with emotive portraiture to convey quiet strength, beauty, and introspection.

➖Additional details:
- Negative Prompt: cartoon, 3d render, cgi,a low poly, painting, drawing, sketch, anime, deformed, bad anatomy, mutated hands, extra limbs, low quality, blurry, artifacts, plastic skin, out of frame, out of focus, wrong spelling, rumble letters, missing letter, blurry letter, blurry face, lowres, pixelated, jpeg artifacts, repeated face and repeated word.