Proof-of-Concept of a FROST SDK using Uniffi
FROST is a thresold signature scheme created by Zcash Foundation. This Software Development Kit wraps the RustLang implementation of FROST using Mozilla UniFFI.
The creation of this SDK wouldn't have been possible without the reference of the Zcash FROST Demo
This specific wrapper has not been audited.
FROST itself as a signature scheme and the FROST SDK have been audited. The results of the audit can be found here.
DON'T JUMP INTO THE CODE YET! Please read these resources carefully. They are essencial for understanding how to use FROST.
If you are not familiar with FROST threshold signatures, start with the basics: The FROST Book. A quick, concise and comprehensive guide to FROSTying your signatures by @ZcashFoundation.
FROST is a creation of Chelsea Komlo (ZF) and Ian Goldberg (University of Waterloo). The first FROST paper can be found here
Zcash uses Re-Randomized FROST by Conrado Gouvea and Chelsea Komlo from @ZcashFoundation.
Pre-requisites
- Install Rust and Cargo
- Install Cargo Swift plugin
- Install MacOS and iOS targets
aarch64-apple-ios
,86_64-apple-darwin
,aarch64-apple-darwin
Non randomized Ed255519 FROST
run sh Scripts/build_go.sh
run sh Scripts/build_testbindings.sh
run sh Scripts/test_bindings.sh
RedPallas Randomized FROST
run sh Scripts/build_randomized_go.sh
run sh Scripts/build_testbindings.sh
run sh Scripts/test_randomized_bindings.sh
run sh Scripts/replace_remote_binary_with_local.sh
run sh Scripts/build_swift.sh
This SDK contains all the moving parts to do 2-round FROST threshold signatures
- Trusted Dealer Key Generation
- Trusted Dealer Key Generation with existing identifiers
- Distributed Key Generation
- Participant Commitment generation
- Key Package generation
- Public Key Package generation
- Signing Commitments and Nonces generation
- Coordinator Signing Package generation
- Participant
round2::sign()
signature - Coordinator Signature aggregation
- Signature Verification
- Swift
- GoLang
To be Supported:
- Kotlin
- Python
- Secure transport to exchange key material
- Server communication
- Distributed Key Generation
This repo is a pseudo-monorepo. The bindings need to be built all in sync. There is no sense in versioning bindings differently, since they are all based on the same originating code.
Not all programming languages use the same conventions, neither they have the same lifecycle. So the UniFFI approach needs to reconcile all of that.
From what we've researched, a possible and feasible approach is to make the UniFFI repo a monorepo from which its versions will generate all the bindings on every version and commit. Bindings will be generated for each commit regardless of the language that might originate it.
ROOT
|
-> uniffi-bindgen # crate that manages UniFFI bindings
|
-> Scripts # Scripts used on this repo either locally or by CI
|
-> frost-uniffi-sdk # Rust crate with the code that
| # generates the UniFFI bindings
|
-> FrostSwift # Umbrella SDK for Swift
| |
| -> Sources
| | |
| | -> FrostSwift # end-used Frost SDK
| | |
| | -> FrostSwiftFFI # module with the generated swift
| | # bindings from UniFFI
| |
| -> Tests # Tests for the Swift SDK
|
-> frost_go_ffi # Frost Bindings module Go lang files
-> go.mod # mod file describing the frost_go_ffi module
-> Examples # Example applications using the generated SDKs
Please open issues to request features. You can send PRs for the issues you open as well 🙏😅
This work was possible thanks to the effort of the Zcash Community and the funding of Zcash Community Grants commitee.