Skip to content

Commit caebd58

Browse files
committed
docs: add updated wallet security documentation
1 parent bfa5cc7 commit caebd58

File tree

7 files changed

+431
-1
lines changed

7 files changed

+431
-1
lines changed

apps/portal/src/app/connect/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const sidebar: SideBar = {
102102
},
103103
{
104104
name: "Security",
105-
href: `${ecosystemSlug}/security`,
105+
href: `${walletSlug}/security`,
106106
},
107107
{
108108
name: "Get Started",

apps/portal/src/app/connect/wallet/security/assets/app-scoped.svg

Lines changed: 92 additions & 0 deletions
Loading

apps/portal/src/app/connect/wallet/security/assets/ecosystem-scoped.svg

Lines changed: 109 additions & 0 deletions
Loading

apps/portal/src/app/connect/wallet/security/assets/embed-creation.svg

Lines changed: 48 additions & 0 deletions
Loading
193 KB
Loading
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import AppScoped from "../assets/app-scoped.svg";
2+
import EmbedCreation from "../assets/embed-creation.svg";
3+
import { DocImage, Callout, createMetadata } from "@doc";
4+
5+
export const metadata = createMetadata({
6+
image: {
7+
title: "In-App Wallet Security",
8+
icon: "wallets",
9+
},
10+
title: "In-App Wallet Security",
11+
description:
12+
"Learn how thirdweb protects your user's private keys using Shamir's Secret Sharing algorithm",
13+
});
14+
15+
# How it works
16+
17+
## Wallet creation
18+
19+
When a user signs into an application using their email or social logins for the first time, a wallet is generated on the user's device. The corresponding wallet key for this wallet is securely split into three shards using [Shamir's Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) algorithm.
20+
21+
1. **Shard A** is stored securely on the user's device. For web applications, this is stored on the browser, or for mobile apps, it is in a secure enclave.
22+
2. **Shard B** is encrypted and stored in [Amazon KMS](https://aws.amazon.com/kms/) using a key known to thirdweb. This process uses [hardware security modules](https://en.wikipedia.org/wiki/Hardware_security_module) (HSMs) to protect the confidentiality and integrity of keys. The encrypted string is stored in thirdweb's database.
23+
3. **Shard C** is encrypted by user authentication and stored in Amazon's KMS using hardware security modules (HSMs) to protect the confidentiality and integrity of keys. Despite the key stored on thirdweb's servers, thirdweb has no way of decrypting and accessing the key.
24+
25+
<DocImage src={EmbedCreation} />
26+
27+
## Recoverability
28+
29+
In-App Wallets are non-custodial, and users can export their private key anytime. Users may recover their wallet from any device by authenticating or signing into an application to receive access to their wallet.
30+
Threshold secret-sharing cryptography is used to recreate the private key; two of three shards are required.
31+
If a user loses access to their authentication method (email, social login, or custom authentication), they cannot recover their wallet.
32+
33+
<Callout variant='info'>
34+
35+
thirdweb does not have the ability to access user accounts or reconstruct private keys.
36+
37+
</Callout>
38+
39+
## In-App Wallet Scope
40+
41+
In-App Wallets are scoped to applications per API key. If users use the same email to sign in to a different application using In-App Wallets, the application will manage an entirely different wallet.
42+
43+
### Benefits of single application scoped wallets
44+
45+
- Each application has limited access only to wallets created through their application. It cannot manage wallets from other applications.
46+
- Users may only view tokens sent or purchased from your application.
47+
- To improve user experience, saved payment methods and KYC verification are only provided to thirdweb; applications cannot view this information.
48+
49+
Users may view all their application-scoped In-App Wallets in a single view using the [My Wallets](https://ews.thirdweb.com/wallet) dashboard. Learn more about My Wallets.
50+
51+
<DocImage src={AppScoped} />
52+
53+
### Scalability
54+
55+
We support up to 100 wallets generated/second by default and can support higher limits (up to 3,000 wallets generated/second) upon request. [Contact Sales](https://thirdweb.com/contact-us) for more information.
56+
57+
### Security & privacy
58+
59+
#### TLS Encryption
60+
61+
To increase security and privacy, private keys or wallet "seed phrases" are never stored or sent over a network. TLS encryption is used in transit for internal and external communications with thirdweb's back-end and databases. TLS encryption is also required for third-party vendors.
62+
63+
#### AES-256
64+
65+
Data backups and storage are encrypted with AES-256.
66+
67+
#### Threshold secret sharing
68+
69+
Using threshold secret sharing, thirdweb cannot reconstruct a user's private key, thereby providing a non-custodial wallet. Additionally, a customer's assets are safe even if thirdweb or the application developer (you) is compromised. In a compromised situation, an attacker may only be able to access one of three shards, which is inadequate to reconstruct the wallet's private key.
70+
71+
#### GDPR & CCPA
72+
73+
thirdweb complies to GDPR and CCPA compliance frameworks and deletes customer data per request within the required timeframe of each standard (30 days for GDPR and 45 for CCPA).
74+
75+
#### Audit and Bounty Program
76+
77+
HackerOne has audited our in-app wallet private key security architecture, and there is an ongoing bounty program to ensure vulnerabilities are caught. [View the Letter of Attestation.](/pdfs/thirdweb_code_security_audit.pdf)
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import { DocImage, Callout, createMetadata } from "@doc";
2+
import EnclaveWalletCreation from "./assets/enclave-wallet-creation.png";
3+
import AppScoped from "./assets/app-scoped.svg";
4+
import EcosystemScoped from "./assets/ecosystem-scoped.svg";
5+
6+
export const metadata = createMetadata({
7+
image: {
8+
title: "In App wallet and Ecosystem Security",
9+
icon: "wallets",
10+
},
11+
title: "thirdweb Wallet Security",
12+
description:
13+
"Learn how thirdweb protects your user's private keys across applications using nitro Enclaves",
14+
});
15+
16+
# thirdweb Wallet Security
17+
18+
If you are looking for the previous security documentation around the shamir secret sharing model, please refer to the [In-App Wallet Security](/connect/wallet/security/legacy) page.
19+
20+
## Wallet Creation
21+
22+
When a user signs into an application using their email or social logins for the first time, a wallet is generated within a secure enclave on the server after verifying the user's legitimacy. The enclave provides a trusted execution environment, ensuring the wallet creation process is isolated and protected from external interference.
23+
24+
- The wallet and its corresponding private key are generated entirely within the enclave, never leaving its secure confines.
25+
- User authentication data is verified within the enclave, ensuring that only legitimate, authenticated users can initiate wallet creation.
26+
27+
<DocImage src={EnclaveWalletCreation} className="max-w-96" />
28+
29+
30+
## Security Measures
31+
32+
- The enclave's cryptographic properties ensure that even the server operators cannot access the contents or operations within the enclave.
33+
- The enclave provides a verifiable hash of the image of the code that is being run on the device, allowing anyone to verify the contents of the code.
34+
- The wallet's private key never exists in an unencrypted form outside of the enclave.
35+
- All sensitive operations, such as transaction signing, occur within the enclave, ensuring the wallet's security.
36+
37+
## Wallet Usage
38+
39+
### General Usage
40+
41+
- When users interact with their wallet via the the enclave, all communications are encrypted and only the legitimate user can access their wallet.
42+
- All traffic is encrypted with TLS and HSTS. Services are run in private VPCs on AWS and accessible only from a single entry point via our Cloudflare DNS.
43+
- Applications can [link multiple authentication methods](/connect/in-app-wallet/guides/link-multiple-profiles) to the same wallet. Any of these methods can be used to authenticate into the users wallet.
44+
45+
### Ecosystem Usage
46+
47+
Ecosystem wallets are controlled by the ecosystem owner. Ecosystem owners are able to specify usage policies for their partners and developers which restricts what they can do with the wallet. Unlike the shamir secret sharing model, the enclave wallet model ensures that the private key is never reconstructed on the client. This ensures no-one can extract the private key from the client, including other developers in the ecosystem. Moreover, it also means that partners and developers must submit the request to the enclave which would be able to verify the request and block requests that are out of scope or denied by the ecosystem owner.
48+
49+
## Scopes
50+
51+
52+
### In App Wallets
53+
54+
In-App Wallets are scoped to applications per Client ID. If users use the same email to sign in to a different application using In-App Wallets, the application will manage an entirely different wallet.
55+
56+
#### Benefits of single application scoped wallets
57+
58+
- Each application has limited access only to wallets created through their application. It cannot manage wallets from other applications.
59+
- Users may only view tokens sent or purchased from your application.
60+
- To improve user experience, saved payment methods and KYC verification are only provided to thirdweb; applications cannot view this information.
61+
62+
<DocImage src={AppScoped} />
63+
64+
### Ecosystem Wallets
65+
66+
Ecosystem Wallets are scoped to the ecosystem. If users use the same email to sign in to a different application using the same ecosystem, they will get the same wallet.
67+
68+
#### Benefits of ecosystem scoped wallets
69+
70+
- Applications can now share assets across various applications. This is useful if you're a brand powering multiple application and want your partners to take advantage of network effects.
71+
- Application owner has full control over what happens within each application. This is useful if you're a brand that wants to ensure that all applications in your ecosystem are following the same rules.
72+
73+
<DocImage src={EcosystemScoped} />
74+
75+
76+
## Recoverability
77+
78+
- Users can export their private key at any time.
79+
- Users may recover their wallet from any device by authenticating or signing into an application to receive access to their wallet.
80+
- Thirdweb wallets support four categories of authentication: socials, custom authentication, external wallets, and email / phone authentication. If a user ever loses access to their authentication method:
81+
82+
1. **For socials and email / phone authentication,** users can utilize the recovery flow of their providers to regain access to their account.
83+
2. **In the case of custom authentication,** the developer managing their authentication flow will be able to re-instate the users account upon successful verification.
84+
3. Application providers **do not have direct access** to user accounts or private keys, as these remain secured within the enclave. The enclave's design ensures that only verified user requests can trigger wallet operations.
85+
86+
- Users are able to link their authentication methods which will provide them multiple ways to access their account if they ever lose access to any one of their authentication method.
87+
88+
## Security & privacy
89+
90+
### TLS Encryption
91+
92+
To increase security and privacy, private keys or wallet "seed phrases" are never stored or sent over a network. TLS encryption is used in transit for internal and external communications with thirdweb's back-end and databases. TLS encryption is also required for third-party vendors.
93+
94+
### AES-256
95+
96+
Data backups and storage are encrypted with AES-256.
97+
98+
### GDPR & CCPA
99+
100+
thirdweb complies to GDPR and CCPA compliance frameworks and deletes customer data per request within the required timeframe of each standard (30 days for GDPR and 45 for CCPA).
101+
102+
### Audit and Bounty Program
103+
104+
Halborn has audited our enclave wallet security architecture which we'll be releasing shortly, and there is an ongoing bounty program to ensure vulnerabilities are caught. [View the Letter of Attestation.](/pdfs/thirdweb_code_security_audit.pdf)

0 commit comments

Comments
 (0)