Web3Auth Shamir Secret Sharing Architecture
This document provides an in-depth exploration of the technical architecture of the Shamir's Secret Sharing(SSS)-based SDKs, this includes the current Plug and Play & Single Factor Auth SDKs.
Shamir's Secret Sharing is a base form of MPC that splits a secret into shares, of which threshold are required to reconstruct the secret. You maybe looking for the MPC Architecture documentation instead which does not require the key to be reconstructed on usage.
Components
The accompanying image illustrates the typical flow of wallet management within the SSS Infrastructure.

Auth Nodes (enabling social login)
Auth Nodes provide a user-specific key based on some form of attestation from the user. This attestation could come in the form of an OAuth login from an existing account, a traditional email account login, or even biometrics. Nodes need not return a private key, but need to fulfill the interface:
For ease of illustration the rest of this document assumes that this is implemented with secp256k1 keys and ECIES. The key retrieved from the nodes is referred to as an encryption key or .
Storage layer
The storage layer serves as a persistent data store for storing encrypted metadata. Examples of such systems include IPFS, Arweave, Sia, or even BFT layers. Data availability and cost are the main factors to consider but the choice of storage layer is ultimately up to the implementer.
Our SSS Infrastructure utilizes from the nodes as an entry point to retrieve the private key. is used to retrieve encrypted user-specific data from the storage layer, referred to as metadata. This data includes a user's threshold, polynomial commitments, associated devices, and so on.
User device
The SSS Infrastructure is dependent on user devices to store shares. The base flow accommodates a single device, but users can use multiple devices to increase the threshold once they have an initial setup. Access to device storage on the user's device is implementation specific. For example, for native applications on mobile, they can make use of the device keychain.
Recovery share
This is generally not used during normal operation, and is intended for use in key recovery / share refresh if the user loses his/her device or shares.
Flows
Key Initialization
A key is initialized upon a user-triggered action (eg. login to nodes). We then attempt to retrieve associated metadata for the user. If none exists, the user is a new one and we generate a corresponding SSS 2/3 polynomial with its respective key and shares. If it exists, we decrypt the metadata using the nodes and read the metadata to verify user information and associated secret sharing parameters.
We select a polynomial over where:
- denotes the private key scalar to be used by the user
- is a coefficient to
- and are ShareA, ShareB and ShareC respectively

ShareA is stored on the user's device, ShareB is encrypted with the and stored on the storage layer for future retrieval, and ShareC dependent on user input or handled as a recovery share.
Key Reconstruction

If a user has logged in previously, he/she reconstructs their key by decrypting ShareB (retrieved through the storage layer) and combining it with ShareA on the user's current device using Lagrange interpolation.
Key Generation with Deterministic Share
Provided with a user input, , we can pre-determine a single share in the generation of the SSS polynomial, where we peg ShareC or to a users input. Let be a cryptographically secure hash function.
In the case of secret resharing, we can also conduct the deterministic generation of the polynomial with a given and . We are able to peg given values to the key or shares as long as