vchain-demo
Source code for the SIGMOD20 paper "vChain: A Blockchain System Ensuring Query Integrity"
Science Score: 31.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
Repository
Source code for the SIGMOD20 paper "vChain: A Blockchain System Ensuring Query Integrity"
Basic Info
- Host: GitHub
- Owner: hkbudb
- License: apache-2.0
- Language: Rust
- Default Branch: master
- Homepage: https://xuc.me/publication/sigmod20/vchain-demo/
- Size: 226 KB
Statistics
- Stars: 25
- Watchers: 1
- Forks: 4
- Open Issues: 2
- Releases: 0
Topics
Metadata Files
README.md
vChain Demo
WARNING: This is an academic proof-of-concept prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.
If you find the code here useful, please consider to cite the following papers:
```bibtex @inproceedings{SIGMOD19:vchain, author = {Xu, Cheng and Zhang, Ce and Xu, Jianliang}, title = {{vChain}: Enabling Verifiable Boolean Range Queries over Blockchain Databases}, booktitle = {Proceedings of the 2019 ACM SIGMOD International Conference on Management of Data}, year = {2019}, month = jun, address = {Amsterdam, Netherlands}, pages = {141--158}, isbn = {978-1-4503-5643-5}, doi = {10.1145/3299869.3300083} }
@inproceedings{SIGMOD20:vchain-demo, author = {Wang, Haixin and Xu, Cheng and Zhang, Ce and Xu, Jianliang}, title = {{vChain}: A Blockchain System Ensuring Query Integrity}, booktitle = {Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data}, year = {2020}, month = jun, address = {Portland, OR, USA}, pages = {2693--2696}, isbn = {978-1-4503-6735-6}, doi = {10.1145/3318464.3384682} } ```
Build
- Install Rust from https://rustup.rs.
- Run
cargo testfor unit test. - Run
cargo build --releaseto build the binaries, which will be located attarget/release/folder.
SimChain
Create Blockchain DB
Input Format
The input is a text file with each line represent an object.
obj := block_id [ v_data ] { w_data }
v_data := v_1, v_2, ...
w_data := w_1, w_2, ...
For example
1 [1,2] {a,b,c}
1 [1,5] {a}
2 [3,4] {a,e}
Build DB
Run simchain-build to build the database. You need to specify the bit length for each dimension of the v data. For example:
sh
./target/release/simchain-build --bit-len 16,16 --skip-list-max-level 10 -i /path/to/data.txt -o /path/to/output_database
Run simchain-build --help for more info.
Start the Server
Run simchain-server after the database is built. For example:
sh
./target/release/simchain-server -b 127.0.0.1:8000 --db /path/to/database
Run simchain-server --help for more info.
Server REST API
Inspect
Use following API endpoints to inspect the blockchain. Returned response is a JSON object. Refer to source code for their definitions.
GET /get/param
GET /get/blk_header/{id}
GET /get/blk_data/{id}
GET /get/intraindex/{id}
GET /get/skiplist/{id}
GET /get/index/{id}
GET /get/obj/{id}
Query
API endpoint is:
POST /query
Encode query parameter as a JSON object. The following example specifies range as [(1, *, 2), (3, *, 4)] for 3 dimension objects, and bool expression as "A" AND ("B" OR "C").
json
{
"start_block": 1,
"end_block": 10,
"range": [[1, null, 2], [3, null, 4]],
"bool": [["a"], ["b", "c"]]
}
The response is a JSON object like:
json
{
"result": ...,
"vo": ...,
"query_time_in_ms": ...,
"vo_size": ... // in bytes
"stats": ...,
...
}
Refer to the source code for their definitions.
Verify
Pass the query response directly to the following endpoint for verification.
POST /verify
The response is a JSON object like:
json
{
"pass": true,
"detail": ... // detail reason for failure
"verify_time_in_ms": ...
}
Real Chain
Start the Node
Run vchain-node to start up a single node blockchain network. For example:
sh
./vchain-node -- --bit-len 16,16 --skip-list-max-level 5 --db /path/to/database
Run vchain-node --help for more info.
Send TX
Run vchain-send-tx to send TX to the node. The data input format is the same as that in the SimChain.
sh
./vchain-send-tx -- -i /path/to/data.txt
Run vchain-send-tx --help for more info.
Start the Server
Run vchain-server to start a server. The REST APIs are the same as those in the SimChain.
sh
./vchain-server -b 127.0.0.1:8000
Run vchain-server --help for more info.
Owner
- Name: HKBU DB
- Login: hkbudb
- Kind: organization
- Website: http://www.comp.hkbu.edu.hk/~db/
- Repositories: 3
- Profile: https://github.com/hkbudb
Citation (CITATION.bib)
@inproceedings{SIGMOD19:vchain,
author = {Xu, Cheng and Zhang, Ce and Xu, Jianliang},
title = {{vChain}: Enabling Verifiable Boolean Range Queries over Blockchain Databases},
booktitle = {Proceedings of the 2019 ACM SIGMOD International Conference on Management of Data},
year = {2019},
month = jun,
address = {Amsterdam, Netherlands},
pages = {141--158},
isbn = {978-1-4503-5643-5},
doi = {10.1145/3299869.3300083}
}
@inproceedings{SIGMOD20:vchain-demo,
author = {Wang, Haixin and Xu, Cheng and Zhang, Ce and Xu, Jianliang},
title = {{vChain}: A Blockchain System Ensuring Query Integrity},
booktitle = {Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data},
year = {2020},
month = jun,
address = {Portland, OR, USA},
pages = {2693--2696},
isbn = {978-1-4503-6735-6},
doi = {10.1145/3318464.3384682}
}
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Dependencies
- actix-rt 1.1 development
- criterion 0.3 development
- env_logger 0.8 development
- rand 0.7 development
- serde_json 1.0 development
- anyhow 1.0
- ark-bls12-381 0.2
- ark-ec 0.2
- ark-ff 0.2
- ark-poly 0.2
- async-trait 0.1
- bincode 1.3
- blake2b_simd 0.5
- futures 0.3
- hex 0.4
- howlong 0.1
- itertools 0.10
- lazy_static 1.4
- log 0.4
- rayon 1.5
- serde 1.0
- smallvec 1.6
- exonum-testkit 0.13.0-rc.2 development
- actix-cors 0.5
- actix-rt 1.1
- actix-web 3.3
- anyhow 1.0
- async-trait 0.1
- bincode 1.3
- env_logger 0.8
- exonum 0.13.0-rc.2
- exonum-crypto 0.13.0-rc.2
- exonum-derive 0.13.0-rc.2
- exonum-merkledb 0.13.0-rc.2
- exonum-proto 0.13.0-rc.2
- failure 0.1
- futures 0.3
- lazy_static 1.4
- log 0.4
- lru 0.6
- os_info =1.0.1
- protobuf 2.19
- reqwest 0.11
- serde 1.0
- serde_derive 1.0
- serde_json 1.0
- structopt 0.3