摘要:
Abstract—Atomic Crosschain Transaction technology allows composable programming across permissioned Ethereum blockchains. It allows for inter-contract and inter-blockchain function calls that are both synchronous and atomic: if one part fails, the whole call graph of function calls is rolled back. This paper analyses the processing overhead of using this technique compared to using multiple standard non-atomic single blockchain transactions. The additional processing is analysed for three scenarios involving multiple blockchains: the Hotel - Train problem, Supply Chain with Provenance, and an Oracle. The technology is shown to reduce the performance of Hyperledger Besu from 375 tps to 39.5 tps if all transactions are instigated on one node, or approaching 65.2 tps if the transactions are instigated on a variety of nodes, for the Hotel-Train scenario. Index Terms—blockchain, ethereum, cross, transaction, atomic, performance
摘要——原子跨链交易技术允许跨许可的以太坊进行可组合编程区块链。 它允许跨合约和跨区块链
同步和原子的函数调用:如果有部分失败,函数调用的整个调用图被滚动背部。 本文分析了使用这个的处理开销技术与使用多个标准非原子单区块链交易。 额外的处理被分析为涉及多个区块链的三个场景:酒店-火车问题、具有来源的供应链和 Oracle。 这技术被证明会降低 Hyperledger 的性能
如果发起所有交易,Besu 从 375 tps 到 39.5 tps在一个节点上,或者如果交易是接近 65.2 tps
在各种节点上煽动,用于酒店-火车场景。索引词——区块链、以太坊、交叉、交易、原子、表现
Atomic Crosschain Transactions [1], [2] is an Ethereum permissioned blockchain technology [3], [4] that allows transactions across blockchains that either update state on all blockchains or discarded state updates on all blockchains. These crosschain transactions are nested transactions that consist of an Originating Transaction, Subordinate Transactions and Subordinate Views. Originating and Subordinate
Transactions update the state of the blockchains they run on. Subordinate Views return the result of a function call on one blockchain to another blockchain. The Atomic Crosschain Transactions are able to provide this functionality because they provide cross-blockchain consensus. Providing cross-blockchain consensus does not come for free. BLS Threshold Signatures [5]–[7] are used to prove values across blockchains. Verifying BLS Threshold Signatures uses two costly BLS Pairing operations. Generating
BLS Threshold Signatures involves communications between validator nodes in a blockchain network and verifying the signature prior to publication. Validating information from other blockchains requires signature verifification. Additionally, the Coordination Contract on a Coordination Blockchain, used to coordinate parts of the overall transaction, needs to verify signatures. The contribution of this paper is the first analysis
of the additional processing requirements imposed by using the Atomic Crosschain Transaction technology compared to using separate single blockchain transactions. The Atomic Crosschain Transaction technology can be used to create applications to solve a wide variety of problems
原子跨链交易 [1]、[2] 是一种以太坊许可的区块链技术 [3]、[4],它允许跨区块链进行交易,这些交易要么更新所有区块链上的状态,要么丢弃所有区块链上的状态更新。这些跨链交易是由发起交易、从属交易和从属视图组成的嵌套交易。起源和从属交易更新它们运行的区块链的状态。从属视图将一个区块链上的函数调用结果返回到另一个区块链。原子跨链交易能够提供此功能,因为它们提供跨区块链共识。提供跨区块链共识不是免费的。 BLS 阈值签名 [5]–[7] 用于证明跨区块链的价值。验证 BLS 阈值签名使用两个昂贵的 BLS 配对操作。生成BLS 阈值签名涉及区块链网络中验证器节点之间的通信以及在发布之前验证签名。验证来自其他区块链的信息需要签名验证。此外,用于协调整个交易部分的协调区块链上的协调合约需要验证签名。本文的贡献是第一次分析与使用单独的单个区块链交易相比,使用原子跨链交易技术强加的额外处理要求。原子跨链交易技术可用于创建解决各种问题的应用程序
Three common example problems involving transactions read ing and updating across multiple blockchains are presented so that the technology can be evaluated. The Hotel Train problem has a travel agency book a hotel room and a train seat. This requires the state of three blockchains to be updated atomically. The Supply Chain Provenance problem allows for selective transparency of supply chain events between a Supply Chain blockchain and a Provenance blockchain. This requires two blockchains to update atomically. The Oracle problem involves using the result of a function call on one blockchain,
for example to read the current price of a commodity, in a function call on another blockchain.
Creating blockchain systems that provide atomic behaviour across multiple blockchains is a complex problem [8]. This is because blockchain networks are distributed systems and cross-blockchain protocols thus operate in a distributed system of distributed systems. To date, Atomic Crosschain Trans
actions is the only protocol that provides a true atomic cross-blockchain function call protocol [9]. Understanding the overhead imposed by a cross blockchain protocol is important as this allows application architects to evaluate whether the additional utility provided by the protocol outweighs the overhead.
This paper is organised as follows: the Background section introduces Ethereum and Atomic Crosschain Transactions. Next three example problems are described in the Scenar ios section. The Experimental Setup section describes how throughput numbers were gathered. The Results section anal yses the overhead of using Atomic Crosschain Transaction technology compared to using separate single blockchain transactions. The affect of Byzantine actors in the fifinal section.
提出了涉及跨多个区块链读取和更新事务的三个常见示例问题以便对技术进行评估。酒店火车问题有旅行社订酒店房间和火车座位。这需要更新三个区块链的状态原子地。供应链来源问题允许供应之间供应链事件的选择性透明度链式区块链和起源区块链。这需要两个区块链进行原子更新。甲骨文问题涉及在一个区块链上使用函数调用的结果,例如读取商品的当前价格,在另一个区块链上的函数调用。创建提供原子行为的区块链系统跨多个区块链是一个复杂的问题 [8]。这是因为区块链网络是分布式系统,跨区块链协议因此在分布式系统中运行的分布式系统。迄今为止,原子跨链交易是唯一提供真正原子交易的协议跨区块链函数调用协议[9]。了解跨区块链协议施加的开销很重要因为这允许应用程序架构师评估协议提供的额外效用超过了高架。本文的组织结构如下: 背景部分介绍以太坊和原子跨链交易。接下来的三个示例问题在场景 ios 部分中描述。实验设置部分描述了如何收集了吞吐量数字。结果部分分析了使用原子跨链交易的开销技术与使用单独的单个区块链相比交易。最后一部分拜占庭演员的影响。
A. Ethereum [10] is a blockchain platform that allows users to deploy and execute computer programs known as Smart Contracts.
Smart Contracts are typically written in the Solidity[11] programming language. Source code is compiled into a bytecode representation. The bytecode is deployed to the distributed ledger using a contract creation transaction. Ethereum transactions update the state of the distributed ledger, do not return values, and can emit log information. In addition to contract deployment transactions, transactions are also used to call functions in the Smart Contracts and to transfer Ether, the native coin of Ethereum, between accounts.
“View” function calls can be executed on the Smart Contract code. These View function calls return a value and do not update the state of the Smart Contract. Blocks consist of groups of transactions. Ethereum nodes come to consensus to determine the next block that will become part of the chain of blocks. As such, execution of transactions involves nodes across the network. In contrast, View function calls execute on a single node using the node’s local copy of the distributed ledger. Ethereum MainNet, the most widely used public Ethereum network, uses a Proof of Work (PoW) [10], [12] consensus algorithm. Ethereum 2, due to go live incrementally starting in 2020, will use a Proof of Stake (PoS) [13] consensus algorithm. Ethereum is also deployed in permissioned consor tium networks [4]. In these deployments Proof of Authority (PoA) consensus algorithms such as Istanbul Fault Byzantine Tolerant (IBFT) [14] and Istanbul Fault Byzantine Tolerant version 2 (IBFT2) [15] are used.
以太坊 [10] 是一个区块链平台,允许用户部署和执行称为智能合约的计算机程序。智能合约通常用 Solidity[11] 编程语言编写。源代码被编译成字节码表示。字节码使用合约创建交易部署到分布式账本。以太坊交易更新分布式账本的状态,不返回值,并且可以发出日志信息。除了合约部署交易,交易也用于调用智能合约中的函数以及在账户之间转移以太币(以太坊的原生代币)。
“查看”函数调用可以在智能合约代码上行。这执些 View 函数调用返回一个值并且不会更新智能合约的状态。区块由交易组组成。以太坊节点达成共识,以确定将成为区块链一部分的下一个区块。因此,交易的执行涉及网络上的节点。相比之下,View 函数调用使用分布式账本的节点本地副本在单个节点上执行。以太坊主网是使用最广泛的公共以太坊网络,它使用工作量证明 (PoW) [10]、[12] 共识算法。以太坊 2 将于 2020 年逐步上线,将使用权益证明 (PoS) [13] 共识算法。以太坊也部署在许可的联盟网络中 [4]。在这些部署中,使用了权威证明 (PoA) 共识算法,例如伊斯坦布尔故障拜占庭容错 (IBFT) [14] 和伊斯坦布尔故障拜占庭容错版本 2 (IBFT2) [15]。
B. Atomic Crosschain Transactions
原子跨链交易
Atomic Crosschain Transaction technology [1], [2] has been designed to shield application developers from the complexity of crosschain transactions by incorporating the required changes into the Ethereum Client software. The technology has been implemented in a fork of Hyperledger Besu [16],and is available on github.com [17].
原子交叉链交易技术 [1]、[2] 旨在通过将所需的更改合并到以太坊客户端软件中,使应用程序开发人员免受交叉链交易的复杂性影响。该技术已在 Hyperledger Besu [16] 的一个分支中实现,并可在 github.com [17] 上获得。
1). Nested Transactions: Atomic Crosschain Transactions are nested Ethereum transactions and views. Figure 1 shows an Externally Owned Account (EOA) calling a function funcA in contract ConA on blockchain Private Blockchain A. This function in turn calls function funcB, that in turn calls
functions funcC and funcD, each on separate blockchains. The transaction submitted by the EOA is called the Originating Transaction. The transactions that the Originating Transaction causes to be submitted are called Subordinate Transactions. Subordinate Views may also be triggered. In Figure 1, a Subordinate View is used to call funcC. This function returns a value to funcB. The EOA user constructs the nested transaction by first creating the signed Subordinate View for Private Blockchain C and the signed Subordinate Transaction for Private Blockchain D. They then create the signed Subordinate Transaction for Private Blockchain B, encapsulating the signed Subordinate Transaction and View. Finally, they sign the Originating Transaction for Private Blockchain A, including the signed Subordinate Transactions and View.
嵌套交易:原子跨链交易是嵌套的以太坊交易和视图。图 1 显示了一个外部账户(EOA)调用区块链私有区块链 A 上的合约 ConA 中的函数 funcA。该函数依次调用函数 funcB,后者又调用
函数 funcC 和 funcD,每个都在不同的区块链上。 EOA 提交的交易称为发起交易。原始事务导致提交的事务称为从属事务。也可以触发从属视图。在图 1 中,一个子视图用于调用 funcC。此函数向 funcB 返回一个值。 EOA 用户通过首先为私有创建签名的从属视图来构建嵌套事务
2). Per-Node Transaction Processing: When the EOA submits the Originating Transaction to a node, the node processes the transaction using the algorithm shown in Listing 1. If the transaction includes any Subordinate Views, they are dispatched and their results are cached (Lines 1 to 3). The function is then executed (Lines 4 to 17). If a Subordinate Transaction function call is encountered, the node checks that
the parameter values passed to the Subordinate Transaction function call match the parameter values in the signed Subordinate Transaction (Lines 6 to 8). If a Subordinate View function call is encountered, the node checks that the parameters passed to the Subordinate View function call match the parameter
values in the signed Subordinate View (Lines 9 and 10). The cached values of the results of the Subordinate View function calls are then returned to the executing code (Line 11). If the execution has completed without error, then each of the signed Subordinate Transactions is submitted to a node on the
appropriate blockchain (Nodes 18 to 20).
每节点事务处理:当 EOA 向节点提交发起事务时,该节点使用清单 1 中所示的算法处理事务。如果事务包括任何从属视图,它们将被分派并缓存它们的结果(第 1 行到3)。然后执行该函数(第 4 到 17 行)。如果遇到从属事务函数调用,节点会检查
传递给从属事务函数调用的参数值与已签名的从属事务(第 6 行到第 8 行)中的参数值匹配。如果遇到从属视图函数调用,节点会检查传递给从属视图函数调用的参数是否与参数匹配
带符号的从属视图中的值(第 9 行和第 10 行)。子视图函数调用结果的缓存值然后返回到执行代码(第 11 行)。如果执行已完成且没有错误,则将每个已签名的从属事务提交给节点上的一个节点。
适当的区块链(节点 18 到 20)。
3). Blockchain Signing and Threshold Signatures: BLS Threshold Signatures [6], [7] combines the ideas of threshold cryptography [18] with Boneh-Lynn-Shacham(BLS) signatures [5], and uses a Pedersen commitment scheme [19] to ensure verififiable secret sharing. The scheme allows any M validator nodes of the total N validator nodes on a blockchain to sign messages in a distributed way such that the private
key shares do not need to be assembled to create a signature. Each validator node creates a signature share by signing the message using their private key share. Any M of the total N signature shares can be combined to create a valid signature. Importantly, the signature contains no information about which
nodes signed, or what the threshold number of signatures (M)needed to create the signature is.
The Atomic Crosschain Transaction system uses BLS Threshold Signatures to prove that information came from a specifific blockchain. For example, in Figure 1, nodes on Private Blockchain B can be certain of results returned by a node on Private Blockchain C for the function call to funcC, as the results are threshold signed by the validator nodes on Private Blockchain C. Similarly, validator nodes on Private Blockchain A can be certain that validator nodes on Private Blockchain B have mined the Subordinate Transaction, locked contract ConB and are holding the updated state as a provisional update
because validator nodes sign a Subordinate Transaction Ready message indicating that the Subordinate Transaction is ready to be committed.
区块链签名和阈值签名:BLS阈值签名[6]、[7]结合了阈值密码学[18]和Boneh-Lynn-Shacham(BLS)签名[5]的思想,并使用了Pedersen承诺方案[19]以确保可验证的秘密共享。该方案允许区块链上总共 N 个验证者节点中的任何 M 个验证者节点以分布式方式签署消息,使得私有
不需要组合密钥共享来创建签名。每个验证器节点通过使用其私钥共享对消息进行签名来创建签名共享。可以组合总共 N 个签名份额中的任何 M 个以创建有效签名。重要的是,签名不包含关于哪个
节点签名,或创建签名所需的签名阈值 (M) 数是多少。
原子跨链交易系统使用 BLS 阈值签名来证明信息来自特定的区块链。例如,在图 1 中,私有区块链 B 上的节点可以确定私有区块链 C 上的节点为函数调用 funcC 返回的结果,因为结果是由私有区块链 C 上的验证器节点签名的阈值。类似地,验证器私有区块链 A 上的节点可以确定私有区块链 B 上的验证者节点已经挖掘了从属交易,锁定了合约 ConB 并持有更新的状态作为临时更新
因为验证器节点签署了一个从属事务就绪消息,表明该从属事务已准备好提交。
4). Multichain Nodes: A Multichain Node is a logical grouping of one or more blockchain validator nodes, where each node is on a different blockchain. The blockchain nodes operate together to allow Crosschain Transactions. The Multichain Node on which the transaction is submitted must have Validator Nodes on all of the blockchains on which the Originating Transaction and Subordinate Transactions and Views take place. Figure 2 shows four enterprises that have validator nodes on Private Blockchain A to Private Blockchain D. An Enterprise 1 EOA can submit Atomic Crosschain Transactions that span
Private Blockchain A to Private Blockchain D as Enterprise 1 has a Multichain Node that
includes validator nodes on each blockchain. However, an Enterprise 4 EOA can only submit Atomic Crosschain Transactions that span Private Blockchain B and Private Blockchain C as Enterprise 4 only has validator nodes on Private Blockchain B and Private Blockchain C.
多链节点:多链节点是一个或多个区块链验证器节点的逻辑分组,其中每个节点位于不同的区块链上。区块链节点一起运行以允许跨链交易。提交交易的多链节点必须在所有发生原始交易和从属交易和视图的区块链上都有验证器节点。图 2 显示了在私有区块链 A 到私有区块链 D 上拥有验证器节点的四家企业。 企业 1 EOA 可以提交跨越的原子跨链交易
私有区块链 A 到私有区块链 D 作为企业 1 有一个多链节点
包括每个区块链上的验证器节点。但是,企业 4 EOA 只能提交跨越私有区块链 B 和私有区块链 C 的原子跨链交易,因为企业 4 只有私有区块链 B 和私有区块链 C 上的验证器节点。
5). Crosschain Coordination: Crosschain Coordination
Contracts exist on Coordination Blockchains. They allow validator nodes to determine whether the provisional state updates related to the Originating Transaction and Subordinate Transactions should be committed or discarded. The contract is also used to determine a common time-out for all blockchains, and as a repository of Blockchain Public Keys. When a user creates a Crosschain Transaction, they specify the Coordination Blockchain and Crosschain Coordination Contract to be used for the transaction, and the time-out for the transaction in terms of a block number on the Coordination Blockchain. The validator node that they submit the Originating Transaction to (the Originating Node) works with other validator nodes on the blockchain to sign a Crosschain Transaction Start message. This message is submitted to the Crosschain Coordination Contract to indicate to all nodes on all blockchains that the Crosschain Transaction has commenced. When the Originating Node has received Subordinate Transaction Ready messages for all Subordinate Transactions, it works with other validator nodes to create a Crosschain Trans action Commit message. This message is submitted to the Crosschain Coordination Contract to indicate to all nodes on all blockchains that the Crosschain Transaction has completed and all provisional updates should be committed. If an error is detected, then a Crosschain Transaction Ignore message is created and submitted to the Crosschain Coordination Contract to indicate to all nodes on all blockchains that the Crosschain Transaction has failed and all provisional updates should be discarded. Similarly, if the transaction times-out, all provisional updates will be discarded.
跨链协调:跨链协调
合约存在于协调区块链上。它们允许验证器节点确定是否应该提交或丢弃与原始交易和从属交易相关的临时状态更新。该合约还用于确定所有区块链的共同超时,并作为区块链公钥的存储库。当用户创建跨链交易时,他们指定要用于交易的协调区块链和跨链协调合约,以及根据协调区块链上的块号的交易超时。他们提交原始交易的验证器节点(原始节点)与之合作区块链上的其他验证器节点签署跨链交易开始消息。该消息被提交到跨链协调合约,以向所有区块链上的所有节点表明跨链交易已经开始。当始发节点收到从属传输所有从属交易的 action Ready 消息,它与其他验证器节点一起创建一个 Crosschain Trans action Commit 消息。这条消息被提交到跨链协调合约,以向所有区块链上的所有节点表明跨链交易已经完成并且应该提交所有临时更新。如果检测到错误,则创建跨链事务忽略消息并将其提交给跨链协调合约,以向所有区块链上的所有节点表明跨链事务已失败,所有临时更新都应丢弃。同样,如果事务超时,所有临时更新将被丢弃。
6). Contract Locking and Provisional State Updates: When a contract is first deployed it is marked as a Lockable Contract or a Nonlockable Contract. A Nonlockable Contract, the default, is one which can not be locked. When a node attempts to update the state of a contract given an Originating or Subordinate Transaction, it checks whether the contract is Lockable and whether it is locked. The transaction fails if the contract is Nonlockable or if the contract is Lockable but is locked. The act of mining an Originating Transaction or Subordinate Transaction and including it in a blockchain locks a contract.
The contract can be unlocked when the Crosschain Coordination Contract is in the Committed or Ignored state, or when the block number on the Coordination Blockchain is greater than the Transaction Timeout Block Number. The Crosschain Coordination Contract will change from the Started state to the Committed state when a Crosschain Transaction Commit message is submitted to it, and it will change to the Ignored state when a Crosschain Transaction Ignore message is submitted to it. When the Crosschain Coordination Contract indicates that the crosschain transaction has completed, or when the transaction has timed-out, Signalling Transactions are submitted on all blockchains that have locked contracts. The act of mining the Signalling Transaction unlocks all locked contracts. Originating Transactions, Subordinate Transactions, and Subordinate Views contain additional fifields over and above those used in traditional Ethereum transactions [1]. The additional fifields provide cross blockchain context and security
合约锁定和临时状态更新:当合约首次部署时,它被标记为可锁定合约或不可锁定合约。不可锁定合约,默认情况下,是一个不能被锁定的合约。当节点尝试更新给定原始交易或从属交易的合约状态时,它会检查合约是否可锁定以及是否已锁定。如果交易失败
合同是不可锁定的,或者合同是可锁定的但被锁定。挖掘原始交易或从属交易并将其包含在区块链中的行为会锁定合同。
当跨链协调合约处于 Committed 或 Ignored 状态,或者协调区块链上的区块数大于交易超时区块数时,可以解锁合约。跨链协调合约将从 Started 状态变为
向其提交跨链事务提交消息时的 Committed 状态,当向其提交 Crosschain Transaction Ignore 消息时,它将更改为 Ignored 状态。
当跨链协调合约指示跨链交易已完成或交易超时时,在所有已锁定合约的区块链上提交信令交易。挖掘信号交易的行为解锁所有锁定的合约。
原始交易、从属交易和从属视图包含额外的字段用于传统以太坊交易的那些 [1]。额外的 fifield 提供跨区块链上下文和安全性
III. SCENARIOS
A. Hotel and Train
RouterContract 可以做到并发