KryptoGO Mobile Wallet SDK allows native apps to integrate KryptoGO wallet functionality.
- KryptoGO Mobile Wallet SDK
- Quick Integration and Easy Configuration
- Security and Compliance
- Technical Support and Community
- On-chain Asset Data
- On-chain Transaction Records
- Asset Transfer
- Token Swap
- Password Backup
- SSS Fragmentation Protection Mechanism
- Multi-Chain Support
- iOS
- Android
- iOS 14.0+
- Android 5.0+
-
Clone the SDK repository:
git clone https://github.com/kryptogo/kg-mobile-wallet-sdk.git
-
Place the KG_SDK directory into the root directory of your application.
-
Follow the specific configuration documents for iOS and Android to complete the setup.
Parameter | Type | Description |
---|---|---|
clientId | String | Your application's client ID provided by KryptoGO |
clientToken | String | Your application's client token for authentication |
Method Name | Description | Parameters | Return Value |
---|---|---|---|
updateSharedSecret | Updates the shared secret used in Shamir's Secret Sharing (SSS) scheme. You need ensure that the sharedSecret is saved in your own database. This is crucial for updating the user's private key fragment stored on the device. Return true if the save is successful, otherwise return false . |
String sharedSecret | bool |
clearSharedSecret | Clears the stored shared secret (private key fragment) from the device. This might be used during logout or account reset procedures. Return true if the operation is successful, otherwise return false . |
None | bool |
closeSdkView | Closes the current SDK view. | None | void |
openVerifyPage | Opens a verification page, typically used when the SDK needs to verify the user's identity before performing sensitive operations related to SSS. Return true if verification is successful, otherwise return false. | None | bool |
requestSharedSecret | SDK requests a shared secret (private key fragment) from the app. This is a critical part of the SSS scheme, allowing the SDK to reconstruct the full private key when needed. | None | String |
Method Name | Description | Parameters | Return Value |
---|---|---|---|
goRoute | Navigates to a specific route within the SDK's interface. Available routes include: "/receive_address", "/send_token/select_token", "/swap". | String route | None |
initParams | Initializes the client token and client id, which is used for authentication purposes. clientId and clientToken are required. |
Map<String, String> params | None |
checkDevice | Performs a compatibility check on the device to ensure it meets the SDK's requirements, including the ability to securely store SSS fragments. | None | bool |
isReady | Verifies if the SDK is fully initialized and ready for use, including the setup of SSS components. | None | bool |
getAccessToken | Retrieves the current access token, which is typically used for authenticated API requests. | None | String |
hasLocalShareKey | Checks if a local share key (part of the SSS scheme) is stored on the SDK (device). This is crucial for determining if the device has a part of the user's private key. | None | bool |
isWalletCreated | Verifies if a wallet has been created for the current user | None | bool |
getBalance | Retrieves the current balance of the user's wallet. | None | String |
refreshSharedSecret | Refreshes the shared secret (private key fragment) stored on the device. This might be done periodically for security reasons or when the user wants to update their key shares. | String secret | None |
The KryptoGO Mobile Wallet SDK interacts with your app through several key flows:
The app calls initParams
with the clientId
and clientToken
. It then checks if the SDK is ready using isReady()
.
sequenceDiagram
participant App
participant SDK
App->>SDK: initParams(clientId, clientToken)
App->>SDK: isReady()
SDK-->>App: true/false
During wallet creation, the SDK calls updateSharedSecret
to backup the private key fragment to the app's server.
sequenceDiagram
participant App
participant SDK
SDK->>App: updateSharedSecret(secret)
App-->>SDK: true/false
If the local fragment is missing, the SDK calls requestSharedSecret
to get the fragment from the app. After reconstructing the private key, it calls updateSharedSecret
again to re-backup the fragment.
sequenceDiagram
participant App
participant SDK
SDK->>App: requestSharedSecret()
App-->>SDK: sharedSecret
SDK->>App: updateSharedSecret(newSecret)
App-->>SDK: true/false
If backup fails, all fragments must be destroyed and re-backed up. The SDK calls clearSharedSecret
to delete old backups in all environments.
sequenceDiagram
participant App
participant SDK
SDK->>App: clearSharedSecret()
App-->>SDK: true/false
Before signing transactions, the SDK calls openVerifyPage
. If the user successfully verifies in the app, it returns true
to the SDK.
sequenceDiagram
participant App
participant SDK
SDK->>App: openVerifyPage()
App-->>SDK: true/false
KryptoGO Mobile Wallet SDK employs advanced protection mechanisms:
- Password Backup
- SSS Fragmentation Protection Mechanism
KryptoGO Mobile Wallet SDK supports several blockchain networks:
- Bitcoin
- Ethereum
- Polygon
- Arbitrum
- Solana
- TRON
- KuCoin Community Chain
- Ronin
- Oasys
The Android sample project is located in the examples/android
directory. It's a standard Android project built with Gradle. The main application code can be found in app/src/main
.
The iOS sample project is located in the examples/ios
directory. It's a standard iOS project managed with Xcode and CocoaPods. Key files include ContentView.swift
(main SwiftUI view), KgSDKService.swift
(KryptoGO SDK service wrapper), and VerifyPageView.swift
and VerifyPageViewController.swift
(verification page code).
SDK files are located in the sdk
directory, divided into Android and iOS subdirectories. The Android SDK files are in sdk/android/repo
, while the iOS SDK files are in sdk/ios/Flutter
, containing framework files for Debug, Profile, and Release configurations.