Git Product home page Git Product logo

kms-secp256k1's Introduction

Key Management System (KMS) for curve Secp256k1

Multi Party Key Management System (KMS) for Secp256k1 Elliptic curve based digital signatures.

Introduction

Digital Signature Algorithm (DSA) is the basic cryptographic primitive for blockchain interaction: private keys represent identities, transfer of ownership is done by means of signatures and the blockchain is maintained by miners verifying signatures using public keys. Moving the classical DSA constructions to threshold signature schemes can provide enhanced security by distributed key generation and distributed signing. The miners verification process stays the same such that the change is transparent to the blockchain operators and can be done at the wallet (KMS) level. Recent years have brought major breakthroughs for threshold and multi-signatures schemes providing practical multi-party schemes for common DSAs used in blockchain today, i.e. [1โ€“4] for ECDSA, Schnorr and BLS.

We define two roles: Owner and Provider. The Owner is the end-user who owns the funds in the account and holds one secret share of the private key. The Provider is another share holder of the private key but has no funds tied to this private key. His role is to provide the additional security in the system aiding and enabling the owner to generate keys and transact in distributed fash- ion. From network perspective one Provider is connected to many Owners which together maintain the Provider, for example paying his cost in transaction fees. The Provider can run on any machine: from a Trusted Execution Environment (TEE) to machine operated by incentivized human operator. Multiple Providers can compete for Owners. To give concrete example for use case: a company employees are all Owners and a Server owned by the company is the Provider.

Currently supported features

Currently not supported

  • The library does not provide serialize and desrialize functionalities and not handling any form of network communication
  • The cryptography is not constant time or immune to side channel attacks
  • The library has no unified methodology to handle errors. Usually errors are propagated from lower level code.

To play with the code

It is best to start with the tests code:

  1. poc.rs for VE recovery and master keys generation
  2. ecdsa/two_party/test and schnorr/two_party/test for keygen, signing, rotation, hd tests. Notice that HD and rotation are commutative such that the order of the operations does not matter.

License

KMS is released under the terms of the GPL-3.0 license. See LICENSE for more information.

Development Process

The contribution workflow is described in CONTRIBUTING.md, in addition the Rust utilities wiki contains information on workflow and environment set-up.

Contact

For any questions, feel free to email us.

References

[1] R. Gennaro, S. Goldfeder. Fast Multiparty Threshold ECDSA with Fast Trustless Setup ACM Conference on Computer and Communications Security (CCS), 2018.

[2] Y. Lindell and A. Nof. Fast Secure Multiparty ECDSA with Practical Distributed Key Generation and Applications to Cryptocurrency Custody. ACM Conference on Computer and Communications Security (CCS), 2018.

[3] D. Boneh, M. Drijvers, G. Neven. Compact Multi-Signatures for Smaller Blockchains. Cryptology ePrint Archive, Report 2018/483. Last access Aug. 2018.

[4] G. Maxwell, A. Poelstra, Y. Seurin, P. Wuille. Simple Schnorr Multi-Signatures with Applications to Bitcoin. Cryptology ePrint Archive, Report 2018/068, Last accessed Aug. 2018.

kms-secp256k1's People

Contributors

elichai avatar gbenattar avatar oleiba avatar omershlo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kms-secp256k1's Issues

HD Wallet - slight differences between ECDSA and Schnorr

Hi,

I noticed the formula used to generate public key in HD Wallet for ECDSA and Schnorr is slightly different.

In ECDSA, it is link to code
let pub_key = pubkey * &f_l_fe;

In Schnorr, it is link to code
let pub_key = pubkey.clone() + &g * &f_l_fe;

Is there some security issue hence the need to multiply the Schnorr public key with generator?

Thanks!

add paillier key rotation to ecdsa

  • party 1 generates a new Paillier key pair e2,d2
  • party 1 and party 2 run coin toss protocol and update private shares (already implemented)
  • party2 knows already c1 - encryption of x1 under the old Paillier public key e1, because of the homomorphism of Paillier encryption, party2 can compute by herself c2- the ciphertext of the updated party1 share.
  • party1 sends proof of equal encryption to party 2 : mortendahl/rust-paillier#62
  • party2 verifies

Allow the user to define the library search path for gmp.lib

This is related to #25

We want to make it easier to the https://github.com/nash-io/openlimits users to use the library without worrying about compiling gmp copying and copying it to the expected path.

I just created a hacky build.rs to automatically copy the gmp.lib and gmp.dll files to the toolchain lib folder, but if the user doesn't want to use openlimits anymore and if the user forget about it, the user will leave both files in the folder.

I just found a reasonable solution for it in this stackoverflow answer https://stackoverflow.com/a/32868075 and I would love to see it implemented here.

generate MasterKeys in poc.rs example code

currently we just show keygen with schnorr and ecdsa. the complete the poc we must run also chain code generation once and generate Master Keys for schnorr and ecdsa using calls to set_master_key

implement serialize and deserialise

The purpose of the code in KMS is to take a cryptographic protocol and to construct the actual messages that are supposed to be send among the participants.

  • In order.
  • without breaking the cryptography.
  • Minimizing the round trips as much as possible
  1. what is the best way to serialize / desialize in this case?
  2. take the output messages from each protocol (keygen, sign, rotate, chain code etc) and serialize them
  3. take the input messages from each protocol and deserialize them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.