-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Wallet] Add support for 8 digits verification codes (#5925)
### Description This PR implements short verification codes. See the demo below. To enable this feature we need all the validators to support `https`, which is not the case atm, so this feature are disabled by feature flag. ### Short code Essentially, short code, which user receives consist of two parts: prefix and security code (e.g. `12345678`: `1` - prefix, `2345678` - security code). We use prefix to identify which issuer has sent the code. Because we can not store persistent mapping of prefix<>issuer on the client side (will be gone after reinstall), we are doing the following: * Set prefix to issuer's address mod 10 ([0,9]) and pass it with reveal request. * When we receive a short code with a prefix back, we create a list of validators which map to the same prefix. * We send security code to obtain attestation code to all issuers from the previous step * One of them should return a full attestation code, all others should fail. This approach allows us to scale for more than 10 actionable attestations at the same time and to avoid changing `Attestation.sol` contract to store mapping prefix<>issuer in it. #### Caveat We do occasionally redundant requests with security code to wrong validators and those exposing the code itself and increasing waiting time for the user. For 3 SMSs the probability of this happening is 30%. For more information see this discussion https://discord.com/channels/600834479145353243/732977310101405736/778336853505081344 ### Demo  ### Tested With short codes enabled/disabled. ### Related issues - Fixes #5384 - Fixes #5394 ### Backwards compatibility Yes
- Loading branch information
Showing
27 changed files
with
419 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
packages/docs/developer-resources/contractkit/reference/SUMMARY.md
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.