-
Notifications
You must be signed in to change notification settings - Fork 176
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
Implement 2FA without contracts #1372
Comments
I feel like more straightforward solution would be to rewrite multisig contract with no_std which is likely to reduce amount locked to something like 3-5 NEAR (judging by the fact that it's theoretically possible based on AssemblyScript contracts / some no_std POCs). Motivation:
|
I think that we should use both approaches in the long term. Contract-based solution is more flexible but cryptography-based solution is more efficient. |
@abacabadabacaba how does that work, would this still match 1 public key? |
It is possible to implement m-of-n generation of Ed25519 signatures such that the verification algorithm is unchanged (that is, anything that can verify a regular Ed25519 signature can also verify a signature generated in this fashion). In particular, there is a single Ed25519 public key that is used for verification. For this to work, the key holders need to run two interactive algorithms: one that is used to generate the common public key and the individual private keys, and another one that is used to generate the signatures. Participation of all n key holders is required for the former algorithm, but for the latter any subset of at least m key holders is enough. If m = n, the process of key generation can be simplified: each key holder can generate a separate key which can then be added together to produce a common key (the implementation above for the case m = n = 2 uses this approach). |
The way 2FA is currently implemented, the user is required to deploy a contract to their account, which requires them to have at least 35Ⓝ in their account which is unusable for as long as 2FA is active. However, it is possible to implement 2FA differently, by using clever cryptography to make the wallet and the contract helper together generate a single signature, so that regular full access keys can be used and no contract is needed. Here is a preliminary implementation of the necessary cryptographic algorithms, it needs to be integrated into the wallet and the contract helper. Also, an upgrade path should be provided for the users to switch from the legacy contract-based 2FA to the new system.
The text was updated successfully, but these errors were encountered: