This repository is the code base of the paper titled in "L2chain: Towards High-performance, Confidential and Secure Layer-2 Blockchain Solution for Decentralized Applications".
It aims to implement a proof-of-concept prototype of the proposed layer-2 architecture. Specifically, the simulator under the scripts/
folder provides a comprehensive process simulation by breaking down the main workflows, which provides the evaluations in the paper.
This repository will be updated continuously, aiming to provide an end-to-end solution under the proposed architecture.
Environment requirements: Ubuntu 18.04/20.04 LTS, Rust 1.6, Python 3.8
Install SGX driver by running sudo ./scripts/install_sgx_driver.sh
. For more reference please refer to the official document.
For simulator:
cd scripts/simulator
pip install -r requirements.txt
sudo apt install python3-dev
cd enclaves & make
Make sure the RSA accumulator implementation from https://github.com/oleiba/RSA-accumulator is in the scripts/simulator
directory. Meanwhile, the Python shared library is required. To install it on Ubuntu:
sudo apt install python3-dev
References:
Raft: python implementation https://github.com/bakwc/PySyncObj
RSA_accumulator: python implementation https://github.com/oleiba/RSA-accumulator
Rust implementation https://github.com/cambrian/accumulator
Rust Blockchain (in developing...): https://github.com/hkbudb/slimchain
To get the YCSB workloads files, please visit https://github.com/brianfrankcooper/YCSB
cd workloads/ycsb
- Download the latest release of YCSB.
- (On Linux) run
download_ycsb/bin/ycsb.sh run basic -P download_ycsb/workloads/workloada >> workloada.txt
(where workloada can be replaced by other workloads) Then you can get text files contatining fileds like:
UPDATE usertable <user> [ field="<value>" ]
READ usertable <user> [ <all fields>]