• Stars
    star
    539
  • Rank 82,402 (Top 2 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created almost 8 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Air-gapped crypto wallet.

Logo Black Logo White



Air-gapped cold storage for your crypto keys



Introduction

Polkadot Vault is a mobile application that allows any smartphone to act as an air-gapped crypto wallet. This is also known as "cold storage".

You can create accounts in Substrate-based networks, sign messages/transactions, and transfer funds to and from these accounts without any sort of connectivity enabled on the device.

You must turn off or even physically remove the smartphone's Wifi, Mobile Network, and Bluetooth to ensure that the mobile phone containing these accounts will not be exposed to any online threat. Switching to airplane mode suffices in many cases.

☝️ Disabling the mobile phone's networking abilities is a requirement for the app to be used as intended, check our wiki for more details.

Any data transfer from or to the app happens using QR code. By doing so, the most sensitive piece of information, the private keys, will never leave the phone. The Polkadot Vault mobile app can be used to store any Substrate account, this includes Polkadot (DOT) and Kusama (KSM) networks.

Available for both iOS and Android.

Links

Features

  • Generate and store multiple private keys
  • Parse and sign transactions
  • Use derived keys to have multiple addresses with a single seed phrase
  • Backup and restore your accounts
  • View activity log to detect unauthorized access
  • Update metadata without going online
  • Add new networks

How to use

Please read our documentation before using Vault for the first time or before upgrading. It covers the main use-cases such as installing on a new phone, creating keys, upgrading and adding new networks:

👉 https://paritytech.github.io/parity-signer/index.html

To contribute into the documentation use docs folder

Project Structure

Vault is a native app for iOS and Android. Native UI's are written on Swift and Kotlin and built on top of a universal Rust core library, which implements all the logic. Here's a rough folder structure of the project.

  • android - Android project. Builds by Android Studio automatically
  • docker - files for CI on gitlab
  • docs - official documentation. Built and published on each commit
  • ios - iOS project folder. Read how to build it in the "Build Process" section
  • rust - backend Rust code. Internals are listed below
  • scripts - mostly releasing scripts and ./build.sh required for building iOS library

Since most of the application logic is concentrated in the rust folder, it makes sense to review it separately.

There are 3 actual endpoints in rust folder: signer, which is source of library used for Vault itself; generate_message, which is used to update Vault repo with new built-in network information and to generate over-the-airgap updates; and qr_reader_pc which is a minimalistic app to parse qr codes that we had to write since there was no reasonably working alternative.

Sub-folders of the rust folder:

  • constants — constant values defined for the whole workspace.
  • 🔥 db_handling — all database-related operations for Vault and generate_message tool. Most of the business logic is contained here.
  • defaults — built-in and test data for database
  • definitions — objects used across the workspace are defined here
  • files — contains test files and is used for build and update generation processes. Most contents are gitignored.
  • generate_message — tool to generate over-the-airgap updates and maintain network info database on hot side
  • 🔥 navigator — navigation for Vault app; it is realized in rust to unify app behavior across the platforms
  • parser - parses signable transactions. This is internal logic for transaction_parsing that is used when signable transaction is identified, but it could be used as a standalone lib for the same purpose.
  • printing_balance — small lib to render tokens with proper units
  • qr_reader_pc — small standalone PC app to parse QR codes in Vault ecosystem. Also is capable of parsing multiframe payloads (theoretically, in practice it is not feasible due to PC webcam low performance)
  • qr_reader_phone — logic to parse QR payloads in Vault
  • qrcode_rtx — multiframe erasure-encoded payload generator for signer update QR animation.
  • qrcode_static — generation of static qr codes used all over the workspace
  • 🔥 signer — FFI interface crate to generate bindings that bridge native code and rust backend
  • transaction_parsing — high-level parser for all QR payloads sent into Vault
  • transaction_signing — all operations that could be performed when user accepts payload parsed with transaction_parsing

🔥 — this emoji means an important folder for the application logic

Build Process

1. First and foremost, make sure you have the latest Rust installed in your system. Nothing will work without Rust.

If you get errors like cargo: feature X is required, it most likely means you have an old version of Rust. Update it by running rustup update stable.

2. Install uniffi-bindgen. Version has to match the version of uniffi crates specified in the project (currently it is 0.22.0):

cargo install uniffi_bindgen --version 0.22.0

3. Ensure opencv crate dependencies.

iOS

4. You probably already have Xcode installed if you are reading this. If not, go get it.

5. Install dependencies Currently most of iOS tooling is integrated via Homebrew to avoid use of CocoaPods.

Before running project for the first time, run the following in the console

brew install swiftgen
brew install swiftformat
brew install swiftlint

If you are using M1 machine, it might be necessary to run following commands for XCode's Build Phases to run tooling correctly:

sudo ln -s /opt/homebrew/bin/swiftgen /usr/local/bin/swiftgen
sudo ln -s /opt/homebrew/bin/swiftformat /usr/local/bin/swiftformat
sudo ln -s /opt/homebrew/bin/swiftlint /usr/local/bin/swiftlint

6. Open the PolkadotVault.xcodeproj project from the ios folder in your Xcode. Project features two schemes:

  • PolkadotVault - used for deployments and running production-ready app on your devices
  • PolkadotVault-Dev - development scheme that can be used to simulate offline mode without turning off WiFi on your Mac if you are using simulator. To run project, select one of the schemes and click Run (Cmd+R)

Note: If you are using PolkadotVault scheme, the first time you start the app, you will need to put your device into Airplane Mode. In the iOS simulator, you can do this by turning off WiFi on your Mac, hence use of PolkadotVault-Dev is recommended for both simulator and device development.

However, we strongly recommend that you use a real device for development, as some important parts (e.g. camera) may not work in the simulator.

Android

4. Install necessary rust targets (this set may vary depending on the target device architecture you are building for):

 rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android

Note - old x86 is not supported. Just use x86_64 emulator image.

5. Download Android Studio.

6. Open the project from the root directory.

7. Install NDK. Currently specific version 24.0.8215888 is required.

Android Studio -> SDK Manager -> SDK Tools tab. Find NDK there. Enable "Show package details" checkmark to select specific version.

8. Connect your device or create a virtual one. Open Tools -> Device Manager and create a new phone simulator with the latest Android.

9. (macOS) : Specify path to python in local.properties.

rust.pythonCommand=python3

10. Run the project (Ctrl+R). It should build the Rust core library automatically.

Release Android

  • Create PR with new app version updated and tag v* (example "v6.1.3")
  • After merging to master - run release-android.yml flow. It will build and sign apk and upload it to internal track in play store
  • Create github release with apk from release flow
  • Go to play store, promote internal track to production and update changes in play store

Tests

Core Rust code is fully covered by tests, and they run in CI on each commit. To run tests on your machine:

cd rust && cargo test --locked

We don't have test for UIs for now (other than navigation which is handled on rust side), which means Swift and Kotlin are not covered. We plan to do it in the future.

Bugs and Feedback

If you found a bug or want to propose an improvement, please open an issue.

Try to create bug reports that are:

  • Reproducible. Include steps to reproduce the problem.
  • Specific. Include as much detail as possible: which version, what phone, OS, etc.
  • Unique. Do not duplicate existing opened issues.
  • Scoped to a Single Bug. One bug per report.

Official team email for direct inquiries: [email protected]

Contributing

Our contribution guidelines are still in development. Until then, you're welcome to participate in discussions and send PRs with small bugfixes, we'd love it. Each PR must be reviewed by at least two project maintainers.

License

Polkadot-Vault is GPL 3.0 licensed.

More Repositories

1

substrate

Substrate: The platform for blockchain innovators
Rust
8,212
star
2

polkadot

Polkadot Node Implementation
Rust
6,865
star
3

ink

Parity's ink! to write smart contracts.
Rust
1,316
star
4

wasmi

WebAssembly (Wasm) interpreter.
Rust
1,269
star
5

polkadot-sdk

The Parity Polkadot Blockchain SDK
Rust
979
star
6

jsonrpc

Rust JSON-RPC implementation
Rust
752
star
7

parity-bitcoin

The Parity Bitcoin client
Rust
726
star
8

cumulus

Write Parachains on Substrate
Rust
618
star
9

frontier

Ethereum compatibility layer for Substrate.
Rust
496
star
10

polkadot-launch

Simple CLI tool to launch a local Polkadot test network
TypeScript
458
star
11

jsonrpsee

Rust JSON-RPC library on top of async/await
Rust
457
star
12

parity-wasm

WebAssembly serialization/deserialization in rust
Rust
395
star
13

subxt

Submit extrinsics (transactions) to a substrate node via RPC
Rust
317
star
14

parity-bridge

Rust
317
star
15

substrate-telemetry

Polkadot Telemetry service
Rust
303
star
16

smoldot

Alternative client for Substrate-based chains.
Rust
286
star
17

parity-common

Collection of crates used in Parity projects
Rust
284
star
18

parity-bridges-common

Collection of Useful Bridge Building Tools 🏗️
Rust
265
star
19

parity-db

Experimental blockchain database
Rust
263
star
20

banana_split

Shamir's Secret Sharing for people with friends
TypeScript
259
star
21

substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
TypeScript
245
star
22

parity-scale-codec

Lightweight, efficient, binary serialization and deserialization codec
Rust
244
star
23

substrate-connect

Run Wasm Light Clients of any Substrate based chain directly in your browser.
TypeScript
230
star
24

cargo-contract

Setup and deployment tool for developing Wasm based smart contracts via ink!
Rust
226
star
25

trie

Base-16 Modified Patricia Merkle Tree (aka Trie)
Rust
201
star
26

substrate-archive

Blockchain Indexing Engine
Rust
197
star
27

shasper

Parity Shasper beacon chain implementation using the Substrate framework.
Rust
196
star
28

parity-zcash

Rust implementation of Zcash protocol
Rust
184
star
29

cachepot

cachepot is `sccache` with extra sec, which in turn is `ccache` with cloud storage
Rust
174
star
30

libsecp256k1

Pure Rust Implementation of secp256k1.
Rust
172
star
31

homebrew-paritytech

Homebrew tap for ethcore
Ruby
160
star
32

zombienet

A cli tool to easily spawn ephemeral Polkadot/Substrate networks and perform tests against them.
TypeScript
158
star
33

polkadot-staking-dashboard

A dashboard for Polkadot staking and nomination pools.
TypeScript
152
star
34

xcm-format

Polkadot Cross Consensus-system Message format.
143
star
35

finality-grandpa

finality gadget for blockchains using common prefix agreement
Rust
139
star
36

substrate-contracts-node

Minimal Substrate node configured for smart contracts via pallet-contracts.
Rust
124
star
37

capi

[WIP] A framework for crafting interactions with Substrate chains
TypeScript
105
star
38

grandpa-bridge-gadget

A Bridge Gadget to Grandpa Finality.
Rust
99
star
39

substrate-debug-kit

A collection of debug tools, scripts and libraries on top of substrate.
Rust
94
star
40

ink-examples

A set of examples for ink! smart contract language. Happy hacking!
Rust
89
star
41

subport

Parity Substrate(-based) chains usage and development support
Rust
84
star
42

wasm-utils

Rust
82
star
43

trappist

Rust
82
star
44

txwrapper-core

Tools for FRAME chain builders to publish chain specific offline transaction generation libraries.
TypeScript
77
star
45

substrate-playground

Start hacking your substrate runtime in a web based VSCode like IDE
TypeScript
74
star
46

scale-info

Info about SCALE encodable Rust types
Rust
73
star
47

parity-tokio-ipc

Parity tokio-ipc
Rust
73
star
48

substrate-light-ui

Minimal, WASM-light-client-bundled Substrate wallet for balance transfers
TypeScript
72
star
49

substrate-ui

Bondy Polkadot UI
JavaScript
72
star
50

statemint

Statemint Node Implementation
Rust
71
star
51

canvas

Node implementation for Canvas ‒ a Substrate parachain for smart contracts.
Rust
69
star
52

substrate-up

Scripts for working with new Substrate projects
Shell
66
star
53

useink

A React hooks library for ink!
TypeScript
62
star
54

stateless-blockchain

Stateless Blockchain on Substrate using RSA Accumulators
Rust
60
star
55

txwrapper

Helper funtions for offline transaction generation.
TypeScript
58
star
56

contracts-ui

Web application for deploying wasm smart contracts on Substrate chains that include the FRAME contracts pallet
TypeScript
58
star
57

awesome-ink

A curated list of awesome projects related to Parity's ink!.
56
star
58

srtool

A fork of chevdor's srtool
Shell
56
star
59

cargo-unleash

cargo release automatisation tooling for massiv mono-repos
Rust
55
star
60

ss58-registry

Registry for SS58 account types
Rust
55
star
61

oo7

The Bonds framework along with associated modules.
JavaScript
53
star
62

diener

Diener - dependency diener is a tool for easily changing https://github.com/paritytech/substrate or https://github.com/paritytech/polkadot dependency versions
Rust
52
star
63

lunarity

Lunarity - a Solidity parser in Rust
Rust
50
star
64

nohash-hasher

An implementation of `std :: hash :: Hasher` which does not hash at all.
Rust
49
star
65

arkworks-extensions

Library to integrate arkworks-rs/algebra into Substrate
Rust
47
star
66

wasm-instrument

Instrument and transform wasm modules.
Rust
47
star
67

asset-transfer-api

Typescript API aiming to provide clear, and simple to use tools for transferring assets across common good parachains.
TypeScript
43
star
68

fleetwood

Testbed repo for trying out ideas of what a smart contract API in Rust would look like
Rust
41
star
69

scripts

Collection of Dockerfiles, scripts and related resources
Dockerfile
40
star
70

trappist-extra

Dart
38
star
71

polkadot-introspector

A collection of tools focused on debugging and monitoring the relay chain and parachain progress from a 🐦-view
Rust
38
star
72

parity-extension

Parity Chrome Extension
JavaScript
37
star
73

rhododendron

Asynchronously safe BFT consensus, implementation in Rust
Rust
36
star
74

desub

Decode Substrate with Backwards-Compatible Metadata
Rust
36
star
75

ethkey

Ethereum key generator
Rust
35
star
76

psvm

Polkadot SDK Version Manager
Rust
35
star
77

substrate-open-working-groups

The Susbstrate Open Working Groups (SOWG) are community-based mechanisms to develop standards, specifications, implementations, guidelines or general initiatives in regards to the Substrate framework. It could, but not restricted to, lead to new Polkadot Standards Proposals. SOWG is meant as a place to find and track ongoing efforts and enable everybody with similar interests to join and contribute.
35
star
78

substrate-bip39

Rust
34
star
79

primitives

Rust
34
star
80

parity-config-generator

Parity Config Generator
JavaScript
34
star
81

zombienet-sdk

ZombieNet SDK
Rust
33
star
82

Nomidot

Staking Portal for Polkadot and Kusama
TypeScript
32
star
83

subdb

Experimental domain-specific database for Substrate
Rust
32
star
84

polkadot-api

TypeScript
31
star
85

polkadot-testnet-faucet

TypeScript
30
star
86

polkassembly

Polkassembly now has a new home:
TypeScript
30
star
87

pallet-contracts-waterfall

Collection of simple Substrate smart contract examples written in Rust, AssemblyScript, Solang and the smart contract language ink! to test substrates pallet-contracts module
TypeScript
30
star
88

metadata-portal

Metadata portal for Parity Signer
TypeScript
29
star
89

polkadot-onboard

A wallet integration SDK to facilitate adding different type of wallets (extension, WC, Ledger) to Dapps.
TypeScript
28
star
90

vscode-substrate

Substrate Marketplace VSCode Plugin
TypeScript
28
star
91

oo7-bare

The Bond API.
JavaScript
27
star
92

bigint

Rust
27
star
93

extended-parachain-template

Node template to build parachains with all the required pallets. Slightly opinionated based on what majority of parachain teams are using.
Rust
27
star
94

orchestra

A partial actor pattern with a global orchestrator.
Rust
27
star
95

polkadot-scripts

Collection of random scripts and utilities written for Polkadot
TypeScript
27
star
96

sub-flood

Flooding substrate node with transactions
TypeScript
26
star
97

polkadot-cloud

[BETA] A library and automated platform for developing and publishing assets for Polkadot dapps.
TypeScript
25
star
98

ink-playground

Browser Based Playground for editing, sharing & compiling ink! Smart Contracts
Rust
25
star
99

link

Unstoppable URL shortener built with the ink! smart contract language.
TypeScript
25
star
100

sms-verification

SMS verification for Parity.
JavaScript
25
star