{"id":13648578,"url":"https://github.com/LatticeX-Foundation/opentss","last_synced_at":"2025-04-22T11:32:50.292Z","repository":{"id":56335644,"uuid":"520774886","full_name":"LatticeX-Foundation/opentss","owner":"LatticeX-Foundation","description":"An ECDSA threshold signature algorithm implemented in Rust.","archived":false,"fork":false,"pushed_at":"2024-09-26T06:32:33.000Z","size":225,"stargazers_count":137,"open_issues_count":3,"forks_count":31,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-09T23:36:18.616Z","etag":null,"topics":["cryptography","ecdsa","rust","tss"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LatticeX-Foundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-03T07:10:06.000Z","updated_at":"2024-11-07T03:42:57.000Z","dependencies_parsed_at":"2023-01-18T19:44:33.283Z","dependency_job_id":null,"html_url":"https://github.com/LatticeX-Foundation/opentss","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LatticeX-Foundation%2Fopentss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LatticeX-Foundation%2Fopentss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LatticeX-Foundation%2Fopentss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LatticeX-Foundation%2Fopentss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LatticeX-Foundation","download_url":"https://codeload.github.com/LatticeX-Foundation/opentss/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250232402,"owners_count":21396638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","ecdsa","rust","tss"],"created_at":"2024-08-02T01:04:21.850Z","updated_at":"2025-04-22T11:32:49.834Z","avatar_url":"https://github.com/LatticeX-Foundation.png","language":"Rust","funding_links":[],"categories":["Rust","TSS list"],"sub_categories":[],"readme":"![Open TSS LOGO](./docs/assets/LOGO.png)\n\n\n[![Build](https://github.com/LatticeX-Foundation/opentss/actions/workflows/build.yaml/badge.svg)](https://github.com/LatticeX-Foundation/opentss/actions/workflows/build.yaml)[![License: GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\n# Open TSS\n\nThis project is a Rust implementation of multi-party {t,n}-threshold signature scheme(TSS).\n\nThe current version of this library supports [ECDSA](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm), other algorithms such as EdDSA, BLS, etc. will be integrated soon. Please look forward to it!\n\n\n## Multi-Party ECDSA\n\nECDSA is widely used in crypto-currencies, such as BTC, Ethereum (secp256k1 curve), etc.\n\nThe multi-party ECDSA protocol in this library is implemented based on class group. It currently includes two protocols:\n\n- Key Generation for creating secret shares.\n- Signing for using the secret shares to generate a signature. This can be divided into two phases, Offline and Online:\n    - The Offline phase is independent of the message to be signed and can be calculated in advance.\n    - Simply passing the message (and the output of Offline) to the Online phase, and you can get the signature very quickly.\n\n\nThe ECDSA in this library includes schemes described in [[DMZ+21](https://eprint.iacr.org/2022/297)](published in Asiacrypt 2021). \n\n| Protocol | Introduction                                                                                                                                                                                                                                                         |\n| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [DMZ+21] | - This paper proposes efficient multi-party threshold ECDSA protocols from CL encryptions based on class groups. \u003cbr/\u003e - This protocol avoids the low order assumption, which is a strong and non-standard assumption, and reduces the communication cost in keygen. |\n\n\n## Usage\n\n\n\nLet's take **KeyGen** for example, only need three steps. Assuming $(t,n) = (1,3)$, party ids are 1, 2, 3.\n\n\n**Step 1**: New a `Phase` object.\n\n```rust\nlet partyid = \"1\".to_string();\nlet params = Parameters {\n    threshold: 1,\n    share_count: 3,\n};\nlet party_ids = vec![\"1\".to_string(), \"2\".to_string(), \"3\".to_string()];\nlet mut keygen = KeyGenPhase::new(partyid, params, \u0026Some(party_ids)).unwrap();\n```\n\n\n\n**Step 2**: Start by calling `process_begin`, which returns the message to be sent in the next round.\n\n```rust\nlet sending_msg: SendingMessages = keygen.process_begin().unwrap();\n```\n\nAccording to the SendingMessages type(Broadcast, P2P, etc.) and content, we can package the index(from, self partyid) with the message(msg) to the other participant(s).\n\n```rust\nmatch sending_msg {\n    SendingMessages::BroadcastMessage(msg) =\u003e {\n        // broadcast the msg to all(including self).\n    }\n    SendingMessages::P2pMessage(msg) =\u003e {\n        // send according to the k,v in the msg. k is the index which v will to be sent to.\n    }\n    SendingMessages::SubsetMessage(msg) =\u003e {\n        // 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.\n    }\n    _ =\u003e {}\n}\n```\n\n**Step 3**: Handling messages by `msg_handler`. \n\nWhen a message has been received, got the recv_from and recv_msg, and then pass them into msg_handler, which returns a result or the message to be sent in the next round.\n\n\n```rust\nloop {\n    // let (recv_from, recv_msg) = According to the last round of SendingMessages\n    let recv_from = \"\".to_string();\n    let recv_msg = vec![0u8];\n    let sending_msg = keygen.msg_handler(recv_from, \u0026recv_msg).unwrap();\n    match sending_msg {\n        SendingMessages::KeyGenSuccessWithResult(msg) =\u003e {\n            // got the keygen result\n            break;\n        }\n        _ =\u003e {\n            // other sending messages, ref Step 2.\n        }\n    }\n}\n```\n\nOnce `SendingMessages::KeyGenSuccessWithResult` is received, it indicates completion.\n\n\n- A [local test](./multi_party_ecdsa/src/protocols/multi_party/dmz21/local.rs) shows how to use these functions.\n\n- The usage of **SignOffline**, **SignOnline** are similar to **KeyGen**. Please ref [here](docs/ECDSA.md) for more details.\n\n\n## References\n\n- [DMZ+21] \u003chttps://eprint.iacr.org/2022/297\u003e\n\n\n## Contact\n\nYou could reach us by [email](mailto:support@latticex.foundation). \n\n## License\n\nThe OpenTSS library is licensed under the [GNU General Public License v3.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLatticeX-Foundation%2Fopentss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLatticeX-Foundation%2Fopentss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLatticeX-Foundation%2Fopentss/lists"}