Tendermint KMS 🔐

Build Status Apache 2.0 Licensed

Key Management System for Cosmos Validators.

https://cosmos.network/

About

This repository contains tmkms, a lightweight service intended to be deployed alongside the gaiad service (ideally on separate physical hosts) which provides the following:

Status

Tendermint KMS is currently alpha quality. It supports YubiHSM2-backed signing when used in conjunction with cosmos-sdk 0.26.

It does NOT yet implement double signing prevention or high availability features. These are planned features which will be implemented soon.

Supported Platforms

tmkms should build on any [supported Rust platform] which is also supported by [libusb]. Below are some of the available tier 1, 2, and 3 Rust platforms which are also supported by libusb.

NOTE: tmkms is presently tested on Linux/x86_64. We don't otherwise guarantee support for any of the platforms below, but they theoretically meet the necessary prerequisites for support.

Operating Systems

CPU Architectures

Installation

You will need the following prerequisites:

To install tmkms, do the following:

  1. (x86_64 only) Configure RUSTFLAGS environment variable: export RUSTFLAGS=-Ctarget-feature=+aes
  2. Run the following to install Tendermint KMS using Rust's cargo tool:

$ cargo install tmkms

  1. Copy the example tmkms.toml file to a local directory (e.g. ~/.tmkms):

https://github.com/tendermint/kms/blob/master/tmkms.toml.example

Edit it to match your desired configuration.

Usage

Start tmkms with the following:

$ tmkms start

This will read the configuration from the tmkms.toml file in the current working directory.

To explicitly specify the path to the configuration, use the -c flag:

$ tmkms start -c /path/to/tmkms.toml

YubiHSM2 Setup

YubiHSM2 devices from Yubico are the main HSM solution supported by Tendermint KMS at this time (Ledger support forthcoming!)

The tmkms yubihsm subcommand provides YubiHSM2 setup, information, and testing features:

Development

The following are instructions for setting up a development environment. They assume you've already followed steps 1 & 2 from the Installation section above (i.e. installed rustup and the noted nightly Rust released).

Alternatively, you can build a Docker image from the [Dockerfile] in the top level of the repository, which is what is used to run tests in CI.

Before opening a pull request, please run the checks below:

Testing

Run the test suite with:

cargo test --all-features

Format checking (rustfmt)

Make sure your code is well-formatted by running:

cargo fmt

Lint (clippy)

Lint your code (i.e. check it for common issues) with:

cargo clippy

License

Copyright © 2018 Tendermint

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.