Git Product home page Git Product logo

muon-threshold-signature's Introduction

Muon Threshold Signature

This repository contains a TypeScript implementation of a Threshold Signature Scheme (TSS) using Schnorr-like signatures as described in Stinson & Strobl’s 2001 paper. TSS allows a group of n parties to collaborate on generating a signature, with any t or more of them being able to create a valid signature. This is useful in scenarios where access to a private key needs to be distributed among multiple parties.

This implementaion uses the Shamir Secret Sharing which is a widely used TSS algorithm based on polynomial interpolation. In this scheme, the private key is represented by a random polynomial of degree t-1, where t is the threshold. The key shares are the evaluations of the polynomial at different points. To generate a partial signature, each party computes the value of the polynomial at their point using a Lagrange interpolation formula. To combine the partial signatures, the parties use another Lagrange interpolation formula to recover the value of the polynomial at zero, which is the signature.

The implementation consists of three main sections:

  • MultiPartyComputation: a general and flexible class for MPC that encapsulates all common functionality related to MPC and avoids repeating it in the sub-classes.
  • IMpcNetwork: an interface that specifies the methods and properties that any networking module should have for MPC.
  • DistributedKeyGeneration: a class for DKG that inherits from the MultiPartyComputation class and implements the DKG protocol in three rounds.

Audit

There is an ongoing audit and code review in progress for our project. For the time being, our threshold signature implementation has undergone the first phase of internal audit by Habib Yajam, a trusted third-party auditor. The audit was conducted to ensure the security and correctness of our implementation with a focus on cryptographic components of the scheme and implementation (There will be more audits in the future with more focus on the code and implementation). The audit suggested:

  • Using proof of possession instead of hash commitments for guarding against rogue key attacks to improve performance and maintain same security characteristics. details | commit
  • Integrating elliptic curve point validation to the implementation to ensure that all points used in cryptographic operations belong to the intended curve. This improves security against active attackers. details | commit
  • Including the public key in the hashed challenge of Schnorr signatures to enhance the security of the protocol. Accordingly, some theoretical attacks are prevented resulting in stronger security guarantees. details | commit
  • Following the guidelines for selecting the threshold value based on the security requirements and efficiency constraints of the protocol. details

Test

Installation

$ npm install

Testing Distributed Key Generation

$ npm run test
> [email protected] test
> ./node_modules/.bin/ts-node src/mpc/dkg.test.ts

i: 0, match: OK, key party: 1,2,3,4 time: 426 ms
i: 1, match: OK, key party: 1,2,3,4 time: 275 ms
i: 2, match: OK, key party: 1,2,3,4 time: 186 ms
...
i: 208, match: OK, key party: 1,2,3,4 time: 153 ms
i: 209, match: OK, key party: 1,2,3,4 time: 151 ms
  total time: 34495 ms
average time: 164 ms

Testing Signing Process

$ npm start

> [email protected] start
> ./node_modules/.bin/ts-node src/muon_network_simulator.ts

TSS 3/9
Nodes indices:  [
  '1', '2', '3',
  '4', '5', '6',
  '7', '8', '9'
]
Message: 0x4d8cfae6c0eec2582cfa3acf65df9af577237356df7c588872c20b7e81a97107
Signing and verifying the message.
Selected nodes: [8,6,2], verified: true
Selected nodes: [1,6,2], verified: true
Selected nodes: [3,7,5], verified: true
Selected nodes: [2,5,9], verified: true
Selected nodes: [9,1,7], verified: true
Selected nodes: [8,7,1], verified: true
Selected nodes: [1,4,7], verified: true
Selected nodes: [2,3,1], verified: true
Selected nodes: [9,8,4], verified: true
Selected nodes: [9,1,8], verified: true

muon-threshold-signature's People

Contributors

sadeghte avatar hyajam avatar bakhshandeh avatar abramsymons avatar

Watchers

 avatar

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.