Taproot Consensus

Taproot Consensus 是 BEVM 做的 #BTClayer2 技术解决方案。 对标于 #ETHlayer2 的 #Rollup 技术解决方案。

Taproot Consensus 技术层由3部分 技术结合而成。

  • 第一部分: Taproot 技术。包括(Musig2, schnorr签名,Mast合约)等等。
  • 第二部分: Bitcoin SPV 组成的 BFT POS网络。
  • 第三部分: 结合Signal 通信形成的 门限节点通信。

Taproot Consensus 通过 把 Bitcoin 原生的 Taproot 技术栈和 Bitcoin SPV 节点组成的 BFT POS网络相结合成去中心化的 #BTClayer2 解决方案。

Taproot 的简介

Taproot 是 2021年 11月份 BTC 面世以来最重要的的一次技术底层框架升级。
主要包括如下 3大 BIP
BIP340(Schnorr签名), Schnorr的密钥聚合功能允许多重签名交易的各方协作组合其公钥,并生成一个对其公钥总和有效的签名。节省了区块空间,提高了隐私,并实现了更快的交易验证。
BIP341 (Taproot), 后面会重点介绍 Taproot BIP
BIP342(Tapscript)更新了用于写BTC交易参数的脚本编码语言,以便为选择升级的用户提供Schnorr和Taproot技术。

Taproot 部分

BIP341

目的

为了解决 #Bitcoin 网络的可扩展性 和 隐私性。

Taproot BIP341 的主要模块

  • merkle 树分支: 只需要向BTC 主网提交脚本实际执行的部分,而不是包含各种树分支的所有执行脚步。默克尔树成为脚本结构的一部分的机制可以直接最大限度地节省交易存储空间和执行 Gas 手续费。(Merkle branches let us only reveal the actually executed part of the script to the blockchain, as opposed to all possible ways a script can be executed. Among the various known mechanisms for implementing this, one where the Merkle tree becomes part of the script's structure directly maximizes the space savings, so that approach is chosen. )
  • Taproot Mast 合约 让所有的Outputs 都统一 成 私钥 和 脚本 成对的使用。只要使用基于私钥的支出路径进行花费,不会透露脚本路径是否也被允许,从而节省空间而减少交易手续费支出并增加支出时的脚本隐私。(Taproot on top of that lets us merge the traditionally separate pay-to-pubkey and pay-to-scripthash policies, making all outputs spendable by either a key or (optionally) a script, and indistinguishable from each other. As long as the key-based spending path is used for spending, it is not revealed whether a script path was permitted as well, resulting in space savings and an increase in scripting privacy at spending time.)
  • shnorr 门限签:假设大多数应用程序都涉及可由各方同意使用的输出,那么 Taproot 的优势就变得显而易见。 这就是 Schnorr 签名的用武之地,因为它们允许密钥聚合:公钥可以由多个参与者公钥构建,并且需要所有参与者之间的合作才能签名。 这种多方公钥和签名与单方的等效项没有区别。 这意味着通过主根,大多数应用程序都可以使用基于密钥的支出路径,该路径既高效又私密。 这可以推广到任意 M-of-N 策略,因为 Schnorr 签名支持阈值签名,但代价是更复杂的设置协议。而设置协议是 BEVM 团队开发的重点,因为把 M-of-N 的门限签名扩展到 1000个,需要设计 快速计算的设置协议。 (Taproot's advantages become apparent under the assumption that most applications involve outputs that could be spent by all parties agreeing. That's where Schnorr signatures come in, as they permit key aggregation: a public key can be constructed from multiple participant public keys, and which requires cooperation between all participants to sign for. Such multi-party public keys and signatures are indistinguishable from their single-party equivalents. This means that with taproot most applications can use the key-based spending path, which is both efficient and private. This can be generalized to arbitrary M-of-N policies, as Schnorr signatures support threshold signing, at the cost of more complex setup protocols.)
  • Schnorr 签名批量验证,允许同时验证多个签名比单独验证每个签名更有效,这也会提高BTC 网络交易的性能。 这给 BEVM 技术从 #Layer2 跨回到 BTC 主网的交易可以批量 验证处理,增加了layer1 和layer2 之间的交易并行处理,节省了layer2和layer1 之间交互的 手续费以及交互效率。(As Schnorr signatures also permit batch validation, allowing multiple signatures to be validated together more efficiently than validating each one independently, we make sure all parts of the design are compatible with this.)

Bitcoin SPV 组成的BFT POS网络

  • Bitcoin SPV : Bitcoin 轻节点, 不需要全部的BTC 交易, 只需要 block header 和 layer2 相交互的 交易 就能去中心化的验证 交易的有效性和正确性。
  • BFT POS网络: 采用 Aura 出块共识 和 Grandpa BFT 共识融合的 Susbtrate 公链框架。

BEVM 如何 设计 Taproot Consensus ?

Taproot Consensus 节点

Taproot Consensus 节点 首先是 Bitcoin SPV 节点,然后 通过 全网BTC/BEVM 质押者投票 治理 选举为 Taproot Consensus 节点,即 通过 Layer2 BFT POS 共识的安全来确保 Taproot Consensus 节点选举的安全。

Taproot Consensus 的设计

Taproot 共识节点通过 taproot 技术组合的 Musig2 和 Signal 协议相组合 形成 链上去中心化的 门限签 和Bitcoin 主网交互。其中 Musig2 是基于Taproot 安全的 门限签名。 Signal 协议结合了双棘轮算法、前置密钥和三次椭圆曲线迪菲-赫尔曼密钥交换(3-DH)握手[3],并使用Curve25519、AES-256和HMAC-SHA256算法作为密码学原语, 是当前最安全的通信协议, 解决了Musig2 参与的 多方门限签名者互相之间通信的安全性。
Musig2 实现了 Bitcoin 门限签的安全和灵活性, signal协议 实现了Taproot共识节点门限签通信的安全, 而Bitcoin Spv 节点确保了 Taproot 门限签的去中心化,BEVM layer2 网络的 BFT POS 共识 确保了 Bitcoin SPV 网络 的 链上安全。