Go to file
Fredrik Harrysson 75b6a31e87 Trezor Support (#6403)
* Copy modal from keepkey branch and generalize

The keepkey PinMatrix modal needs to be the same for Trezor, but we
should probably try to keep it general since it can be used for both.

* Add trezor communication code

This is a result of much trial-and-error and a couple of dead-ends in
how to communicate and wire everything up.

Code here is still a bit WIP with lots of debug prints and stuff.

The test works though, it is possible to sign a transaction.

* Extend the basic lib to allow Trezor

This is kind of ugly and needs some cleanup and generalization. I’ve
just copy-pasted some things to bring in the trezor wallets. I’ve also
had to add a lock to the USB API so that only one thing talks to the
USB at once.

* Add RPC plumbing needed

We need to be able to get “locked” devices from the frontend to figure
out if we’re going to display the PinMatrix or not. Then we need to be
able to send a pin to a device.

* Add logic to query backend for Trezor and display PinMatrix

There’s a bug somewhere here because signing a transaction fails if you
take too long to press the confirm button on the device.

* Change back to paritytech branch

As my fork has been merged in.

* Converting spaces to tabs, as it should be

* Incorporate correct handling of EIP-155

Turns out the Trezor was adjusting the v part of the signature, and
we’re already doing that so it was done twice.

* Some circular logic here that was incorrect

BE-encoded U256 is almost the same as RLP encoded without the
size-byte, except for <u8 sized values. What’s really done is
BE-encoded U256 and then left-trimmed to the smallest size. Kind of
obvious in hindsight.

* Resolve issue where not clicking fast enough fails

The device will not repeat a ButtonRequest when you read from it, so
you need to have a blocking `read` for whatever amount of time that you
want to give the user to click. You could also have a shorter timeout
but keep retrying for some amount of time, but it would amount to the
same thing.

* Scan after pin entry to make accepting it faster

* Remove ability to cancel pin request

* Some slight cleanup

* Probe for the correct HID Version to determine padding

* Move the PinMatrix from Accounts to Application

* Removing unused dependencies

* Mistake in copying over stuff from keepkey branch

* Simplify FormattedMessage

* Move generated code to external crate

* Remove ethcore-util dependency

* Fix broken import in test

This test is useless without a connected Trezor, not sure how to make
it useful without one.

* Merge branch 'master' into fh-4500-trezor-support

# Conflicts:
#	rpc/src/v1/helpers/dispatch.rs

* Ignore test that can't be run without trezor device

* Fixing grumbles

* Avoiding owning data in RPC method
* Checking for overflow in v part of signature
* s/network_id/chain_id
* Propagating an error from the HID Api
* Condensing code a little bit

* Fixing UI.

* Debugging trezor.

* Minor styling tweak

* Make message type into an actual type

This makes the message type that the RPC message accepts into an actual
type as opposed to just a string, based on feedback. Although I’m not
100% sure this has actually improved the situation.

Overall I think the hardware wallet interface needs some refactoring
love.

* Split the trezor RPC endpoint

It’s split into two more generic endpoints that should be suitable for
any hardware wallets with the same behavior to sit behind.

* Reflect RPC method split in javascript

* Fix bug with pin entry

* Fix deadlock for Ledger

* Avoid having a USB lock in just listing locked wallets

* Fix javascript issue (see #6509)

* Replace Mutex with RwLock

* Update Ledger test

* Fix typo causing faulty signatures (sometimes)

* *Actually* fix tests

* Update git submodule

Needed to make tests pass

* Swap line orders to prevent possible deadlock

* Make setPinMatrixRequest an @action
2017-09-14 19:28:43 +02:00
.github Add GitHub issue templates. (#6259) 2017-08-09 08:43:40 +02:00
chainspec Chainspec validation (#6197) 2017-08-02 12:50:36 +02:00
dapps Merge branch 'master' into fo-6418-dont-export-bigint 2017-09-04 18:32:55 +02:00
devtools Bumped version 2017-07-13 15:52:01 +02:00
docker fix docker build in master 2017-07-18 16:17:33 +03:00
ethash replace sha3 with keccak in few comments 2017-08-31 15:25:30 +02:00
ethcore Trezor Support (#6403) 2017-09-14 19:28:43 +02:00
ethcrypto updated tiny-keccak to 1.3 2017-08-07 10:06:02 +02:00
ethkey updated tiny-keccak to 1.3 2017-08-07 10:06:02 +02:00
ethstore SecretStore: encrypt messages using private key from key store (#6146) 2017-08-09 11:09:40 +02:00
evmbin Updating imports that were introduced with merge 2017-09-05 12:08:02 +02:00
evmjit updated tiny-keccak to 1.3 2017-08-07 10:06:02 +02:00
hash-fetch Merge branch 'master' into fo-6418-dont-export-bigint 2017-09-04 18:32:55 +02:00
hw Trezor Support (#6403) 2017-09-14 19:28:43 +02:00
ipc Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
ipc-common-types Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
ipfs Don't reexport bigint from util 2017-09-04 16:36:49 +02:00
js Trezor Support (#6403) 2017-09-14 19:28:43 +02:00
json Transaction permissioning (#6441) 2017-09-05 10:39:50 +01:00
local-store updated serde to version 1.0 2017-07-06 11:36:15 +02:00
logger Bumped version 2017-07-13 15:52:01 +02:00
mac Bump master to 1.8.0 (#6256) 2017-08-08 20:18:00 +02:00
nsis Bump master to 1.8.0 (#6256) 2017-08-08 20:18:00 +02:00
panic_hook Add custom panic hook 2017-07-19 17:50:48 +00:00
parity Compatibility with whisper v6 (#6179) 2017-09-10 18:02:14 +02:00
price-info a bit more idiomatic price-info 2017-08-04 13:39:57 +02:00
rpc Trezor Support (#6403) 2017-09-14 19:28:43 +02:00
rpc_cli updated bigint with optimized mul and from_big_indian 2017-08-17 18:11:34 +02:00
rpc_client remove re-export of parking_lot in util (#6435) 2017-09-02 20:09:13 +02:00
scripts Chainspec validation (#6197) 2017-08-02 12:50:36 +02:00
secret_store secretstore: attributes under docs (#6475) 2017-09-06 11:09:22 +02:00
snap Use git for the snap version (#6271) 2017-08-29 15:14:07 +02:00
stratum Merge branch 'master' into fo-6418-dont-export-bigint 2017-09-04 18:32:55 +02:00
sync Compatibility with whisper v6 (#6179) 2017-09-10 18:02:14 +02:00
updater Merge branch 'master' into fo-6418-dont-export-bigint 2017-09-04 18:32:55 +02:00
util Merge pull request #6464 from paritytech/util_deps_cleanup 2017-09-05 16:21:05 +02:00
whisper Compatibility with whisper v6 (#6179) 2017-09-10 18:02:14 +02:00
windows/ptray Better windows icon (#4804) 2017-03-08 14:42:56 +01:00
.dockerignore improved dockerfile builds (#5659) 2017-05-23 12:25:41 +02:00
.editorconfig Fixing travis.yml 2016-07-11 18:23:24 +02:00
.gitignore npm cleanups (#5512) 2017-04-26 12:38:21 +02:00
.gitlab-ci.yml [ci skip] move Aura test https://github.com/paritytech/parity-import-tests in `nightly` build 2017-07-18 16:45:58 +03:00
.gitmodules WASM contracts MVP (#5679) 2017-07-10 17:42:10 +02:00
CHANGELOG.md Update Changelog for 1.6.10 and 1.7.0 (#6183) 2017-07-28 18:15:04 +02:00
Cargo.lock Trezor Support (#6403) 2017-09-14 19:28:43 +02:00
Cargo.toml Refactor and port CLI from Docopt to Clap (#2066) (#6356) 2017-09-05 12:30:22 +01:00
LICENSE Change to library. 2015-11-24 21:05:08 +01:00
README.md Master requires rust 1.19 (#6308) 2017-08-16 12:24:42 +02:00
SECURITY.md Update SECURITY.md 2017-07-27 15:46:26 +02:00
build.rs Detect rust compiler version in Parity build script, closes 4742 (#4907) 2017-03-15 14:03:11 +01:00
license_header Fix whitespace (#4299) 2017-01-25 18:51:41 +01:00
rust-toolchain rust-toolchain file on master (#6266) 2017-08-14 13:47:53 +02:00
rustfmt.toml remove the deprecated options in rustfmt.toml (#5616) 2017-05-19 17:12:20 +02:00
test.sh Fix typo (#6505) 2017-09-12 09:15:37 +02:00

README.md

Parity - fast, light, and robust Ethereum client

build status Snap Status GPLv3

Join the chat!

Get in touch with us on Gitter: Gitter: Parity Gitter: Parity.js Gitter: Parity/Miners Gitter: Parity-PoA

Be sure to check out our wiki and the internal documentation for more information.


About Parity

Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs.

Parity comes with a built-in wallet. To access Parity Wallet simply go to http://web3.site/ (if you don't have access to the internet, but still want to use the service, you can also use http://127.0.0.1:8180/). It includes various functionality allowing you to:

  • create and manage your Ethereum accounts;
  • manage your Ether and any Ethereum tokens;
  • create and register your own tokens;
  • and much more.

By default, Parity will also run a JSONRPC server on 127.0.0.1:8545. This is fully configurable and supports a number of RPC APIs.

If you run into an issue while using parity, feel free to file one in this repository or hop on our gitter chat room to ask a question. We are glad to help!

For security-critical issues, please refer to the security policy outlined in SECURITY.MD.

Parity's current release is 1.7. You can download it at https://github.com/paritytech/parity/releases or follow the instructions below to build from source.


Build dependencies

Parity requires Rust version 1.19.0 to build

We recommend installing Rust through rustup. If you don't already have rustup, you can install it like this:

  • Linux:

    $ curl https://sh.rustup.rs -sSf | sh
    

    Parity also requires gcc, g++, libssl-dev/openssl, libudev-dev and pkg-config packages to be installed.

  • OSX:

    $ curl https://sh.rustup.rs -sSf | sh
    

    clang is required. It comes with Xcode command line tools or can be installed with homebrew.

  • Windows

    Make sure you have Visual Studio 2015 with C++ support installed. Next, download and run the rustup installer from https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe, start "VS2015 x64 Native Tools Command Prompt", and use the following command to install and set up the msvc toolchain:

    $ rustup default stable-x86_64-pc-windows-msvc
    

Once you have rustup, install parity or download and build from source


Install from the snap store

In any of the supported Linux distros:

sudo snap install parity --edge

(Note that this is an experimental and unstable release, at the moment)


Build from source

# download Parity code
$ git clone https://github.com/paritytech/parity
$ cd parity

# build in release mode
$ cargo build --release

This will produce an executable in the ./target/release subdirectory. Note: if cargo fails to parse manifest try:

$ ~/.cargo/bin/cargo build --release

Simple one-line installer for Mac and Ubuntu

bash <(curl https://get.parity.io -Lk)

Start Parity

Manually

To start Parity manually, just run

$ ./target/release/parity

and Parity will begin syncing the Ethereum blockchain.

Using systemd service file

To start Parity as a regular user using systemd init:

  1. Copy parity/scripts/parity.service to your systemd user directory (usually ~/.config/systemd/user).

  2. To pass any argument to Parity, write a ~/.parity/parity.conf file this way: ARGS="ARG1 ARG2 ARG3".

    Example: ARGS="ui --identity MyMachine".