時間:2024-06-08|瀏覽:335
區塊鏈上的每筆交易和存儲的數據都會產生成本。無論是支付費用、執行智能合約操作的 gas 成本,還是存儲數據所需的資源,所涉及變量的大小在確定這些成本方面起著至關重要的作用。在不影響其功能或安全性的情況下減小這些變量的大小可以大大節省通信、存儲和交易費用。
介紹截斷器
Truncator 是一種基于挖礦的技術,旨在減少區塊鏈系統中經常遇到的各種加密輸出的大小。Truncator 的關鍵創新在于在不犧牲安全性的情況下實現這種減少。
Truncator 的工作原理
Truncator 在交易組合過程中增加了幾個額外步驟,從而顯著降低了交易大小和相關的 gas 成本。雖然這個額外的時間通常以秒為單位而不是以毫秒為單位,但對于減少變量大小比提高速度更重要的交易來說,它尤其有益。通過采用這種方法,交易發送者可以獲得諸如降低交易費用等優勢,而整個生態系統則通過降低存儲和通信成本而受益。
Truncator 背后的技術
這種方法涉及在密碼原語輸入或隨機性中進行迭代搜索(或挖掘),以找到更高效的加密輸出。此方法以特定方式制作每個原語的輸出,以滿足修改后的系統的公共參數,例如要求輸出的某些特定位保持不變。這類似于工作量證明機制要求礦工不斷用不同的隨機值消化相同的數據,直到滿足特定的系統需求。在 Truncator 的情況下,系統目標是在一定程度上簡化輸出。
例如,考慮在基于離散對數 (dlog) 的密鑰生成算法中應用 Truncator。假設所有可接受的公鑰都有預定的 ? 位前綴,我們可以對密鑰 \(sk\) 進行迭代搜索,使得其派生公鑰 \(pk = g^{sk}\) 的格式滿足預定的 ? 位前綴。生成的公鑰將小 ? 位,從而降低通信和存儲成本。
確保安全
Security is paramount, of course, and the bit-security framework shows that Truncator does not reduce the security of the keys. The bit-security framework states that a primitive \( P \) has κ-bit security if it takes an adversary \( 2^{κ} \) operations to break it. This implies that for any attack with computational cost \( T \) and success probability \( ? \), it must hold that \( T /? 2^{κ} \). The intuition here is that the mining approach for truncation incurs higher attack costs, which overall offsets the reduced key space, maintaining the same level of security.
Real-world applications
The idea of an iterative search to reduce the size of keys and addresses has appeared before in the blockchain space, most notably in Ethereum proposals for addresses with a prefix of many zeroes to reduce gas fees (known as “gas golfing”). In this Truncator work, we formalize and expand this idea to multiple cryptographic primitives such as hash digests, elliptic curve cryptography (ECC) public keys, and signature outputs. For example, about 7 percent compression (2 bytes less) has been achieved in less than a second for ed25519 signatures and less than 10 milliseconds for compressed Blake3 digests. We have also explored truncation in ElGamal encryption and Diffie-Hellman-based encryption, commonly used for blockchain stealth addresses.
A new approach for hash-based post-quantum signatures
There is an exciting opportunity to construct new cryptographic schemes that leverage Truncator’s techniques during the protocol design phase, particularly in the context of post-quantum security. Hash-based signature schemes, such as Lamport signatures and their variants, are inherently quantum-resistant because their security relies on the properties of hash functions rather than on the hardness of problems like factoring large integers or computing discrete logarithms, which quantum computers can efficiently solve.
Future schemes could consider mining feasibility and securely adjust key generation or other cryptographic operations to accommodate it, thus enhancing resistance to quantum computing attacks. By optimizing the key derivation process in hash-based signature schemes, it is possible to achieve better performance and efficiency. This involves reducing the computational load and storage requirements, which is crucial for maintaining the security and usability of cryptographic systems in a post-quantum world. High-performance mining techniques can lead to more efficient generation and verification of signatures, ensuring that cryptographic systems remain robust and scalable in the face of emerging quantum threats.
Optimizing Lamport signatures
一個有趣的方向是在密鑰派生級別優化基于哈希的簽名,旨在實現高性能挖掘,其結果明顯優于暴力破解。例如,在傳統的 Lamport 簽名中,私鑰包含 256 個獨立的 256 位隨機值對(種子),總共 512 個元素和 16 KiB。每個子私鑰對應一個公鑰,即其哈希,總共有 512 個元素。通常,我們會對哈希消息進行簽名,其中哈希中的每個位都對應一個子私鑰值。
雖然壓縮 Lamport 簽名通常需要諸如 Winternitz 哈希鏈變體之類的技術,但它也可以通過以樹形結構派生私有部分而不是獨立選擇它們來實現。
考慮對一條全零組成的消息進行簽名。使用頂部密鑰,驗證者可以通過 Merkle 樹操作導出所有子密鑰。對于相鄰的相似位,我們可以使用相應的樹路徑來減少提交所需的密鑰數量。此原則也適用于相鄰的集合位。通過哈希重試最大化相鄰位的數量,我們可以減少簽名有效負載,從而實現更優化的 Lamport 驗證和更短的證明。
通過哈希重試最大化相鄰位數,我們可以減少簽名負載,從而實現更優化的 Lamport 驗證和更短的證明。結論
Truncator 提供了一種創新方法來截斷加密基元的輸出大小,提供了一種計算權衡,為探索開辟了新的途徑。我們重點介紹了它在基本加密基元中的應用,并介紹了在密鑰派生級別優化基于哈希的簽名的令人興奮的方向。
展望未來,我們看到將 Truncator 擴展到更高級的加密基元以及制定利用各種加密協議中的挖掘技術的新協議的潛力。這些努力有望提高區塊鏈生態系統及其他領域的效率并降低存儲成本。
在 Sui,我們特別高興能將此類優化納入我們的后量子安全路線圖,確保我們的平臺始終處于創新前沿,同時保持強大的安全標準。Truncator 可能有助于實現更節省 gas 的后量子簽名,從而有助于打造更高效、更安全的區塊鏈環境。
要更深入地探索 Truncator,請查看我們的 GitHub。
熱點:GAS