README.md 4.14 KB
Newer Older
Stan Kladko's avatar
Stan Kladko committed
1
# sgxwallet: SKALE SGX-based hardware crypto wallet 
Stan Kladko's avatar
Stan Kladko committed
2

Chadwick Strange's avatar
Chadwick Strange committed
3 4
<!-- SPDX-License-Identifier: (AGPL-3.0-only OR CC-BY-4.0) -->

Chadwick Strange's avatar
Chadwick Strange committed
5
[![Discord](https://img.shields.io/discord/534485763354787851.svg)](https://discord.gg/vvUtWJB)
Chadwick Strange's avatar
Chadwick Strange committed
6

Stan Kladko's avatar
Stan Kladko committed
7 8
## Intro

9 10 11 12 13 14 15 16 17
**sgxwallet** is a next generation hardware secure crypto wallet that is based on **Intel SGX** technology. It currently supports **Ethereum** and **SKALE**, and will support **Bitcoin** in the future.

**sgxwallet** runs as a network server.  Clients connect to the server, authenticate to it using 
TLS 1.0 protocol with client certificates, and then issue requests to the server to generate crypto 
keys and perform cryptographic operations. The keys are generated inside the secure SGX enclave and never
leave the enclave unencrypted.  

The server provides an initial registration service to issue client certificates to the clients.
The administrator manually approves each registration.
kladkogex's avatar
kladkogex committed
18

19
**sgxwallet** has been tested on **Ubuntu Linux 18.04**.
Stan Kladko's avatar
Stan Kladko committed
20

Chadwick Strange's avatar
Chadwick Strange committed
21 22
## An important note about production readiness

Chadwick Strange's avatar
Chadwick Strange committed
23
The sgxwallet server is still in active development and therefore should be regarded as _alpha software_. The development is still subject to security hardening, further testing, and breaking changes.  **This server has not yet been reviewed or audited for security.**  Please see [SECURITY.md](SECURITY.md) for reporting policies.
Chadwick Strange's avatar
Chadwick Strange committed
24

kladko's avatar
kladko committed
25 26 27
![Build, test and push sgxwallet container](https://github.com/skalenetwork/sgxwallet/workflows/Build,%20test%20and%20push%20sgxwallet%20container/badge.svg)
![Build, test and push sim mode container](https://github.com/skalenetwork/sgxwallet/workflows/Build,%20test%20and%20push%20sim%20mode%20container/badge.svg)

Chadwick Strange's avatar
Chadwick Strange committed
28
## Running sgxwallet
kladko's avatar
kladko committed
29

kladko's avatar
kladko committed
30 31 32 33 34 35 36 37
### Clone this repo

As you probably suspect, the first thing to do is to clone this repository and all it is sub-repositories. 

```bash
git clone https://github.com/skalenetwork/sgxwallet.git --recurse-submodules
```

Chadwick Strange's avatar
Chadwick Strange committed
38
### Try in simulation mode
Chadwick Strange's avatar
Chadwick Strange committed
39

Chadwick Strange's avatar
Chadwick Strange committed
40
The easiest way to try the sgxwallet server is to run a docker container in insecure simulation mode that emulates an SGX processor. Once you are familiar with the server, you can enable sgx on your machine and run it in secure production mode.
kladkogex's avatar
kladkogex committed
41

kladko's avatar
kladko committed
42
First install docker-compose if you dont have it
kladkogex's avatar
kladkogex committed
43

kladko's avatar
kladko committed
44 45 46 47 48
```bash
sudo apt-get install docker.io docker-compose
```

Then run sgxwallet using docker-compose
kladko's avatar
kladko committed
49

Stan Kladko's avatar
Stan Kladko committed
50
```bash
kladko's avatar
kladko committed
51
cd run_sgx_sim; sudo docker-compose up
Chadwick Strange's avatar
Chadwick Strange committed
52
```
Stan Kladko's avatar
Stan Kladko committed
53

Stan Kladko's avatar
Stan Kladko committed
54
Note: you need a machine that supports Intel AVX512 instruction set.  Most modern Intel CPUs support it. To verify you machine supports AVX512, run
Stan Kladko's avatar
Stan Kladko committed
55 56 57 58 59 60 61


```
cat /proc/cpuinfo | grep avx512
```


kladko's avatar
kladko committed
62 63
Note: sgxwallet requires docker-compose for correct operation. You must always use 
docker-compose and avoid using raw docker tools.
Chadwick Strange's avatar
Chadwick Strange committed
64

Stan Kladko's avatar
Stan Kladko committed
65
Note: simulation mode is only to try sgxwallet. 
kladko's avatar
kladko committed
66 67 68
In production, you need to run sgxwallet on a server that supports SGX.
Never run a production sgxserver in simulation mode.  

kladko's avatar
kladko committed
69
## Admin guide
kladko's avatar
kladko committed
70

kladko's avatar
kladko committed
71 72
If you are a SKALE validator and want to run sgxwallet for testnet or mainnet usage, you need
 a SGX-capable server.  
kladko's avatar
kladko committed
73
Please refer to Admin guide for details on how to setup sgxwallet in a secure hardware mode 
kladko's avatar
kladko committed
74
 [docs/admin-guide.md](docs/admin-guide.md).
Chadwick Strange's avatar
Chadwick Strange committed
75

kladko's avatar
kladko committed
76
## Developer guide
Stan Kladko's avatar
Stan Kladko committed
77

kladko's avatar
kladko committed
78
If you are a SKALE developer and want to build sgxwallet from source, please refer to Developer
kladko's avatar
kladko committed
79
guide [docs/developer-guide.md](docs/developer-guide.md).
Stan Kladko's avatar
Stan Kladko committed
80

Chadwick Strange's avatar
Chadwick Strange committed
81
## Contributing
Stan Kladko's avatar
Stan Kladko committed
82

Chadwick Strange's avatar
Chadwick Strange committed
83
See [contributing](CONTRIBUTING.md) for information on how to contribute.
Chadwick Strange's avatar
Chadwick Strange committed
84

kladko's avatar
kladko committed
85
## Libraries used by this project
Chadwick Strange's avatar
Chadwick Strange committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

-   [Intel-SGX-SSL by Intel](https://github.com/intel/intel-sgx-ssl)
-   [LevelDB by Google](https://github.com/google/leveldb)
-   [libBLS by SKALE Labs](https://github.com/skalenetwork/libBLS)
-   [libff by SCIPR-LAB](http://www.scipr-lab.org/)
-   [Linux SGX Driver by Intel](https://github.com/intel/linux-sgx-driver)
-   [SGX-GMP by Intel](https://github.com/intel/sgx-gmp)
-   [SGX Software Enable by Intel](https://github.com/intel/sgx-software-enable)

## License

[![License](https://img.shields.io/github/license/skalenetwork/sgxwallet.svg)](LICENSE)

All contributions to sgxwallet are made under the [GNU Affero General Public License v3](https://www.gnu.org/licenses/agpl-3.0.en.html). See [LICENSE](LICENSE).

Copyright (C) 2019-Present SKALE Labs.