You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+18-23
Original file line number
Diff line number
Diff line change
@@ -1,32 +1,30 @@
1
-
# tkey iOS SDK
1
+
# tkey iOS SDK - TSS
2
2
3
-
The tKey SDK manages private keys by generating shares of it using Shamir Secret Sharing. Multi-party computation of shares is also planned for this SDK and is currently in an advanced stage of development but not quite ready to be merged into the main codebase yet.
3
+
Web3Auth uses tKey MPC to manage user wallets in a distributed fashion, leveraging various factors or shares managed by users, including their devices, private inputs, backup locations, and cloud service providers. As long as a user can access 2 out of n (2/n) of these shares, they can access their key.
4
4
5
-
The companion example application is [here](https://github.com/torusresearch/tkey-rust-ios-example/).
5
+
The companion example application is [here](https://github.com/torusresearch/tkey-rust-ios-example/tree/alpha).
6
6
7
7
If you are instead seeking the Android implementation, please see [here](https://github.com/torusresearch/tkey-rust-android).
8
8
9
-
##Including this package
9
+
### Add the [MPC tKey iOS SDK](https://github.com/tkey/tkey-ios/tree/alpha)
1.In Xcode, with your app project open, navigate to **File > Add Packages**.
12
12
13
-
2. Enter the url https://github.com/torusresearch/tkey-rust-ios
13
+
1. When prompted, add the tKey iOS SDK repository:
14
14
15
+
```sh
16
+
https://github.com/tkey/tkey-ios
17
+
```
15
18
16
-
## Integration with CustomAuth
19
+
From the `Dependency Rule` dropdown, select `Branch` and type `alpha` as the branch.
17
20
18
-
This standalone package can be used with CustomAuth. Please refer to the example application for a more comprehensive overview of the code.
21
+
1. When finished, Xcode will automatically begin resolving and downloading your dependencies in the background.
19
22
20
-
The integration process is simple:
21
-
1. Log in with CustomAuth, for detailed documentation on how to do this please refer to the documentation [here](https://github.com/torusresearch/customauth-swift-sdk).
23
+
## Documentation
22
24
23
-
2. Use the `userData["privateKey"]` field result as the postbox key when setting up the ServiceProvider.
25
+
Follow the full documentation [here](https://web3auth.io/docs/sdk/core-kit/mpc-tkey-ios).
24
26
25
-
3. Continue initialization as normal.
26
-
27
-
4. Remember to save the device share or the account will need to be reset. For existing accounts, shares will need to be imported, either by making use of a security share or via manual entry depending on how the ThresholdKey was initially setup.
28
-
29
-
## SDK Design Overview
27
+
## SDK Overview
30
28
31
29
The design of the SDK is relatively straight forward.
32
30
@@ -44,11 +42,9 @@ Currently only the Secp256k1 curve is supported.
44
42
45
43
Please note that all code examples are minimilistic in nature, this is intentionally done for clarity, since most functions can throw.
46
44
47
-
## SDK Overview
48
-
49
45
### ThresholdKey
50
46
51
-
The instance of tkey, this can be considered the most important object in the SDK.
47
+
The instance of tkey, this can be considered the most important object in the SDK.
52
48
53
49
##### Creation
54
50
@@ -79,7 +75,7 @@ Additionally the following optional parameters can be supplied to this call
79
75
| Parameter | Type | Description |
80
76
| --------- | ---- | ----------- |
81
77
| import_share | String | Initialise tkey with an existing share. This allows you to directly initialise tKey without using the service provider login. |
82
-
| input | ShareStore | Import an existing ShareStore into tkey. |
78
+
| input | ShareStore | Import an existing ShareStore into tkey. |
83
79
84
80
#### Reconstructing the Private Key
85
81
@@ -101,10 +97,9 @@ This returns a KeyDetails object.
101
97
102
98
Whenever a method is called which affects the state of the ThresholdKey, this method will need to be called again if updated details of the ThresholdKey is needed.
103
99
104
-
105
100
#### Generating a new Share
106
101
107
-
Shares are generated on the same threshold (e.g, 2/3 -> 2/4). A GenerateShareStoreResult object is returned by the function.
102
+
Shares are generated on the same threshold (e.g, 2/3 -> 2/4). A GenerateShareStoreResult object is returned by the function.
108
103
109
104
```swift
110
105
let newShare =try!await threshold_key.generate_new_share()
@@ -128,7 +123,7 @@ This module provides an interface for setting, getting and managing private keys
128
123
129
124
#### SecurityQuestionModule
130
125
131
-
This module allows the creation of a security share with a password. This is particularly useful to recover a ThresholdKey
126
+
This module allows the creation of a security share with a password. This is particularly useful to recover a ThresholdKey
0 commit comments