<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Qanaat: a scalable multi-enterprise permissioned blockchain system with confidentiality guarantees</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>07/01/2022</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10428206</idno>
					<idno type="doi">10.14778/3551793.3551835</idno>
					<title level='j'>Proceedings of the VLDB Endowment</title>
<idno>2150-8097</idno>
<biblScope unit="volume">15</biblScope>
<biblScope unit="issue">11</biblScope>					

					<author>Mohammad Javad Amiri</author><author>Boon Thau Loo</author><author>Divyakant Agrawal</author><author>Amr El Abbadi</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Today's large-scale data management systems need to address distributed applications'              confidentiality              and              scalability              requirements among a set of collaborative enterprises. This paper presents              Qanaat              , a scalable multi-enterprise permissioned blockchain system that guarantees the confidentiality of enterprises in collaboration workflows. Qanaat presents              data collections              that enable any subset of enterprises involved in a collaboration workflow to keep their collaboration private from other enterprises. A transaction ordering scheme is also presented to enforce only the necessary and sufficient constraints on transaction order to guarantee data consistency. Furthermore, Qanaat supports data consistency across collaboration workflows where an enterprise can participate in different collaboration workflows with different sets of enterprises. Finally, Qanaat presents a suite of consensus protocols to support intra-shard and cross-shard transactions within or across enterprises.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>Emerging multi-enterprise applications, e.g., supply chain management <ref type="bibr">[55]</ref>, multi-platform crowdworking <ref type="bibr">[9]</ref>, and healthcare <ref type="bibr">[15]</ref>, require extensive use of collaboration workflows where multiple mutually distrustful distributed enterprises collaboratively process a mix of public and private transactions. Despite years of research in distributed transaction processing, data management systems today have not yet achieved a good balance among the confidentiality and scalability requirements of these applications.</p><p>One of the main requirements of multi-enterprise applications is confidentiality with respect to data sharing and data leakage. First, while public collaboration among all enterprises is visible to everyone, specific subsets of the data may need to be shared only with specific subsets of involved enterprises. For example, in a product trading, the distributor may want to keep collaboration with a farmer and a shipper involving terms of the trades confidential from the wholesaler and the retailer, so as not to expose the premium they are charging <ref type="bibr">[50]</ref>. Second, the enterprises must prevent malicious nodes from leaking confidential data, e.g., requests, replies, and stored data.</p><p>Multi-enterprise applications also need to scalably process a large number of transactions within or across enterprises. Although sharding has been used in single-enterprise applications to address scalability, it is challenging to use sharding in multi-enterprise applications where confidentiality of data is paramount.</p><p>The decentralized nature of blockchain and its unique features such as provenance, immutability, and tamper-resistant, make it appealing to a wide range of applications, e.g., supply chain management <ref type="bibr">[31,</ref><ref type="bibr">84]</ref>, crowdsourcing <ref type="bibr">[9,</ref><ref type="bibr">48]</ref>, contact tracing <ref type="bibr">[70]</ref> and federated learning <ref type="bibr">[71]</ref>.</p><p>In recent years, various permissioned blockchain systems have been proposed to address the confidentiality and/or scalability of multi-enterprise applications. Hyperledger Fabric <ref type="bibr">[12]</ref> and its variants <ref type="bibr">[44,</ref><ref type="bibr">45,</ref><ref type="bibr">75,</ref><ref type="bibr">78]</ref> supports multi-enterprise applications and provides scalability using channels <ref type="bibr">[13]</ref> managed by subsets of enterprises. However, all transactions of a channel are sequentially ordered, resulting in reduced performance. Fabric also uses private data collections <ref type="bibr">[50]</ref> to manage confidential collaboration among a subset of enterprises. However, appending a hash of all private transactions to a global ledger replicated on every enterprise increases computational overhead and hence reduces throughput. Furthermore, Fabric does not address confidential data leakage by malicious nodes.</p><p>Caper <ref type="bibr">[5]</ref> supports collaborative enterprises and provides confidentiality by maintaining a partial view of the global ledger on each enterprise. Caper, however, does not support: (1) confidential collaboration among subsets of enterprises (i.e., it supports internal or public transactions), (2) data consistency across collaboration workflows that an enterprise is involved in, (3) data confidentiality in the presence of malicious nodes, and (4) multi-shard enterprises.</p><p>Scalability has also been studied in the context of applications that are used within a single enterprise, e.g., AHL <ref type="bibr">[35]</ref>, SharPer <ref type="bibr">[8]</ref> and ResilientDB <ref type="bibr">[47]</ref>. However, since these systems are restricted to single-enterprise applications, they do not address the confidentiality requirement of multi-enterprise applications.</p><p>To address the above scalability and confidentiality challenges of multi-enterprise applications, we present Qanaat 1 , a permissioned blockchain system that supports collaboration workflows across enterprises. In Qanaat, each enterprise partitions its data into multiple shards to improve scalability. Each shard's transactions are then processed by a disjoint cluster of nodes.</p><p>To support confidential collaboration (i.e., data sharing), in addition to public transactions among all enterprises and internal transactions within each enterprise, any subset of enterprises might process transactions confidentially from other enterprises. As a result, Qanaat uses a novel hierarchical data model consisting of a set of data collections where each transaction is executed on a data collection. The root data collection consists of the public records from executing public transactions replicated on all enterprises. Each local data collection includes the private records of a single enterprise. Intermediate data collections, which are optional and are needed in case of confidential collaborations among subsets of enterprises, maintain private records shared among subsets of collaborating enterprises. Qanaat replicates such shared data collections on the involved enterprises to facilitate the use of shared data by enterprises in their internal transactions.</p><p>To support this collaborative yet confidential data model, Qanaat proposes a transaction ordering scheme to preserve the data consistency of transactions. In Qanaat, an enterprise might be involved in multiple data collections. Hence, the traditional transaction ordering schemes used in fault-tolerant protocols where each cluster orders transactions on a single data store do not work. In fact, while ordering transactions, Qanaat needs to capture the state of all data collections that might affect the execution of a transaction.</p><p>Finally, to prevent confidential data leakage despite the Byzantine failure of nodes, Qanaat utilizes the privacy firewall technique <ref type="bibr">[39,</ref><ref type="bibr">86]</ref> and <ref type="bibr">(1)</ref> separates ordering nodes that agree on the order of transactions from execution nodes that execute transactions and maintain the ledger, and (2) uses a privacy firewall between execution nodes and ordering nodes. The privacy firewall restricts communication from execution nodes in order to filter out incorrect messages, possibly including confidential data.</p><p>The main contributions of this paper are:</p><p>&#8226; An infrastructure consisting of ordering nodes, execution nodes, and a privacy firewall and a data model consisting of data collections to preserve confidentiality, followed by a transaction ordering scheme that enforces only the necessary and sufficient constraints to guarantee data consistency, &#8226; A suite of consensus protocols to process transactions that accesses single or multiple data shards within or across enterprises in a scalable manner, and &#8226; Qanaat, a scalable multi-enterprise permissioned blockchain system that guarantees confidentiality.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">MOTIVATION</head><p>Qanaat is designed to support multi-enterprise applications such as supply chain management <ref type="bibr">[55]</ref>, multi-platform crowdworking <ref type="bibr">[9]</ref>, and healthcare <ref type="bibr">[15]</ref> in a scalable and confidentiality-preserving manner. To motivate Qanaat, we consider an example application based on the COVID-19 vaccine supply chain, given that it is a demanding application. The COVID-19 outbreak has demonstrated diverse challenges that supply chains face <ref type="bibr">[4]</ref>. While the vaccine supply chain seems to work fine on the surface, it suffers from countries <ref type="bibr">[69]</ref>, rapidly growth of the black market for COVID-19 vaccines <ref type="bibr">[81]</ref>, issuing fake vaccine cards <ref type="bibr">[73]</ref>, and loss of 400 millions of vaccine doses <ref type="bibr">[24]</ref>. Moreover, while vaccines are well distributed in most developed countries, getting them to developing countries and accounting for them remains a challenge, e.g., fake vaccines <ref type="bibr">[1,</ref><ref type="bibr">33]</ref> and falsified CoviShield vaccines <ref type="bibr">[67]</ref>. Currently, the COVID-19 vaccine supply chains have been over-stretched given the global supply chain challenges and the possibility of abuse and fraud stated above. At the same time, other supply chains are now under unprecedented pressure <ref type="bibr">[18,</ref><ref type="bibr">76]</ref>.</p><p>Multiple enterprises collaborate in a vaccine supply chain to get vaccines from manufacturers to citizens. Enterprises involved in the vaccine ecosystem need to collaborate and share data based on agreed-upon service level agreements. Vaccines, on one hand, need to be tracked and monitored throughout the process to ensure that they are stable and not tampered with, and on the other hand, this data should be accessible to the public to increase their trust in the vaccines. While distributed databases can be used to address these challenges, they lack mechanisms to first prevent any malicious entity from altering data and second enable enterprises to verify the data and the state of collaboration. Qanaat uses blockchains to provide verifiability, provenance, transparency, and assurances to end-users of the vaccines' safety and efficacy. In particular, blockchains enable pharmaceutical manufacturers to easily track on-time shipment and delivery of vaccines, provide efficient delivery tracking for transportation companies, and help hospitals manage their stocks and mitigate supply and demand constraints.</p><p>Figure <ref type="figure">1</ref> shows a simplified vaccine supply chain collaboration workflow consisting of the pharmaceutical manufacturer (M), a supplier (S), a logistics provider (L), a transportation company (T), and hospitals (H). Using Qanaat, the public transactions of the collaboration workflow (&#119879; 1 to &#119879; 8 ) are executed on data collection &#119889; &#119872;&#119878;&#119871;&#119879; &#119867; maintained by all enterprises.</p><p>In addition, the collaboration workflow includes the internal transactions of each enterprise. Internal transactions are executed on the enterprise's private data collection and might reflect patented and copyrighted formulas and information. For example, the pharmaceutical manufacturer executes its private transactions &#119879; &#119872;1 to &#119879; &#119872;6 on its private data collection &#119889; &#119872; .</p><p>A blockchain-enabled multi-enterprise application, e.g., vaccine supply chain, needs to support the following requirements: R1. Confidential collaborations across enterprises. Any subset of enterprises involved in a collaboration workflow might want to keep their collaboration private from other enterprises. For example, the supplier might want to make private transactions with the pharmaceutical manufacturer to keep some terms of trade confidential from other enterprises, e.g., price quotation (&#119879; &#119872;&#119878;1 ) transaction. Such private transactions need to be executed on a data collection shared between only the involved enterprises, e.g., &#119889; &#119872;&#119878; between the pharmaceutical manufacturer and the supplier. R2. Consistency across collaboration workflows. An enterprise might be involved in multiple collaboration workflows with different sets of enterprises. For example, a transportation company that distributes both Pfizer and Moderna vaccines needs to assign trucks based on the total number of vaccine packages. In case of data dependency among transactions that span collaboration workflows, data integrity and consistency must be maintained. R3. Confidential data leakage prevention. An enterprise needs to ensure that even if its infrastructure includes malicious nodes (i.e., an attacker manages to compromise some nodes), the malicious nodes cannot leak any confidential data, e.g., requests, replies, processed data and stored data. R4. Scaling multi-shard enterprises. Every day, millions of people get vaccinated, thousands of shipments take place and many other transactions are executed. All these activities need to be immediately processed by the system and specifically by all involved enterprises. A transportation company that distributes vaccines across the world might maintain its data in multiple data shards.</p><p>Existing blockchain solutions, however, are not able to meet all requirements of multi-enterprise collaboration workflows. While Caper <ref type="bibr">[5]</ref> enables enterprises to keep their local data confidential, it does not address any of the R1 to R4 requirements. Fabric <ref type="bibr">[12]</ref> addresses confidential collaboration using private data collection (although with a high overhead) and scalability using channels. However, Fabric does not support requirements R2 and R3. Several variants of Fabric, such as Fast Fabric <ref type="bibr">[45]</ref>, Fabric++ <ref type="bibr">[78]</ref>, Fabric-Sharp <ref type="bibr">[75]</ref>, and XOX Fabric <ref type="bibr">[44]</ref>, try to address the performance shortcomings of Fabric, especially when dealing with contentious workloads. However, these permissioned blockchain systems, similar to Fabric, suffer from the overhead of confidential collaboration and also do not support requirements R2 and R3.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">QANAAT MODEL</head><p>Qanaat is a permissioned blockchain system designed to support multi-enterprise applications. This section presents the Qanaat model and demonstrates how it supports different requirements of multi-enterprise applications.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Model Assumptions</head><p>Qanaat consists of a set of collaborative enterprises. Each enterprise owns a set of nodes (i.e., servers) that are grouped into different clusters. Each enterprise further partitions its data into multiple data shards. Each cluster of nodes maintains a shard of the enterprise data and processes transactions on that data shard.</p><p>Qanaat assumes the partially synchronous communication model. In the partially synchrony model, there exists an unknown global stabilization time (GST), after which all messages between correct nodes are received within some unknown bound &#916;. Qanaat inherits the standard assumptions of previous permissioned blockchain systems, including a strong computationally-bounded adversary that can coordinate malicious nodes and delay communication to compromise service, an unreliable network that connects nodes and might drop, corrupt, or delay messages, and the existence of pairwise authenticated communication channels, standard digital signatures and public-key infrastructure (PKI). A message &#119898; signed by node &#119894; is denoted as &#10216;&#119898;&#10217; &#120590; &#119894; . Qanaat further uses threshold signatures where each node &#119894; holds a distinct private key that is used to create a signature share &#120590; &#10216;&#119898;&#10217; &#119894; for message &#119898;. A node can generate a valid threshold signature &#120590; &#10216;&#119898;&#10217; for &#119898; given &#119899; -&#119891; signature shares from distinct nodes. A collision-resistant hash function &#119863; (.) is also used to map a message &#119898; to a constant-sized digest &#119863; (&#119898;).</p><p>We next present the data model (Section 3.2) and the blockchain ledger (Section 3.3) of Qanaat, which together address collaboration confidentiality (R1) and data consistency (R2) requirements and then demonstrate the Qanaat infrastructure (Section 3.4) that addresses the confidential data leakage prevention requirement (R3). For simplicity of presentation, we first consider single-shard enterprises and then show how the model and the ledger are extended to support multi-shard enterprises (Section 3.5), which addresses the scalability requirement (R4).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Data Model</head><p>Qanaat constructs a hierarchical data model consisting of a set of data collections for each collaboration workflow. Each data collection is a separate datastore where the execution of transactions updates its data. Each data collection further has its own (business) logic to execute transactions. Public transactions of a collaboration workflow, e.g., place order in the vaccine supply chain, are executed on the root data collection. All enterprises maintain the root data collection. This is needed because enterprises use the data maintained in the root data collection in other transactions. For example, the order data stored in the root data collection is used by the supplier in its private transactions to provide raw materials.</p><p>Internal private transactions of each enterprise, on the other hand, are executed on its local data collection. Internal transactions are performed within an enterprise following the logic of the enterprise, e.g., develop formulation, and package vaccines take place within the pharmaceutical manufacturer.</p><p>Any subset of enterprises might also execute private transactions among themselves and confidentially from other enterprises. Such transactions are executed on a data collection shared among and maintained by only the involved enterprises. For example, the supplier executes private transactions with the pharmaceutical company on the material demand on a data collection that is maintained only by the supplier and pharmaceutical company.</p><p>Figure <ref type="figure">2</ref>(a) presents a data model for a collaboration workflow with enterprises &#119860;, &#119861;, &#119862;, and &#119863;. At the top level, a public data collection &#119889; &#119860;&#119861;&#119862;&#119863; is stored on all four enterprises. At the bottom level, there are four private data collections &#119889; &#119860; , &#119889; &#119861; , &#119889; &#119862; , and &#119889; &#119863; stored on the corresponding enterprises. The figure also includes all possible private data collections with different subsets of enterprises, e.g., &#119889; &#119860;&#119861; or &#119889; &#119860;&#119862;&#119863; . When a subset of enterprises, e.g., &#119860; and &#119861;, creates a data collection, e.g., &#119889; &#119860;&#119861; , to execute private transactions, the shared data collection maintains the execution results of transactions that are executed on the data collection. Such data records are different from the records maintained in the data collection of each individual enterprise, e.g., &#119889; &#119860; and &#119889; &#119861; . In contrast to the root and the local data collections that are needed in every collaboration workflow, intermediate data collections are optional and needed only if there is a collaboration among a specific subset of enterprises.</p><p>Qanaat defines operational primitives necessarily to capture data consistency and data dependency across data collections. Write. The execution results of transactions executed on a data collection are written on the records of the same data collection. This is needed to guarantee collaboration confidentiality as (intermediate) data collections are created for private collaboration, e.g., private lobbying, among a subset of enterprises while preventing other enterprises from accessing the data. In particular, if enterprises &#119860; and &#119861; make a confidential collaboration, the resulting data should not be written on a data collection that is either shared with some other enterprise &#119862; or not shared with one of the involved enterprises, e.g., &#119889; &#119860; . Note that &#119889; &#119860;&#119861; is maintained by both enterprises &#119860; and &#119861; and they have access to its record. This captures the confidential collaborations in real-world cross-enterprise applications. Read. When a transaction is being executed on a data collection &#119889; &#119883; , it might read records of a data collection &#119889; &#119884; if enterprises sharing &#119889; &#119883; are a subset of the enterprises sharing &#119889; &#119884; . For example, the internal transactions of the supplier can read the records of all data collections that the supplier is involved in with other enterprises. This is needed because those records might affect the internal transactions of the supplier, e.g., the number of vaccines that the supplier supplies depends on the orders it receives from other enterprises.</p><p>More formally, given a data collection &#119889; &#119883; where &#119883; is the set of enterprises sharing &#119889; &#119883; . For each data collection &#119889; &#119884; where &#119883; &#8838; &#119884; , we define &#119889; &#119883; as order-dependent of &#119889; &#119884; . We say transactions executed on &#119889; &#119883; can read the records of &#119889; &#119884; if data collection &#119889; &#119883; is orderdependent on &#119889; &#119884; . The dashed lines between data collections in Figure <ref type="figure">2</ref>(a) present order-dependency among data collections; the transactions executed on the lower-level data collections can read the records of the higher-level data collections, e.g., &#119889; &#119860;&#119861; can read &#119889; &#119860;&#119861;&#119862; , &#119889; &#119860;&#119861;&#119863; and &#119889; &#119860;&#119861;&#119862;&#119863; .</p><p>In some applications, transactions that are executed on data collection &#119889; &#119883; might also need to verify the records of another data collection &#119889; &#119884; in a privacy-preserving manner (i.e., without reading the exact records) if enterprises sharing &#119889; &#119883; are a superset of the enterprises sharing &#119889; &#119884; , i.e., &#119884; &#8834; &#119883; .</p><p>In particular, for intangible assets, e.g., cryptocurrencies, if enterprise &#119860; initiates a transaction in data collection &#119889; &#119860;&#119861; that consumes some coins, enterprise &#119861; needs to verify the existence of the coins in data collection &#119889; &#119860; . In supply chain workflows, however, since transactions are usually placed as a result of physical actions, verifying the records of order-dependent data collections is unnecessary. Qanaat can be extended to support privacy-preserving verifiability using advanced cryptographic primitives like secure multiparty computation <ref type="bibr">[14,</ref><ref type="bibr">40]</ref> and zero-knowledge proofs <ref type="bibr">[42,</ref><ref type="bibr">57,</ref><ref type="bibr">61]</ref>.</p><p>Every enterprise maintains all data collections that the enterprise is involved in, i.e., the root, a local, and perhaps several intermediate data collections. Qanaat replicates shared data collections on all involved enterprises to facilitate the use of shared data by the transactions on order-dependent data collections. Note that such shared data collections can be maintained by a third party, e.g., a cloud provider, trusted by all enterprises. However, this is a centralized solution that contradicts the decentralized nature of blockchains. Moreover, the data maintained in a shared data collection might be used (i.e., read) in transactions on all order-dependent data collections. Hence, enterprises need to query the cloud for every simple read operation to access the data.</p><p>As shown in Figure <ref type="figure">2</ref>(b), enterprise &#119860; maintains local data collection &#119889; &#119860; , root data collection &#119889; &#119860;&#119861;&#119862;&#119863; , and all intermediate data collections (if exist), e.g., &#119889; &#119860;&#119861; and &#119889; &#119860;&#119862;&#119863; .</p><p>A data model represents data processed by each collaboration workflow among a set of enterprises. However, an enterprise (or a group of enterprises) might be involved in multiple collaboration workflows (instances of Qanaat) with different sets of enterprises. The transactions of the same enterprise in different collaboration workflows might be data-dependent. Creating an independent data collection for each enterprise in each collaboration workflow might result in data consistency issues. For example, a supplier that provides raw materials for both Pfizer and Moderna vaccines in two different supply chain collaboration workflows needs to know the total number of the requested materials in order to provision for them correctly. As a result, Qanaat creates a single data collection for each enterprise and if an enterprise is involved in multiple possibly data-dependent collaboration workflows, the transactions of the enterprise in different collaboration workflows are executed on the same data collection. An enterprise might also collaborate with enterprises outside Qanaat and require to access its data. Such data operations can be performed on the enterprise's local data collection without violating data consistency enabling the enterprise to use such data in its collaboration workflows within Qanaat. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Blockchain Ledger</head><p>The blockchain ledger is an append-only data structure to maintain transaction records. When several enterprises execute transactions across different data collections, maintaining consistency and preserving confidentiality in a scalable manner is challenging. Before describing the Qanaat ledger, we discuss three possible solutions for ordering transactions in cross-enterprise collaborations.</p><p>1. A single, global ledger. One possibility is to construct a linear blockchain ledger for each collaboration workflow where all transactions on all data collections are totally ordered and appended to a single global ledger. To preserve the confidentiality of private transactions, the cryptographic hash of such transactions (instead of the actual transaction) can be maintained in the blockchain ledger. This technique, which has been used in Hyperledger Fabric <ref type="bibr">[12]</ref>, suffers from two main shortcomings. First, forcing all transactions into a single, sequential order unnecessarily degrades performance, especially in the large-scale collaborations targeted by Qanaat. To see this, note that while total ordering is needed for data-dependent transactions, e.g., transactions executed on the same data collection, to preserve data consistency, total ordering among transactions of independent data collections, e.g., &#119889; &#119860; and &#119889; &#119861; , is clearly not needed. Second, since this solution requires a single, global blockchain ledger to be maintained by every enterprise, each enterprise needs to maintain (the hash of) transactions that the enterprise was not involved in, e.g., internal transactions of other enterprises, which increases bandwidth and storage costs. 2. One ledger for each data collection. A second possibility is to maintain a separate transaction ordering (i.e., linear blockchain ledger) for each data collection. The blockchain ledger of each enterprise then consists of multiple parallel linear ledgers (one per each data collection that the enterprise is involved in). This solution, however, does not consider dependencies across order-dependent data collections where the execution of a transaction might require reading records from other data collections. Such dependencies need to be captured during the ordering phase to ensure that all replicas read the same state in the execution phase. Note that the read-set and write-set of transactions might not be known before execution. As a result, writing the read values into the block is not possible in the ordering phase.</p><p>For example, consider an internal transaction of the supplier that reads the order record of the root data collection and based on that, computes and stores the results. In the meantime (during the period from the initiation to the execution of the transaction), the value of the order record might change. As a result, if the state of the root data collection has not been captured, different nodes (i.e., replicas) of the supplier, might read different values (old or new) of the order in the execution phase resulting in inconsistency. 3. One ledger for each enterprise. A third solution is to maintain a total order among all transactions in which an enterprise is involved. This solution, in contrast to the second solution, guarantees data consistency. However, similar to the first solution, this solution prevents order-independent transactions from being appended to the ledger in parallel. For example, transactions on data collections &#119889; &#119860;&#119861; have no data dependency with transactions on &#119889; &#119860;&#119862; and can append to the ledger of enterprise &#119860; in parallel.</p><p>Qanaat addresses the shortcomings of the existing solutions in guaranteeing data consistency and preserving collaboration confidentiality while creating a ledger in an efficient and scalable manner. In Qanaat, the blockchain ledger guarantees two main properties:</p><p>&#8226; Local consistency. A total order on the transactions of each data collection is enforced due to data dependency among transactions executed on a data collection, and &#8226; Global consistency. The order of the transactions of data collection &#119889; &#119883; with respect to the transactions of all data  </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Qanaat Infrastructure</head><p>In Qanaat, nodes follow either the crash failure model or the Byzantine failure model. To guarantee fault tolerance, clusters with crash-only nodes include 2&#119891; +1 nodes. In the presence of Byzantine nodes, 3&#119891; +1 nodes are needed to provide fault tolerance <ref type="bibr">[22]</ref>. The malicious nodes, however, can violate data confidentiality by leaking requests, replies, and data stored and processed at the nodes.</p><p>To prevent confidential data leakage (known as intrusion tolerance <ref type="bibr">[54,</ref><ref type="bibr">85]</ref>), Qanaat can use either of the following two techniques: <ref type="bibr">(1)</ref> restricting the data that nodes can access <ref type="bibr">[19,</ref><ref type="bibr">20,</ref><ref type="bibr">62,</ref><ref type="bibr">68,</ref><ref type="bibr">85]</ref> using secret sharing schemes, or (2) adding a privacy firewall between the ordering nodes and the execution nodes <ref type="bibr">[39,</ref><ref type="bibr">86]</ref>.</p><p>In the secret sharing scheme, clients encode data using an (&#119891; + 1, &#119899;)-threshold secret sharing scheme, where &#119891; + 1 shares out of &#119899; total shares are needed to reconstruct the confidential data <ref type="bibr">[54]</ref>. Secret sharing schemes only perform basic store and retrieve operations (Belisarius <ref type="bibr">[68]</ref> also supports addition) and do not support general transactions that require nodes to manipulate the contents of stored data. As a result, this technique is not suitable for blockchain systems that are supposed to support complex transactions.</p><p>In the privacy firewall mechanism <ref type="bibr">[86]</ref>, the infrastructure consists of 3&#119891; + 1 ordering nodes (where &#119891; is the maximum number of malicious ordering nodes) that run a BFT protocol to order client requests, 2&#119892; + 1 execution nodes (where &#119892; is the maximum number of malicious execution nodes) that maintain data and deterministically execute arbitrary transactions following the order assigned by ordering nodes, and a privacy firewall consisting of a set of &#8462; + 1 rows of &#8462; + 1 filters (where &#8462; is the maximum number of malicious filter nodes) between the ordering nodes and execution nodes. The privacy firewall architecture assumes a network configuration that physically restricts communication paths between ordering nodes, filters, and execution nodes, i.e., clients can only communicate with ordering (and not execution) nodes, and each filter has a physical network connection only to all (filter) nodes in the rows above and below. As a result, a malicious node can either access confidential data (an execution node or a filter) or communicate freely with clients (an ordering node) but not both. The &#8462; + 1 rows of &#8462; + 1 filters guarantee that first, there is at least one path between execution nodes and ordering nodes which only consists of non-faulty filters (liveness) and second, since there are &#8462; + 1 rows and maximum &#8462; malicious filters, there exist a row consisting of only non-faulty filters that filters any malicious message (possibly including confidential data). As a result, the rows below have no access to any confidential data leaked by malicious execution nodes. Note that if &#8462; &#8804; 3&#119891; , ordering nodes can be merged with the bottom row of filters by placing a filter on each ordering node. In most applications, request and reply bodies must also be encrypted, thus, ordering nodes cannot read them (while clients and execution nodes can).</p><p>By separating ordering nodes from execution nodes, a simple majority of non-faulty nodes is sufficient to mask Byzantine failure among execution nodes, i.e., 2&#119892; + 1 execution nodes can tolerate &#119892; Byzantine faults. This is important because, compared to ordering, executing transactions, and maintaining the application logic (e.g., smart contracts) and data require more powerful computation, storage, and I/O resources. The overhead of the privacy firewall mechanism can be reduced by adding &#8462; filters to each row while providing a higher degree of confidentiality <ref type="bibr">[39]</ref>.</p><p>Separating ordering nodes from execution nodes and using a privacy firewall comes with extra resource costs because ordering nodes and execution nodes need to be physically separated. However, if a cluster is deployed in a cloud platform, ordering nodes and execution nodes can match the control layer and computing nodes, respectively. Similarly, tools such as internal authorization services, node auditors, and load balancers deployed in existing cloud platforms can be used as privacy firewalls <ref type="bibr">[39]</ref>.</p><p>Qanaat prevents confidential data leakage despite Byzantine failure using the privacy firewall mechanism presented in <ref type="bibr">[86]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.5">Multi-Shard Enterprises</head><p>We now show how the data model and the blockchain ledger can be extended to support multi-shard enterprises. With single-shard enterprises, every execution node of each enterprise maintains all data collections that the enterprise is involved in. Enterprises, however, partition their data into different shards. Each data shard is then assigned to a cluster of nodes where ordering nodes of the cluster order the transactions and execution nodes maintain the data shard and execute transactions on the data shard.</p><p>We assume that enterprises use the same sharding schema for each shared data collection to facilitate transaction processing across different enterprises. The schema is agreed upon by all involved enterprises when a data collection is created, i.e., the sharding schema is part of the configuration metadata. Using the same sharding schema leads to a more efficient ordering phase for crossenterprise transactions because there is no need for all involved enterprises to run a consensus protocol to agree on the order of every transaction. For each cross-enterprise transaction, one enterprise orders the transaction and other involved enterprises only validate the order (details in Sections 4.3 and 4.4). Furthermore, different data shards of an enterprise are processed by different clusters. Using the same sharding schema, enterprises can easily communicate with the right cluster that processes the data records of transactions. If enterprises use different sharding schemas for a shared data collection, Qanaat could still process cross-enterprise transactions but with the overhead required to execute a consensus protocol with every transaction on each cluster.</p><p>The blockchain ledger of a single-shard enterprise maintains all transactions that are executed on the enterprise data. In a multishard enterprise, the enterprise data is partitioned into different shards where each shard is replicated on a cluster of execution nodes. Since each cluster maintains a separate data shard, it executes a different set of transactions. As a result, each cluster in a multishard enterprise needs to maintain a different ledger. The ledger of each cluster of a multi-shard enterprise, however, is constructed in the same way as a single-shard enterprise. Moreover, the notion of global consistency is extended to guarantee that each cross-shard transaction is ordered across participating shards consistently.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">TRANSACTION PROCESSING IN QANAAT</head><p>Processing transactions requires establishing consensus on a unique order of requests. Fault-tolerant protocols use the State Machine Replication (SMR) technique <ref type="bibr">[59,</ref><ref type="bibr">77]</ref> to assign each client request an order in the global service history. In an SMR fault-tolerant protocol, all non-faulty nodes execute the same requests in the same order (safety) and all correct client requests are eventually executed (liveness). Qanaat guarantees safety in an asynchronous network, however, it considers a synchrony assumption to ensure liveness (due to FLP results <ref type="bibr">[41]</ref>).</p><p>A transaction might be executed on a single shard or on multiple shards of a data collection where the data collection belongs to a single enterprise (i.e., a local data collection) or is shared among multiple enterprises (i.e., a root or an intermediate data collection).   In Qanaat, cross-shard intra-enterprise transactions and intrashard cross-enterprise transactions are handled differently. In a cross-shard intra-enterprise transaction, different clusters maintain separate data shards. As a result, each cluster needs to separately reach agreement on the transaction order among transactions of its shard. However, in an intra-shard cross-enterprise transaction, since the involved enterprises use the same sharding schema for each shared data collection, the cluster that initiates the transaction and all the involved clusters process the transaction on the same shard of data. Hence, the order of transactions on different clusters is the same. As a result, it is sufficient that one (initiator) cluster determines the order and other clusters only validate the suggested order. Note that while the involved clusters belong to different distrustful enterprises, all clusters can detect any malicious behavior of the initiator cluster. We will discuss how Qanaat addresses all possible malicious behaviors, e.g., assigning invalid ID (order) or even not sending the transaction to other clusters. In cross-enterprise collaboration, enterprises cannot trust that the other enterprise nodes might not be compromised. As a result, independent of the declared failure model of nodes, Qanaat uses a BFT protocol to order cross-enterprise transactions. For cross-shard intra-enterprise transactions, on the other hand, the involved clusters belong to the same enterprise and trust each other. As a result, if all nodes are crash-only, cross-shard consensus can be achieved using a crash fault-tolerant protocol.</p><p>To process transactions across clusters coordinator-based and flattened approaches are used. In the coordinator-based approach, inspired by existing permissioned blockchains such as AHL <ref type="bibr">[35]</ref>, Saguaro <ref type="bibr">[10]</ref>, and Blockplane <ref type="bibr">[65]</ref>, a cluster coordinates transaction ordering, whereas, in the flattened approach, transactions are ordered across the clusters without requiring a coordinator.</p><p>Nodes in Qanaat follow different failure models, i.e., crash or Byzantine. We mainly focus on two common scenarios. First, when nodes follow the crash failure, a cluster contains 2&#119891; + 1 nodes that perform both ordering and execution. Second, when nodes follow the Byzantine failure and each cluster includes 3&#119891; + 1 ordering nodes, 2&#119892; + 1 execution nodes, and a privacy firewall consisting of &#8462; + 1 rows of &#8462; + 1 filters. The number of required matching votes to ensure that a quorum of ordering nodes within a cluster agrees with the order of a transaction is different in different settings. We define local-majority as the number of required matching votes from a cluster. For crash-only clusters, local-majority is &#119891; + 1 (from 2&#119891; + 1 nodes), and for clusters with Byzantine ordering nodes, local-majority is 2&#119891; + 1 (from 3&#119891; + 1 ordering nodes).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Intra-Cluster Consensus</head><p>In the internal (intra-cluster) consensus protocol, ordering nodes of a cluster, independently of other clusters, agree on the order of a transaction. The internal consensus protocol is pluggable and depending on the failure model of nodes of the cluster a crash fault-tolerant (CFT) protocol, e.g., (Multi-)Paxos <ref type="bibr">[60]</ref> or a Byzantine fault-tolerant (BFT) protocol, e.g., PBFT <ref type="bibr">[27]</ref>, can be used. If nodes follow the Byzantine failure model, as discussed before, Qanaat separates ordering nodes from execution nodes and uses a privacy firewall to prevent confidential data leakage.</p><p>The protocol is initiated by a pre-elected ordering node of the cluster, called the primary. When the primary node &#120587; (&#119875; &#119894; ) of cluster &#119875; &#119894; receives a valid signed request message &#10216;REQUEST, &#119900;&#119901;, &#119905; &#119888; , &#119888;&#10217; &#120590; &#119888; from an authorized client &#119888; (with timestamp &#119905; &#119888; ) to execute (encrypted) operation &#119900;&#119901; on local data collection &#119889; &#119875; &#119894; , it initiates the protocol by multicasting a message, e.g., accept message in Multi-Paxos (assuming the primary is elected) or pre-prepare message in PBFT, including the request and its digest to other ordering nodes of the cluster.</p><p>To provide a total order among transaction blocks and preserve data consistency, the primary also assigns an ID, as discussed in Section 3.3, to the request. The ordering nodes of the cluster then agree on the order of the transaction using the utilized protocol.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Transaction Execution Routine</head><p>The next step after ordering is to execute a transaction and inform the client. If nodes follow the Byzantine failure model, ordering and execution are performed by distinct sets of nodes that are separated by a privacy firewall. Once a transaction is ordered, the ordering nodes generate a commit certificate consisting of signatures from 2&#119891; + 1 different nodes and multicast both the request and the commit certificate to the bottom row of filters. The filters check the request and the commit certificate to be valid and multicast them to the next row above. Filters also track the requests that they have seen in a commit or a reply certificate and their IDs.</p><p>Upon receiving both a valid request and a valid commit certificate, execution nodes append the transaction and the corresponding commit certificate to the ledger. Note that the execution nodes store the last reply certificate sent to client &#119888; to check if the current request is new (i.e., has a larger timestamp) that needs to be executed and committed to the ledger or an old request (i.e., has the same or smaller timestamp) where nodes re-send the reply messages. If all transactions accessing on &#119889; &#119875; &#119894; with lower local sequence numbers (&lt; &#119899;) have been executed, nodes execute the transaction on data collection &#119889; &#119875; &#119894; following its application logic. If, during the execution, the execution nodes need to read values from some other data collection &#119889; &#119883; where &#119889; &#119875; &#119894; is order-dependent on &#119889; &#119883; (i.e., &#119875; &#119894; &#8838; &#119883; ), the nodes check the public part of the transaction ID to ensure that they read the correct state of &#119889; &#119883; . Data collections store data in multi-versioned datastores to enable nodes to read the version they need to. This ensures that all execution nodes execute requests in the same order and on the same state. Execution nodes then multicast a signed reply message including the (encrypted) results to the top row of filters. When a filter node in the top row receives &#119892; + 1 valid matching reply messages, it generates a reply certificate authenticated by &#119892; + 1 signature shares from distinct execution nodes and multicasts it to the row below. Each filter then multicasts the reply certificate to the row of filter nodes or ordering nodes below. Finally, client &#119888; accepts the result once it receives a valid reply certificate from ordering nodes.</p><p>If nodes follow the crash failure model, ordering and execution are performed by the same set of nodes. In this case, nodes append the transaction to the ledger and execute it as explained before and then the primary node sends a reply message to client &#119888;.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Coordinator-based Consensus</head><p>The coordinator-based approach has been used in distributed databases to process cross-shard transactions, e.g., two-phase commit. Coordinator-based protocols have also been used in several permissioned blockchain systems, e.g., AHL <ref type="bibr">[35]</ref>, Blockplane <ref type="bibr">[65]</ref>, and Saguaro <ref type="bibr">[10]</ref>. This section briefly demonstrates how Qanaat can leverage the coordinator-based approach to process cross-cluster transactions. In contrast to the existing coordinator-based databases and blockchains that address multi-shard single-enterprise contexts, Qanaat deals with multi-shard multi-enterprise environments. Moreover, since each transaction might read data from multiple data collections, ordering transactions is Qanaat is more complex. Figure <ref type="figure">4</ref> presents the normal case operation of (a) intra-shard crossenterprise, (b) cross-shard intra-enterprise, and (c) cross-shard cross-enterprise coordinator-based protocols. All three coordinatorbased protocols consist of prepare, prepared, and commit phases.</p><p>In the prepare phase and upon receiving a transaction, ordering nodes of the coordinator cluster establish (intra-cluster) consensus on the order of the transaction among the transactions of their shard. The primary then sends a signed prepare message to the ordering nodes of all involved clusters.</p><p>The prepared phase is handled differently in different protocols. For intra-shard cross-enterprise transactions, all involved clusters, e.g., &#119862; 3 and &#119863; 3 in Figure <ref type="figure">4</ref>(a), maintain the same data shard. As a result, there is no need to run consensus in non-coordinator clusters, e.g., &#119863; 3 . Upon receiving a prepare message from the primary of the coordinator cluster, e.g., &#119862; 3 , each ordering node of a noncoordinator cluster, e.g., &#119863; 3 , validates the order and sends a prepared message to the primary of the coordinator cluster.</p><p>For cross-shard intra-enterprise transactions, involved clusters, e.g., &#119860; 2 and &#119860; 3 , maintain different shards of a local data collection, e.g., &#119889; &#119860; . Upon receiving a prepare message from the coordinator cluster, e.g., &#119860; 2 , each non-coordinator cluster separately establishes consensus on the order of the transaction in its data shard. The primary of each non-coordinator cluster, e.g., &#119860; 3 , then sends a prepared message to the nodes of the coordinator cluster, e.g., &#119860; 2 .</p><p>Finally, for cross-shard cross-enterprise transactions, involved clusters of the initiator enterprise, e.g., &#119861; 1 and &#119861; 2 of enterprise &#119861;, maintain different shards of a shared data collection, e.g., &#119889; &#119861;&#119862; , while each shard is replicated on clusters of different enterprises, e.g., &#119889; 1  &#119861;&#119862; is maintained by &#119861; 1 and &#119862; 1 . Upon receiving a prepare message from the coordinator cluster, e.g., &#119861; 1 , if the cluster belongs to the initiator enterprise, e.g., &#119861; 2 , it establishes (internal) consensus on the transaction order. Otherwise, the cluster waits for a message from the cluster of the initiator enterprise that maintains the same data shard as they do, e.g., &#119862; 1 waits for &#119861; 1 and &#119862; 2 waits for &#119861; 2 . Each node then validates the received message and sends a prepared message to the primary of the coordinator cluster.</p><p>In the commit phase, upon receiving valid prepared messages from every involved cluster, the primary of the coordinator cluster establishes internal consensus within its cluster and multicasts a signed commit message to ordering nodes of all involved clusters.</p><p>Each cluster then uses the transaction execution routine (Section 4.2) to execute the transaction and send reply back to the client.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.4">Flattened Consensus</head><p>The flattened consensus protocols of Qanaat, in contrast to the flattened cross-shard consensus protocols, e.g., SharPer <ref type="bibr">[8]</ref>, which are designed for single-enterprise environments, support multiple multi-shard collaborative enterprises.</p><p>The flattened protocols of Qanaat enable clusters to commit a transaction in a smaller number of communication phases. For instance, a cross-shard intra-enterprise transaction can be committed using the flattened protocol in 3 cross-cluster communication steps. In contrast, using the coordinator-based protocol, the same transaction requires 3 cross-cluster and 9 intra-cluster communication steps (3 runs of PBFT). It also reduces the load on the coordinator cluster. We now discuss flattened consensus protocols in detail.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.4.1">Intra-Shard Cross-Enterprise Consensus.</head><p>In the intra-shard cross-enterprise protocol, multiple clusters from different enterprises process a transaction on the same data shard of a shared data collection, e.g., clusters &#119862; 3 and &#119863; 3 on shard &#119889; 3  &#119862;&#119863; of shared data collection &#119889; &#119862;&#119863; (Figure <ref type="figure">5(a)</ref>). Upon receiving a valid request message &#119898;, the primary ordering node &#120587; (&#119875; &#119894; ) of the initiator cluster &#119875; &#119894; assigns transaction ID (as discussed in Section 3.3) and multicasts a signed propose message &#10216;PROPOSE, ID, &#119889;, &#119898;&#10217; &#120590; &#120587; (&#119875; &#119894; ) to the ordering nodes of all involved clusters where &#119889; = &#119863; (&#119898;) is the digest of request &#119898;. Upon receiving a propose message, each node &#119903; validates the digest, signature and ID, and multicasts a signed accept message &#10216;ACCEPT, ID, &#119889;&#10217; &#120590; &#119903; to all ordering nodes of every involved cluster. Each node &#119903; waits for valid matching accept messages from a local-majority of every involved cluster and then multicasts a commit message including the transaction ID and its digest to every ordering node of all involved clusters. The propose and accept phases of the protocol, similar to pre-prepare and prepare phases of PBFT, guarantee that non-faulty nodes agree on the transaction order. Finally, once an ordering node receives valid commit messages from the local-majority of all involved clusters that match its commit message, it generates a commit certificate by merging messages from all involved clusters. Each cluster uses the transaction execution routine to execute the transaction and send reply back to the client. 4.4.2 Cross-Shard Intra-Enterprise Consensus. In the cross-shard intra-enterprise consensus protocol, as shown in Figure <ref type="figure">5</ref>(b), the involved clusters, e.g., &#119860; 2 and &#119860; 3 , maintain different shards of a local data collection, e.g., &#119889; &#119860; . Upon receiving a valid request message &#119898;, the primary &#120587; (&#119875; &#119894; ) of the initiator cluster &#119875; &#119894; assigns ID &#119894; to the transaction and multicasts a propose message &#120583; = &#10216;PROPOSE, ID &#119894; , &#119889;, &#119898;&#10217; &#120590; &#120587; (&#119875; &#119894; ) to all nodes of every involved cluster. Upon receiving a valid propose message, each primary node &#120587; (&#119875; &#119895; ) of an involved cluster &#119875; &#119895; multicasts &#10216;ACCEPT, ID &#119894; , ID &#119895; , &#119889;, &#119889; &#120583; &#10217; &#120590; &#120587; (&#119875; &#119895; ) to the nodes of its cluster where ID &#119895; represents the order of &#119898; on data shard of cluster &#119875; &#119895; . The digest of the propose message, &#119889; &#120583; = &#119863; (&#120583;), is added to link the accept message with the corresponding propose message enabling nodes to detect changes and alterations to any part of the message. The primary of the initiator and all involved clusters process the request only if there is no (concurrent) uncommitted request &#119898; &#8242; where &#119898; and &#119898; &#8242; intersect in at least 2 shards. This is needed to ensure that requests are committed in the same order in different shards (global consistency) <ref type="bibr">[8]</ref>.</p><p>Each node &#119903; (including the primary) of an involved cluster &#119875; &#119895; then multicasts a signed accept message &#10216;ACCEPT, ID &#119894; , ID &#119895; , &#119889;, &#119903; &#10217; &#120590; &#119903; to all ordering nodes of every involved cluster. Upon receiving valid matching accept messages from the local-majority of all involved clusters &#119875; &#119894; , &#119875; &#119895; , ..., &#119875; &#119896; , node &#119903; multicasts &#10216;COMMIT, ID &#119894; , ID &#119895; , ..., ID &#119896; , &#119889;, &#119903; &#10217; &#120590; &#119903; message to every ordering node of all involved clusters.</p><p>Upon receiving valid matching commit messages from the localmajority of every involved cluster, the node generates a commit certificate. The transaction execution routine then executes the transaction and appends the transaction to the ledger.</p><p>In this protocol, since all clusters belong to the same enterprise, if nodes of all involved clusters are crash-only, Qanaat processes transactions more efficiently. In that case, nodes of each involved cluster send the accept message to only the initiator primary and the initiator primary multicasts a commit message to all nodes (instead of the two all to all communication phases).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.4.3">Cross-Shard</head><p>Cross-Enterprise Consensus. The cross-shard cross-enterprise consensus protocol is needed when a transaction is executed on different shards of a non-local data collection shared between different enterprises, e.g., a transaction that is executed on data shards &#119889; 1 &#119861;&#119862; and &#119889; 2 &#119861;&#119862; of shared data collection &#119889; &#119861;&#119862; where &#119889; 1  &#119861;&#119862; is maintained by &#119861; 1 and &#119862; 1 and &#119889; 2 &#119861;&#119862; is maintained by &#119861; 2 , and &#119862; 2 (Figure <ref type="figure">5(c)</ref>).</p><p>In this case, different clusters of each enterprise maintain different data shards, e.g., &#119861; 1 and &#119861; 2 maintain &#119889; 1 &#119861;&#119862; and &#119889; 2 &#119861;&#119862; , however, each data shard is processed by only one cluster of each involved enterprise, e.g., &#119889; 1  &#119861;&#119862; is maintained by &#119861; 1 and &#119862; 1 . In Qanaat, in order to improve performance, only the clusters of the initiator enterprise, e.g., &#119861; 1 and &#119861; 2 , establish consensus on the transaction order and clusters of other enterprises, e.g., &#119862; 1 and &#119862; 2 , validate the order.</p><p>The primary node &#120587; (&#119875; &#119894; ) of the initiator cluster &#119875; &#119894; multicasts a signed propose message &#120583; = &#10216;PROPOSE, ID &#119894; , &#119889;, &#119898;&#10217; &#120590; &#120587; (&#119875; &#119894; ) to the nodes of all involved clusters. Upon receiving a valid propose message, each primary node &#120587; (&#119875; &#119895; ) of an involved cluster &#119875; &#119895; belonging to the initiator enterprise assigns an ID &#119895; to the transaction and multicasts a signed &#10216;ACCEPT, ID &#119894; , ID &#119895; , &#119889;, &#119889; &#120583; &#10217; &#120590; &#120587; (&#119875; &#119895; ) message to all the nodes of its cluster and all other clusters that maintain the same data shard. As before, primary nodes ensure consistency (i.e., no concurrent request with more than one shared shard) before processing a request. The accept and commit phases process the transaction in the same way as cross-shard intra-enterprise protocol. 4.4.4 Primary Failure Handling. We use the retransmission routine presented in <ref type="bibr">[86]</ref> to handle unreliable communication between ordering nodes and execution nodes. In this section, we focus on the failure of the primary ordering node. If the timer of node &#119903; expires before it receives a commit certificate, it suspects that the primary might be faulty. When the primary node of a cluster fails, the primary failure handling routine of the internal consensus protocol, e.g., view-change in PBFT, is triggered by timeouts to elect a new primary.</p><p>The timeout mechanism prevents the protocol from blocking and waiting forever by ensuring that eventually (after GST), communication between non-faulty ordering nodes is timely and reliable. Ordering nodes use different timers for intra-cluster and crosscluster transactions because processing transactions across clusters usually takes more time. The timeout value mainly depends on the network latency (within or across clusters). It must be long enough to allow nodes to communicate with each other and establish consensus, i.e., at least 3 times the WAN round-trip for cross-cluster transactions to allow a view-change routine to complete without replacing the primary node again. The timeouts are adjusted to ensure that this period increases exponentially until some transaction is committed, e.g., in case of consecutive primary failure, the timeout is doubled as in PBFT <ref type="bibr">[27]</ref>.</p><p>While in the intra-shard cross-enterprise consensus, only the failure of the initiator primary needs to be handled, in other protocols, the primary of any involved clusters that assign an ID, i.e., belongs to the initiator enterprise, might fail. In the intra-shard cross-enterprise consensus, if the timer of node &#119903; in the initiator cluster expires, it initiates the failure handling routine of the internal consensus protocol, e.g., view-change in PBFT. Otherwise, if the node is in some other involved cluster, it multicasts a commitquery message including the request ID and its digest to the nodes of the initiator cluster. If nodes receive commit-query from the localmajority of an involved cluster for a request, they suspect their primary is faulty. Nodes also log the query messages to detect denial-of-service attacks initiated by malicious nodes.</p><p>In the second and third protocols, each transaction needs to be ordered by the initiator primary as well as the primary nodes of all clusters belonging to the initiator enterprise (i.e., which maintain different data shards). Suppose a malicious primary node (from the initiator or an involved cluster) sends a request with inconsistent ID to different nodes. In that case, nodes detect the failure in all to all communication phases of the protocol triggering the primary failure handling routine within the faulty primary cluster. Note that since propose and accept messages need to be multicast to all nodes, and all nodes of all involved clusters multicast accept and commit messages to each other, even if a malicious primary decides not to multicast a request to a group of nodes, it will be easily detected.</p><p>Finally, if a client does not receive a reply soon enough, it multicasts its request message to all ordering nodes of the cluster that it has already sent its request. If an ordering node has both the commit certificate (i.e., the request has already been ordered) and the reply certificate (i.e., the request has already been executed), the node simply sends the reply certificate to the client. If the node has not received the reply certificate, it re-sends the commit certificate to the filter nodes. Otherwise, if the node is not the primary, it relays the request to the primary. If the nodes do not receive propose messages, the primary will be suspected to be faulty.</p><p>We establish the safety (agreement, validity, and consistency) and liveness properties of both the coordinator-based and the flattened protocols in the extended version of the paper <ref type="bibr">[11]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">EXPERIMENTAL EVALUATION</head><p>Our evaluation has three goals: (1) comparing the performance of the coordinator-based and flattened consensus protocols in different workloads with different types of transactions; (2) demonstrating the overhead of using the privacy firewall mechanism <ref type="bibr">[86]</ref> to provide confidentiality despite Byzantine faults; (3) comparing the performance of Qanaat with Hyperledger Fabric <ref type="bibr">[12]</ref> and two of its variants, FastFabric <ref type="bibr">[46]</ref> and Fabric++ <ref type="bibr">[78]</ref>, to analyze the impact of sharding and the performance trade-off between a higher number of shards versus a higher percentage of cross-shard transactions.</p><p>We analyze the impact of (1) the failure model of nodes, (2) the percentage of cross-enterprise transactions, (3) the percentage of cross-shard transactions, (4) the geo-distribution of clusters, (5) the number of involved enterprises, (6) the failure of nodes, and (7) the degrees of contention on the performance of these protocols and systems. Due to space restrictions, the experiment results for (5), ( <ref type="formula">6</ref>) and <ref type="bibr">(7)</ref> are reported in the extended version of the paper <ref type="bibr">[11]</ref>.</p><p>We implemented a prototype of Qanaat and deployed a simple asset management collaboration workflow. We use (modified) Small-Bank benchmarks with write-heavy workloads. The key selection distribution in each data collection is uniform with s-value = 0.  We consider an infrastructure with 4 enterprises. Each enterprise partitions its data into 4 shards. Each crash-only clusters includes 2&#119891; + 1 nodes that order and execute transactions while each Byzantine cluster includes 3&#119891; +1 ordering nodes, 2&#119892; +1 execution nodes and &#8462; + 1 rows of &#8462; + 1 filter nodes. To demonstrate the overhead of the privacy firewall mechanism, we also measure the performance of Byzantine clusters with only 3&#119891; + 1 nodes that order and execute transactions. In all experiments &#119891; = &#119892; = &#8462; = 1. We use Paxos and PBFT as the internal consensus protocols.</p><p>We consider a single-channel Fabric deployment (&#119907;2.2) where Raft <ref type="bibr">[66]</ref> is its consensus protocol. We deploy 4 enterprises on the channel where enterprises can form public or private collaboration. Sharding was not possible in a single-channel Fabric deployment, however, we defined four endorsers to execute transactions of enterprises in parallel. We use a similar setting for FastFabric and Fabric++. FastFabric re-architects Fabric and provides efficient optimizations such as separating endorsers from storage nodes and sending transaction hashes to orderers. Fabric++, on the other hand, presents reordering and early abort mechanisms to improve the performance of Fabric, especially in contentious workloads.</p><p>The experiments were conducted on the Amazon EC2 platform. Other than the fourth set of experiments where clusters are distributed over 4 different AWS regions, clusters are placed in the same data center (California) with &lt; 1 ms ping latency in the first three sets of experiments. Each VM is a c4.2xlarge instance with 8 vCPUs and 15GB RAM, Intel Xeon E5-2666 v3 processor clocked at 3.50 GHz. The results reflect end-to-end measurements from the clients. The reported results are the average of five runs.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Intra-Shard Cross-Enterprise Transactions</head><p>In the first set of experiments, we measure the performance of all protocols with different percentages, i.e., 10%, 50%, and 90%, of intra-shard cross-enterprise transactions. Each transaction is randomly initiated on a single data shard of a data collection shared among multiple enterprises. The number of involved enterprises depends on the data collection. Figure <ref type="figure">6</ref>(a) demonstrate the results for the workload with 10% intra-shard cross-enterprise (and 90% internal) transactions. In this scenario and with crash-only nodes, Qanaat processes more than 110 ktps with 38 ms latency using the flattened protocol (Flt-C) and 103 ktps with 36 ms latency using the coordinator-based protocol (Crd-C).</p><p>Fabric processes only 9.7 ktps (8% of the throughput of Flt-C) with 37 ms latency. While different endorsers of different enterprises execute their transactions in parallel, ordering the transactions of all enterprises by a single set of orderers becomes a bottleneck. This  clearly demonstrates the impact of parallel ordering (due to sharding) in Qanaat, where different clusters process their transactions independently. Fabric++ demonstrates only 3% higher throughput compared to Fabric with the same latency as it can reorder and early abort invalidated transactions. FastFabric, however, demonstrates 189% throughput improvement compared to Fabric due to its optimized architecture. However, its throughput is still 26% of the throughput of Flt-C with the same latency. With Byzantine nodes, the performance of the flattened protocol (Flt-B) and the coordinator-based protocol (Crd-B) is reduced, which is expected due to the higher complexity of BFT protocols. Using the privacy firewall mechanism results in 8% and 6% lower throughput in the coordinator-based (Crd-B(PF)) and flattened (Flt-B(PF)) protocols respectively. This slight throughput reduction is the result of two infrastructural changes. On one hand, using the privacy firewall mechanism, request and reply messages go through filters resulting in lower performance. On the other hand, separating ordering from execution reduces the performance overhead by decreasing the load on ordering nodes. The privacy firewall mechanism also increases the latency of transaction processing in different workloads by a constant coefficient. This is expected because the increased latency comes from sending messages through the filters, which is separated from the consensus routine; the bottleneck in heavy workloads. While this latency is considerable in light workloads, it becomes much lower in heavy workloads, e.g., 166% vs. 25% higher latency in Crd-B(PF) protocol.</p><p>Increasing the percentage of cross-enterprise transactions to 50%, as shown in Figure <ref type="figure">6</ref>(b), reduces the throughput of all protocols. This is expected because a higher percentage of transactions requires cross-enterprise consensus. In this experiment, Flt-B processes 52 ktps with 230 ms latency while Crd-B processes 43 ktps (18% lower) with 130 ms latency (44% lower). This shows a trade-off between the number of communication phases and the quorum size. While the coordinator-based approach requires more phases of message passing (resulting in lower throughput), the quorum size of the flattened approach is larger, i.e., all nodes communicate with each other (resulting in higher latency). Using the privacy firewall mechanism, the throughput of Crd-B(PF) and Flt-B(PF) is increased by 5% and 7% respectively and their latency is increased by only 9% and 6% (compared to Crd-B and Flt-B) before the end-toend throughput is saturated. These results demonstrate that as the ordering routine becomes heavily loaded, the overhead of using the privacy firewall mechanism is alleviated.</p><p>The performance of Crd-C is significantly better than Crd-B (i.e., 23% higher throughput, 39% lower latency) in this scenario. This difference, however, is not remarkable in the flattened protocols. The reason is that in the coordinator-based protocol, consensus  takes place within each cluster using the internal consensus protocols (Paxos in this case). However, in the flattened protocol, as shown in Figure <ref type="figure">5</ref>(a), there is no internal consensus within clusters and a BFT protocol across enterprises establishes agreement.</p><p>The performance of Fabric is also affected by increasing the percentage of cross-enterprise transactions due to (1) the overhead of hashing techniques and (2) conflicting transactions <ref type="bibr">[6,</ref><ref type="bibr">44,</ref><ref type="bibr">45,</ref><ref type="bibr">78]</ref>. Interestingly, the throughput gap between Fabric and Fabric++ is increased to 18% (from 3%) in this scenario due to early abort and reordering mechanisms presented in Fabric++.</p><p>With 90% cross-enterprise transactions, as shown in Figure <ref type="figure">6</ref>(c), the latency of Flt-B becomes very high (680 ms) due to its &#119874; (&#119899; 2 ) message communication. The performance of Flt-C and Flt-B becomes close to each other since in both cases, a BFT protocol is used for cross-enterprise consensus. In this experiment, FastFabric demonstrates the lowest latency (35% lower than Crd-C with 18 ktps) as it does not need message communication across clusters.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Cross-Shard Intra-Enterprise Transactions</head><p>In the second set of experiments, we measure the performance of coordinator-based and flattened cross-shard intra-enterprise protocols. With Byzantine nodes and with 10% cross-shard transactions, as shown in Figure <ref type="figure">7</ref>(a), the performance of Crd-B is still close to Flt-B. However, by increasing the percentage of cross-shard transactions to 50%, Flt-B shows 20% higher throughput. In this set of experiments, since all shards belong to a single enterprise, as explained in Section 4.4.2, Flt-C is implemented as a CFT protocol, and, as shown in Figure <ref type="figure">7</ref>(a)-(c), has the best performance in all three workloads. Similar to the previous section, the overhead of using the privacy firewall mechanism is alleviated when the ordering nodes become highly loaded, e.g., the gap between the latency of Flt-B(PF) and Flt-B is reduced from 25% to 4% by increasing the percentage of cross-shard transactions from 10% to 90%. Since enterprises maintain their data on a single data shard, Fabric demonstrates the same performance in all three workloads, which is significantly worse than Qanaat. However, with 90% cross-shard transactions, similar to cross-enterprise transactions, FastFabric shows the lowest latency.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3">Cross-Shard Cross-Enterprise Transactions</head><p>In workloads consisting of cross-shard cross-enterprise transactions, as shown in Figure <ref type="figure">8</ref>(a)-(c), the coordinator-based protocol shows better performance, especially with a higher percentage of cross-cluster transactions. In particular, with 90% cross-cluster transactions, Flt-B demonstrates 24% lower throughput and 93% higher latency compared to Crd-B due to its all to all communication phases across multiple clusters of multiple enterprises.  We consider workloads with 90% internal transactions (the typical setting in partitioned databases <ref type="bibr">[82]</ref>) and repeat the previous experiments, i.e., intra-shard cross-enterprise transactions ( Since in Fabric, Fabric++, and FastFabric, all transactions are ordered by the same set of orderers, placing endorser nodes that execute transactions of different enterprises and orderer nodes in different locations far from each other is not plausible. Hence, we do not perform this set of experiments for Fabric and its variants.</p><p>With 10% intra-shard cross-enterprise transactions (Figure <ref type="figure">9</ref>(a)), Flt-B demonstrates higher latency due to the message complexity of the protocol that requires all nodes to multicast messages to each other over a wide area network. With 10% cross-shard intraenterprise transactions (Figure <ref type="figure">9</ref>(b)), Flt-C demonstrates the best performance because clusters belong to the same enterprise and Qanaat processes transactions using a CFT protocol.</p><p>Finally, With 10% cross-shard cross-enterprise transactions (Figure <ref type="figure">9(c</ref>)), the coordinator-based protocols show better performance because of the two all to all communication phases of the flattened protocols that take place among distant clusters. Compared to the single datacenter setting, the overhead of using the privacy firewall mechanism is also reduced. With 10% intra-shard cross-enterprise transactions, Crd-B(PF) shows 3% lower throughput and 10% higher latency Compared to Crd-B while with the same workload and in single datacenter setting, Crd-B(PF) demonstrates 6% lower throughput and 20% higher latency.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">RELATED WORK</head><p>A permissioned blockchain system <ref type="bibr">[2,</ref><ref type="bibr">12,</ref><ref type="bibr">30,</ref><ref type="bibr">44,</ref><ref type="bibr">45,</ref><ref type="bibr">51,</ref><ref type="bibr">58,</ref><ref type="bibr">64,</ref><ref type="bibr">72,</ref><ref type="bibr">75,</ref><ref type="bibr">78]</ref> consists of a set of known, identified but possibly untrusted participants (permissioned blockchains are analyzed in several surveys and empirical studies <ref type="bibr">[7,</ref><ref type="bibr">26,</ref><ref type="bibr">29,</ref><ref type="bibr">37,</ref><ref type="bibr">38,</ref><ref type="bibr">74,</ref><ref type="bibr">79,</ref><ref type="bibr">79]</ref>). Several blockchains support confidential transactions in both the permissioned <ref type="bibr">[28,</ref><ref type="bibr">63]</ref> and permissionless <ref type="bibr">[25,</ref><ref type="bibr">49]</ref> settings. These systems, however, are not scalable and only support simple, financial transfers, not more complex database updates.</p><p>Hyperledger Fabric <ref type="bibr">[12]</ref> stores confidential data in private data collections <ref type="bibr">[50]</ref> replicated on authorized enterprises. The hash of all private transactions, however, is appended to the single global ledger of every node resulting in low performance.</p><p>Several variants of Fabric, e.g., Fast Fabric <ref type="bibr">[45]</ref>, XOX Fabric <ref type="bibr">[44]</ref>, Fabric++ <ref type="bibr">[78]</ref>, and FabricSharp <ref type="bibr">[75]</ref>, have been presented to improve its performance. Such systems, however, do not address the confidential data leakage and consistency challenges of Fabric. Fabric can also be combined with secure multiparty computation <ref type="bibr">[17]</ref> but this does not address performance issues.</p><p>Caper <ref type="bibr">[5]</ref> supports private internal and public global transactions of collaborative enterprises. Caper, however, does not address transactions among a subset of enterprises, consistency across collaboration workflows, confidential data leakage prevention, and multi-shard enterprises.</p><p>The zero-knowledge proofs techniques have been used in different blockchain systems such as Hawk <ref type="bibr">[56]</ref>, Arbitrum <ref type="bibr">[53]</ref>, Zkay <ref type="bibr">[80]</ref>, Ekiden <ref type="bibr">[32]</ref>, and zexe <ref type="bibr">[21]</ref> to support confidential transactions. These systems focus on the application layer and do not attempt to address the consensus and data layers that are the focus of Qanaat. Hence, these systems are complementary to Qanaat, and some of these tools could be adapted to provide private contracting capabilities on top of the Qanaat ledger.</p><p>Data sharding techniques are used in distributed databases <ref type="bibr">[16,</ref><ref type="bibr">23,</ref><ref type="bibr">34,</ref><ref type="bibr">36,</ref><ref type="bibr">43,</ref><ref type="bibr">52,</ref><ref type="bibr">82,</ref><ref type="bibr">83]</ref> with crash-only nodes and in permissioned blockchain systems, e.g., AHL <ref type="bibr">[35]</ref>, Blockplane <ref type="bibr">[65]</ref>, chainspace <ref type="bibr">[3]</ref>, SharPer <ref type="bibr">[8]</ref>, and Saguaro <ref type="bibr">[10]</ref> with Byzantine nodes. Qanaat, in contrast to all these systems, supports multi-enterprise environments and guarantees confidentiality.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7">CONCLUSION</head><p>In this paper, we proposed Qanaat, a permissioned blockchain system to support the scalability and confidentiality requirements of multi-enterprise applications. To guarantee collaboration confidentiality, Qanaat constructs a hierarchical data model consisting of a set of data collections for each collaboration workflow. Every subset of enterprises is able to form a confidential collaboration private from other enterprises and execute transactions on a private data collection shared between only the involved enterprises. To prevent confidential data leakage, Qanaat utilizes the privacy firewall mechanism <ref type="bibr">[86]</ref>. To support scalability, each enterprise partitions its data into different data shards. Qanaat further presents a transaction ordering scheme that enforces only the necessary and sufficient constraints to guarantee data consistency. Finally, a suite of consensus protocols is presented to process different types of intra-shard and cross-shard transactions within and across enterprises. Our experimental results clearly demonstrate the scalability of Qanaat compared to Fabric and its variants. Moreover, while coordinator-based protocols demonstrate better performance in cross-enterprise transactions, flattened protocols show higher performance in cross-shard transactions.</p></div><note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0"><p>Qanaat is a scalable underground network consisting of private channels to transport water from an aquifer to the surface (i.e., an underground aqueduct).</p></note>
		</body>
		</text>
</TEI>
