P2TR 地址格式
P2TR,是使用者在 Taproot 系統中實際接觸到的比特幣輸出格式地址,為 Bech32m 格式編碼。

P2TR,Pay-to-Taproot,是使用者在 Taproot 系統中實際接觸到的比特幣輸出格式地址,為 Bech32m 格式編碼。
P2TR 建立基於 Schnorr Signature、Taproot 與 Merkelized Abstract Syntax Tree,MAST 默克爾化抽象語法樹等技術。
其目標是在不改變比特幣安全模型的前提下,提升隱私性、降低鏈上資料量,並支援更靈活的腳本表達方式。
P2TR 基本概念
-
交易輸出 ScriptPubKey 在比特幣系統中,每一筆 UTXO 都包含一段由公鑰資料與操作碼 OP_Code 組成的 ScriptPubKey,P2TR 是其中一種 ScriptPubKey 類型,用於定義未來花費該筆比特幣所需滿足的對應解鎖資料條件。
-
基於 Schnorr Signature P2TR 採用 Schnorr Signature 作為簽名驗證機制。 其具備簡潔的線性方程結構,可提高驗證效率運算,為 Taproot 與 P2TR 的核心密碼學基礎。
-
Taproot Output Key P2TR 使用一組由 Internal Key 與 Script Tree 兩個部分,經過 TapTweak 運算所組成的公鑰,作為鎖定條件,稱為 Taproot Output Key。使得滿足多重條件的腳本,聚合成單一公鑰與簽名顯示,達到隱私目的。
-
Internal Key 內部公鑰 若交易僅使用最簡單路徑,則直接透過使用 Schnorr 簽名的 Internal Key,所對應的私鑰進行簽名即可完成花費。
-
Script Tree 腳本樹結構 若需要額外條件,P2TR 可建立由多重簽名、時間鎖、備援解鎖等多個腳本條件的 Script Tree,以 Merkle Tree 方式組織。
P2TR 運作方式
-
建立 Internal Key 生成一組 Schnorr 公私鑰。其中公鑰即為 Internal Key,可用於 Key Path Spend,最簡單的花費路徑。
-
建立 Script Tree 當需要額外條件時,可建立 Script Tree。 所有腳本條件會被組織成 Taproot Script Tree,並透過 Merkle Tree 結構生成 Merkle Root。
-
TapTweak 運算 Internal Key 與可能存在的 Script Tree 的 Merkle Root,經過 Tagged Hash 計算後,生成 Tweak 值。
H_tapTweak(Internal Key || Merkle Root) = Tweak
-
生成 Taproot Output Key Tweak 值再透過橢圓曲線標量乘法與點加運算生成最終 Taproot Output Key。
Internal Key + Tweak × G = Output Key
-
生成 ScriptPubKey 將 Output Key 壓縮為 x-only public key(32 bytes),並寫入 SegWit v1 結構,OP_1 代表 Witness Version 1。
OP_1 + <32-byte x-only pubkey> = ScriptPubKey
-
產生 P2TR 地址 將 ScriptPubKey 以 Bech32m 編碼(而非 Bech32),生成地址格式
bc1pxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
P2TR 應用
-
個人錢包 提供更高隱私性與更低交易成本的標準錢包格式。
-
多重簽名 可透過 Schnorr 與聚合簽名機制提升多方簽名效率。
-
閃電網路 作為 Lightning Network 未來升級的重要基礎,使通道條件更加靈活且隱私性更高。
-
企業資產管理 支援多層授權與備援機制,可在單一輸出中設計複雜資金控制規則。
P2TR 相關 BIP
- BIP 340:Schnorr Signatures for secp256k1
- BIP 341:Taproot: SegWit Version 1 Spending Rules
- BIP 342:Validation of Taproot Scripts (Tapscript)
- BIP 141:Segregated Witness (Consensus Layer)
- BIP 350:Bech32m Format for v1+ Witness Addresses

更多文章