tree a gas efficient structure for authenticated range
play

-Tree: A Gas-Efficient Structure for Authenticated Range Queries - PowerPoint PPT Presentation

-Tree: A Gas-Efficient Structure for Authenticated Range Queries in Blockchain Ce Zhang, Cheng Xu, Jianliang Xu, Yuzhe Tang, Byron Choi Hong Kong Baptist University, Hong Kong Syracuse University, NY, USA Introduction Source:


  1. 𝐇𝐅𝐍 πŸ‘ -Tree: A Gas-Efficient Structure for Authenticated Range Queries in Blockchain Ce Zhang, Cheng Xu, Jianliang Xu, Yuzhe Tang, Byron Choi Hong Kong Baptist University, Hong Kong Syracuse University, NY, USA

  2. Introduction Source: FAHM Technology Partners 4/10/2019 2

  3. Blockchain Technology β€’ Distributed Ledger maintained by a community of (untrusted) users β€’ Decentralization β€’ Consensus β€’ Immutability β€’ Provenance 4/10/2019 3

  4. Smart Contract β€’ A trusted program to execute user-defined computation upon the blockchain β€’ Read and write blockchain data β€’ Execution integrity is ensured by the consensus protocol β€’ Offer trusted storage and computation capabilities β€’ Function as a trusted virtual machine Traditional Blockchain Computer VM Storage RAM Blockchain Smart Computation CPU Contract 4/10/2019 4

  5. Blockchain Scalability β€’ Scalability problem β€’ Storing any information on chain is not scalable β€’ Large size data: document, image, etc. β€’ Ethereum: block size 20KB, 15 sec per block β€’ Off-chain storage β€’ Raw data is stored outside of the blockchain β€’ A hash of the data is kept on chain to ensure integrity 4/10/2019 5

  6. Blockchain Hybrid Storage 𝑙𝑓𝑧, π‘€π‘π‘šπ‘£π‘“ 𝑙𝑓𝑧 Service Provider π‘€π‘π‘šπ‘£π‘“ Data Owner Client 𝑙𝑓𝑧, h(π‘€π‘π‘šπ‘£π‘“) h(π‘€π‘π‘šπ‘£π‘“) Blockchain Hybrid Storage β€’ Pros: high scalability, result integrity assured β€’ Cons: only support exact search β€’ Consider other type of queries? 4/10/2019 6

  7. Objective and General Idea ADS 𝑅 = [𝑏, 𝑐] 𝑙𝑓𝑧, π‘€π‘π‘šπ‘£π‘“ Service Provider 𝑆, π‘Šπ‘ƒ π‘‘π‘ž ADS Data Owner Client 𝑙𝑓𝑧, h(π‘€π‘π‘šπ‘£π‘“) π‘Šπ‘ƒ π‘‘β„Žπ‘π‘—π‘œ Blockchain Hybrid Storage β€’ Support integrity-assured range queries β€’ Inspiration: authenticated query processing β€’ Use the authenticated data structure (ADS) to support queries β€’ Leverage both smart contract and the SP to maintain the ADS 4/10/2019 7

  8. System Overview ADS 𝑅 = [𝑏, 𝑐] 𝑙𝑓𝑧, π‘€π‘π‘šπ‘£π‘“ Service Provider 𝑆, π‘Šπ‘ƒ π‘‘π‘ž ADS Data Owner Client 𝑙𝑓𝑧, h(π‘€π‘π‘šπ‘£π‘“) π‘Šπ‘ƒ π‘‘β„Žπ‘π‘—π‘œ Blockchain Hybrid Storage β€’ Data Owner: send meta-data to blockchain and full data to SP β€’ Smart Contract: update on-chain ADS β€’ Service Provider: maintain the same ADS and process queries β€’ Client: verify results with respect to the ADS from the blockchain 4/10/2019 8

  9. Challenge β€’ Each on-chain update requires a transaction β€’ Transaction fee for smart contract-enabled blockchain β€’ Modeled by gas for storage and computation (Ethereum) β€’ Objective: How to design efficient ADS to be maintained by smart contract under the gas cost model Ethereum Gas Cost Model 4/10/2019 9

  10. Contributions β€’ A novel Gasβˆ’Efficient Merkle Merge Tree (GEM 2 -Tree) β€’ Reduce the storage and computation cost of the smart contract β€’ Optimized version GEM 2βˆ— -Tree β€’ Further reduce the maintenance cost without sacrificing much of the query performance 4/10/2019 10

  11. Preliminaries β€’ Authenticated Query Processing β€’ The DO outsources the authenticated data structure (ADS) to the SP β€’ The SP returns results and verification object (VO) β€’ The client verifies the result using VO β€’ ADS: Merkle Hash Tree (MHT) β€’ Binary tree β€’ Hash function combining the child nodes β€’ VO: sibling hashes along the search path β€’ Verification: reconstructing the root hash Result: {13,16} β€’ Merkle B-Tree (MB-Tree) VO: {4, 24, β„Ž 6 } β€’ Integrate B-tree with MHT 4/10/2019 11

  12. Baseline Solution (1) β€’ MB-tree β€’ Maintained by both the smart contract and the SP β€’ Data update requires writes on the entire tree path insert β€’ 𝐷 MBβˆ’tree = log 𝐺 𝑂 2𝐷 𝑑𝑑𝑒𝑝𝑠𝑓 + 2𝐷 π‘‘π‘£π‘žπ‘’π‘π‘’π‘“ + 2𝐺 + 1 𝐷 π‘‘π‘šπ‘π‘π‘’ + 𝐷 β„Žπ‘π‘‘β„Ž + 𝐷 𝑑𝑑𝑒𝑝𝑠𝑓 SP Client π‘Šπ‘ƒ π‘‘β„Žπ‘π‘—π‘œ = {β„Ž 7 } MB-tree Smart Contract 4/10/2019 12

  13. Baseline Solution (2) β€’ Suppressed Merkle B-tree (SMB-tree) β€’ Observation of MB-tree: only root hash π‘Šπ‘ƒ π‘‘β„Žπ‘π‘—π‘œ is used during query processing β€’ Idea: β€’ Suppress all internal nodes and only materialize the root node in the blockchain β€’ The smart contract computes all nodes of the SMB-tree on the fly and updates the root hash to the blockchain storage β€’ The SMB-tree in the SP keeps the complete structure (to retain the query performance) 1 insert β€’ 𝐷 SMBβˆ’tree = 𝑂 𝐷 π‘‘π‘šπ‘π‘π‘’ + log 𝑂 βˆ™ 𝐷 𝑛𝑓𝑛 + 𝐺 𝐷 β„Žπ‘π‘‘β„Ž + 𝐷 𝑑𝑑𝑒𝑝𝑠𝑓 + 𝐷 π‘‘π‘£π‘žπ‘’π‘π‘’π‘“ 4/10/2019 13

  14. MB-tree vs SMB-tree 4/10/2019 14

  15. Gas-Efficient Merkle Merge Tree (GEM 2 -Tree) β€’ Maintain multiple separate structures β€’ A series of small SMB-trees: index newly inserted objects β€’ A full materialized MB-tree: merge the objects of the largest SMB-trees in batch Bulk Insert New object … MB-tree SMB-trees 4/10/2019 15

  16. An Example β€’ Exponentially-sized partition space: each contains 1 or 2 SMB-trees β€’ Partition table stores location range and root hash values β€’ Key_map stores the key with the storage location (used in update operation) 4/10/2019 16

  17. An Example β€’ Exponentially-sized partition space: each contains 1 or 2 SMB-trees β€’ Partition table stores location range and root hash values β€’ Key_map stores the key with the storage location (used in update operation) 4/10/2019 16

  18. An Example Exponential size β€’ Exponentially-sized partition space: each contains 1 or 2 SMB-trees β€’ Partition table stores location range and root hash values β€’ Key_map stores the key with the storage location (used in update operation) 4/10/2019 16

  19. An Example Exponential size β€’ Exponentially-sized partition space: each contains 1 or 2 SMB-trees β€’ Partition table stores location range and root hash values β€’ Key_map stores the key with the storage location (used in update operation) 4/10/2019 16

  20. An Example Exponential size Unsorted Sorted β€’ Exponentially-sized partition space: each contains 1 or 2 SMB-trees β€’ Partition table stores location range and root hash values β€’ Key_map stores the key with the storage location (used in update operation) 4/10/2019 16

  21. An Example Exponential size Unsorted Sorted β€’ Exponentially-sized partition space: each contains 1 or 2 SMB-trees β€’ Partition table stores location range and root hash values β€’ Key_map stores the key with the storage location (used in update operation) 4/10/2019 16

  22. Insertion If 𝑄 𝑛𝑏𝑦 is not full, insert object to 𝑄 𝑛𝑏𝑦 ; β€’ β€’ Example ( 𝑁 = 2 ) β€’ Else merge the two SMB-trees to a bigger SMB-tree 4/10/2019 17

  23. Insertion If 𝑄 𝑛𝑏𝑦 is not full, insert object to 𝑄 𝑛𝑏𝑦 ; β€’ β€’ Example ( 𝑁 = 2 ) β€’ Else merge the two SMB-trees to a bigger SMB-tree 𝑛𝑏𝑦 = 1 [1-2] [3-4] 𝑄 1 4/10/2019 17

  24. Insertion If 𝑄 𝑛𝑏𝑦 is not full, insert object to 𝑄 𝑛𝑏𝑦 ; β€’ β€’ Example ( 𝑁 = 2 ) β€’ Else merge the two SMB-trees to a bigger SMB-tree 𝑛𝑏𝑦 = 1 [1-2] [3-4] 𝑄 1 𝑛𝑏𝑦 = 2 [1-4] null [5-6] [7-8] 𝑄 𝑄 2 1 4/10/2019 17

  25. Insertion If 𝑄 𝑛𝑏𝑦 is not full, insert object to 𝑄 𝑛𝑏𝑦 ; β€’ β€’ Example ( 𝑁 = 2 ) β€’ Else merge the two SMB-trees to a bigger SMB-tree 𝑛𝑏𝑦 = 1 [1-2] [3-4] 𝑄 1 𝑛𝑏𝑦 = 2 [1-4] null [5-6] [7-8] 𝑄 𝑄 2 1 𝑛𝑏𝑦 = 2 [1-4] [5-8] [9-10] [11-12] 𝑄 𝑄 2 1 4/10/2019 17

  26. Insertion If 𝑄 𝑛𝑏𝑦 is not full, insert object to 𝑄 𝑛𝑏𝑦 ; β€’ β€’ Example ( 𝑁 = 2 ) β€’ Else merge the two SMB-trees to a bigger SMB-tree 𝑛𝑏𝑦 = 1 [1-2] [3-4] 𝑄 1 𝑛𝑏𝑦 = 2 [1-4] null [5-6] [7-8] 𝑄 𝑄 2 1 𝑛𝑏𝑦 = 2 [1-4] [5-8] [9-10] [11-12] 𝑄 𝑄 2 1 𝑛𝑏𝑦 = 3 [1-8] null [9-12] null [13-14] [15-16] 𝑄 𝑄 2 𝑄 3 4/10/2019 1 17

  27. Update and Query Processing β€’ Update β€’ Observation: storage location of each search key is fixed (key_map) β€’ The GEM 2 -tree structure remains unchanged β€’ Update the value of an existing key with a new value β€’ Recompute the root hash of the MB-tree or SMB-tree β€’ Query processing β€’ The SP traverses the MB-tree and multiple SMB-trees β€’ Process the range query on them individually β€’ Combines the results and VO for each of these trees β€’ The client checks the VO and results against each of these trees 4/10/2019 18

  28. Optimized GEM 2* -Tree β€’ Objective: to further reduce the gas consumption without sacrificing much of the query overhead β€’ Design structure β€’ Two-level index β€’ Upper level: split the search key domain into several regions β€’ Lower level: a GEM 2 -tree is built for each region 𝐽 𝑗 β€’ Only one single MB-tree for the entire GEM 2βˆ— -tree 4/10/2019 19

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend