-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multisig support #3304
Comments
I can't remember the crate name I'll have to look for it again |
A quick search only prompted me with the following repo ZenGo-X/multi-party-eddsa. |
Here are some insights on what I could find. What we currently useOur signature scheme is Ed25519, the EdDSA signature scheme using SHA-512 and Curve25519. Our KeyPair struct is a wrapper around the KeyPair struct of the ed25519-dalek crate (https://crates.io/crates/ed25519-dalek). This crate is basically an API that provides the hashing/signing methods. These methods then call the lower-level crate curve25519-dalek (https://crates.io/crates/curve25519-dalek), that does the arithmetic operations over the curve (handling Points and Scalars on this curve). Extract from the docs of this later crate:
State of the art on Rust multisig crates supporting ED25519:ZenGo-X / multi-party-eddsaThe following repo proposes a multisig library over ED25519: https://github.com/ZenGo-X/multi-party-eddsa/. Limitations:
diem_crypto::multi_ed25519https://diem.github.io/diem/diem_crypto/multi_ed25519/index.html Unless I'm mistaken, they follow the 'naive' approach to multi-sigs, where a MultiSig is basically just a Vec of Signatures, which is not suitable for us: pub struct MultiEd25519Signature {
signatures: Vec<Ed25519Signature>,
bitmap: [u8; BITMAP_NUM_OF_BYTES],
} ConclusionsI believe some additional research (and knowledge on the underlying cryptography) would be needed to properly design a solution, as existing crates do not seem to be enough for our needs. |
I think what @Eitu33 found was a crate used/developed by Polkadot. The issue was that there was a lot of dependencies. Maybe it's worth having a closer look. |
Thanks, in that case it may be https://github.com/w3f/schnorrkel (great crate name but a quick search does not find it haha). I'll take a look when I have some time. |
So looking into this crate, the API is basically the same of what we are currently using. The main differences are:
I managed to build the project using schnorkkel, but I have yet to:
|
It would be interesting to know more how all these things work so that we are less naive about crypto. Maybe it's worth digging a bit and making a recap of what you learned along the way to the team ? Some interesting resource (and resources therein): https://substrate.stackexchange.com/questions/4011/how-is-a-substrate-address-or-multisig-address-calcluated-from-private-key |
Sounds great! Thanks for the link. |
Here is a small follow-up regarding BLS Signatures. BLS SignaturesIntroductionSome helpful info can be found here: https://hackmd.io/@benjaminion/bls12-381 Boneh-Lynn-Shacham (BLS) signatures rely on elliptic curve cryptography, so as to EdDSA / ECDSA signature schemes. The curves used are mainly Barreto-Lynn-Scott : BLS curve BLS12-381. Same equation ( Algos: TL;DR: We use one curve for public keys, one curve for signatures. We choose which one handles what task: "The trade-offs are execution speed and storage size. Features2 types of aggregations possible:
Rogue key attacks on aggregate schemes
[CASE 2] Problem: it increases the needed storage, as we need to publish proofs for each signer (e.g. the signature of the pubkey) [CASE 3] Not much crates here? Or other tradeoffs. Rust cratesThe following website https://cryptography.rs compiles different Rust crates related to cryptography, quite useful to get a quick overview of the state of the art.
[CASE 1] filecoin-project/bls-signatures#42
[NO PROTECTION] https://docs.rs/bls-signatures-rs/latest/bls_signatures_rs/bn256/index.html
[CASE ?] https://github.com/supranational/blst/#general-notes-on-implementation
ConclusionsBLS signatures should probably not be considered right now to replace our current signature scheme. However, it could be nice to:
ReferencesBase article for 3: (approach similar to MuSig, but no need for multi round?) |
Given the study, we conclude that it will be complicated to support multisig natively. We will leave it to the SC world |
Study how to integrate multisig support.
I think you saw some codebased that support multisig with our signature scheme @Eitu33. Would you mind sharing them here ?
The text was updated successfully, but these errors were encountered: