Git Product home page Git Product logo

opentss's People

Contributors

latticexadmin avatar ujnss 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  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

opentss's Issues

Could you please provide a sample code?

I tried to write the sample code according to the readme.md, but it couldn't run, and I didn't find the cause of the error. Could you please provide a working sample code? Sample code and errors are shown below. Thank you very much.

pub mod communication;
pub mod protocols;
pub mod utilities;

use crate::communication::sending_messages::*;
use curv::elliptic::curves::{Point, Scalar, Secp256k1};
use protocols::multi_party::dmz21::common::*;
use protocols::multi_party::dmz21::keygen::*;
pub type CU = Secp256k1;
pub type FE = Scalar<Secp256k1>;
pub type GE = Point<Secp256k1>;

fn main() {
    // step 1:新建一个Phase对象。
    println!("第 1 步:新建一个Phase对象。");
    let partyid = "1".to_string();
    let params = Parameters {
        threshold: 1,
        share_count: 3,
    };
    let party_ids = vec!["1".to_string(), "2".to_string(), "3".to_string()];
    let mut keygen = KeyGenPhase::new(partyid, params, &Some(party_ids)).unwrap();
    // step 2:首先调用process_begin,返回下一轮要发送的消息。
    println!("第 2 步:首先调用process_begin,返回下一轮要发送的消息。");
    let sending_msg: SendingMessages = keygen.process_begin().unwrap();
    match sending_msg {
        SendingMessages::BroadcastMessage(msg) => {
            // broadcast the msg to all(including self).
            println!("1");
        }
        SendingMessages::P2pMessage(msg) => {
            // send according to the k,v in the msg. k is the index which v will to be sent to.
            println!("2");
        }
        SendingMessages::SubsetMessage(msg) => {
            // send according to the k in the party_ids or subset(used in sign phase). k is the index which msg will to be sent to.
            println!("3");
        }
        _ => {}
    }

    // step 3:通过 处理消息msg_handler。
    println!("第 3 步:通过 处理消息msg_handler。");
    loop {
        // let (recv_from, recv_msg) = According to the last round of SendingMessages
        let recv_from = "".to_string();
        let recv_msg = vec![0u8];
        let sending_msg = keygen.msg_handler(recv_from, &recv_msg).unwrap();
        match sending_msg {
            SendingMessages::KeyGenSuccessWithResult(msg) => {
                println!("{}", msg);
                // got the keygen result
                break;
            }
            _ => {
                // other sending messages, ref Step 2.
            }
        }
    }
}

Errors are shown below
image

How to recover one valid {t,n} threshold (PublicKey, PrivateKey) pair ?

Amazing library. We really love it. For work, we can't use the Signing function, instead we need to generate a valid {t,n} threshold ecdsa (PublicKey, PrivateKey) pair. We can even ask the t out of n clients to send their local private keys to the final computer that will generate the final valid pair. Also this process will be used only once as we no longer use the same party again.

Let's rewrite here our scenario

  1. n computers generate their local secrets.
  2. Using signing function on a dummy message, {t,n} can recover the PublicKey of the final pair from the signed dummy message.
  3. At a certain point in time, t of these n computers will share their keys to a special node.
  4. This special node should be able to recover (create) a valid {t,n} threshold ECDSA (Public,Private) key pair.
  5. We discard the party as we no longer need it.

Think it as a 3rd party authentication service that is able to recreate the final (PublicKey,PrivateKey) pair.
Or think it as an escrow multi sig. We know from the beginning the multi sig address, and after some time t out of n will allow one node to create the (PublicKey, PrivateKey) to claim control over the multi-sig address.

Any idea of how to do it ? We really appreciate if you can help us, otherwise we can not use this amazing library in our work.

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.