![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
這是一系列深入研究單個盟約提案的第五篇文章,這些提案已達到了成熟的點,值得深入分解。
This is the fifth article in a series deep diving into individual covenant proposals that have reached a point of maturity meriting an in-depth breakdown.
這是一系列深入研究單個盟約提案的第五篇文章,這些提案已達到了成熟的點,值得深入分解。
OP_CAT, put forward for reactivation in tapscript by Ethan Heilman and Armin Sabouri in BIP 347, is not a covenant. It was an opcode that was originally included in the first release of Bitcoin for manipulating data elements on the stack. It was deactivated in 2010 with the release of Bitcoin 0.3.10 along with a number of other opcodes due to concerns of denial of service attacks that could crash nodes. A global maximum limit of 520 bytes for any individual item on the stack while executing a script was also added.
OP_CAT在Bip 347中由Ethan Heilman和Armin Sabouri在Tapscript中進行重新激活,這並不是盟約。這是一個最初包含在第一個版本的比特幣中,用於操縱堆棧上的數據元素。由於擔心拒絕使用可能崩潰的節點的服務攻擊,因此在2010年停用了它,並發布了比特幣0.3.10以及許多其他Opcodes。還添加了執行腳本時堆棧上任何單個項目的全局最大限制為520個字節。
You should already have a basic understanding of how script evaluation on the stack works, and the basic pieces of a bitcoin transaction, so there isn’t really much pre-requisite explaining necessary for OP_CAT.
您應該已經對堆棧上的腳本評估以及比特幣交易的基本部分有了基本的了解,因此OP_CAT確實沒有太多的先決條件解釋。
While OP_CAT may not be a covenant in and of itself, it can emulate covenants due to a quirk in how Schnorr signatures work. This is a pretty in depth topic, fully explained here by Andrew Poelstra from Blockstream, so I’ll just stick with a high level view. Every elliptic curve has a generator point, which is essentially “0”, that is used in the elliptic curve math for key generation and signing. With Schnorr, you can sign using the generator point as a key, and give or take a few bytes that you have to sign repeatedly to get right, the resulting signature is actually the same hash of the transaction you signed.
雖然OP_CAT本身可能不是盟約,但由於Schnorr簽名的工作方式,它可以模仿盟約。這是一個非常深入的主題,在這裡由Blockstream的Andrew Poelstra在此處進行了充分的解釋,因此我將堅持高水平的視野。每個橢圓曲線都有一個生成點,本質上是“ 0”,用於橢圓曲線數學中用於密鑰生成和簽名。使用Schnorr,您可以使用發電機點作為鍵進行簽名,並給出或採用幾個字節,您必須重複簽名才能正確,實際上,簽名實際上與您簽名的交易的哈希相同。
Set aside the mechanics of how that works mathematically for now, and just remember for later that these “weird” signatures allow you to get the current transactions TXID on the stack.
擱置了現在的數學工作方式的機制,然後記住以後要記住,這些“怪異”簽名使您可以在堆棧上獲得當前的交易TXID。
How OP_CAT Works
OP_CAT的工作原理
OP_CAT takes the top two data items on the stack and concatenates them together. So if the top two items on the stack are “1” and “2”, OP_CAT removes both of them and then puts “12” on top of the stack. That’s it.
OP_CAT將堆棧上的兩個數據項占據了兩個數據項,並將它們連接在一起。因此,如果堆棧上的前兩個項目是“ 1”和“ 2”,則OP_CAT將其刪除兩個,然後將“ 12”放在堆棧頂部。就是這樣。
What Is OP_CAT Useful For
什麼是op_cat有用的
Okay, so what’s the big deal? Why is everyone freaking out about OP_CAT even though it’s so simple the explanation of how it works didn’t even take a full paragraph to write.
好吧,有什麼大不了的?為什麼每個人都對OP_CAT感到恐懼,即使它是如此簡單,以至於對它的工作方式的解釋甚至都沒有花費完整的段落寫作。
Two reasons, although given the nature of OP_CAT I can give no guarantees these are the only two reasons. OP_CAT allows the construction and verification of merkle trees directly on the stack, which opens the door to some interesting behavior and functionality. It also allows emulation of covenants enabling full granular introspection due to the “weird” Schnorr signatures mentioned above.
儘管鑑於op_cat的性質,但我不能保證這兩個原因是唯一的兩個原因。 OP_CAT允許直接在堆棧上構建和驗證Merkle樹,這為一些有趣的行為和功能打開了門。由於上述“怪異”的schnorr簽名,它還允許模仿盟約,從而實現全顆粒狀的內省。
Merkle proof verification is a key component of Taproot, but the way it is implemented merkle tree verification only occurs in the context of verifying that a tapscript spending path is committed to in the root Schnorr public key in the output script of the coin being spent. Taproot does not support generic merkle proof verification.
Merkle證明驗證是Taproot的關鍵組成部分,但是它實現了Merkle樹驗證的方式僅在驗證tapscript支出路徑的背景下發生在root Schnorr公共密鑰中的root Schnorr公共密鑰中,在所花費的硬幣的輸出腳本中。 Taproot不支持通用的Merkle證明驗證。
OP_CAT allows this in a totally generic manner. Simply providing the leaf hash(es) and then interior hash nodes in the right order and calling OP_CAT successively will allow you to reconstruct a merkle root hash, and compare against a pre-defined hash in the script. You could do this to provide unilateral withdrawal paths for shared UTXOs like in CatVM, you could make transactions dependent on other transactions having been included in a block with valid work, you can make a transaction dependent on pretty much any condition that can be verified with a merkle proof.
OP_CAT允許完全通用的方式。只需提供正確的順序提供葉子哈希(ES),然後提供內部哈希節點,然後依次調用OP_CAT,就可以使您重建一個默克爾根哈希,並與腳本中的預定的哈希進行比較。您可以這樣做以為CATVM中的共享UTXO提供單方面的撤迴路徑,您可以將交易取決於已包含在有效工作的塊中的其他交易,您可以通過幾乎可以通過默克爾證明來驗證的任何條件進行交易。
Now, for the covenant emulation that enables full introspection. What you are trying to do is ensure that a transaction has to have certain characteristics to be valid. Remember now that the “weird” signature gets the hash of the transaction on the stack. A transaction signature isn’t actually done over the raw transaction, it’s done over its hash. This allows us to do something interesting.
現在,對於能夠充分自省的盟約仿真。您要做的是確保交易必須具有某些特徵才能有效。現在請記住,“怪異”簽名獲得了堆棧上的交易哈希。實際交易實際上尚未完成交易簽名,它是通過哈希進行的。這使我們能夠做一些有趣的事情。
You can construct very complicated and convoluted scripts using OP_CAT to take the individual raw pieces of the transaction as part of the witness, and slowly put them together on the
您可以使用op_cat構建非常複雜和復雜的腳本,以將交易的各個原始部分作為證人的一部分,然後慢慢將它們放在一起
免責聲明:info@kdj.com
所提供的資訊並非交易建議。 kDJ.com對任何基於本文提供的資訊進行的投資不承擔任何責任。加密貨幣波動性較大,建議您充分研究後謹慎投資!
如果您認為本網站使用的內容侵犯了您的版權,請立即聯絡我們(info@kdj.com),我們將及時刪除。
-
- XRP新聞:加密巨頭Ripple和Circle再次成為聚光燈
- 2025-05-03 17:30:12
- 本文探討了Ripple對Circle的200億美元出價及其對XRP生態系統的潛在影響的可能性。
-
- 據頂級加密分析師稱
- 2025-05-03 17:30:12
- 著名的加密分析師Altcoin Sherpa聚焦了幾個Altcoins,他認為值得關注當前的市場動態。
-
-
- 最近的數字貨幣經濟低迷為潛在的激增奠定了基礎
- 2025-05-03 17:25:13
- 某些令牌開始顯示出有希望的捲土重來的跡象。這些資產可能位於下一個市場集會的最前沿。
-
-
- 隨著REMITTIX(RTX)脫穎而出
- 2025-05-03 17:20:13
- 經過幾個月的價格動作,Vechain(VET)終於顯示出生命的跡象
-
- 匯款繁榮仍在季節中,但是令牌圖表已經轉變為更正階段
- 2025-05-03 17:15:12
- 加密熱潮仍在季節中,但是現在的圖表已經轉變為更正階段。 Ripple是上周有前途的尖峰之一
-
-