This guide walks you through the main functions of MPC Wallets in the development environment. In this environment, some configurations that require manual setup in the production environment are already enabled by default, making the process simpler with fewer required steps. If you are ready to use MPC Wallets in the production environment, refer to the Production usage guide.
An iOS device to run Cobo Guard, our app for multi-factor authentication (MFA), operation approval, transaction signing, and private key share management.
Log in to the development environment of Cobo Portal, and click Set Up Cobo Guard in the pop-up at the lower left corner. Follow the on-screen instructions to install Cobo Guard on your iOS device and link your account to it.If the pop-up is closed, click Guide in the left-hand menu to reopen it.Purpose of setting up Cobo Guard:
Use it as the MFA method for Cobo Portal.
Use it to approve various requests in Cobo Portal.
You can invite team members to your organization and assign permissions. For the actions associated with each permission, refer to Roles and permissions.
Set transaction policies (risk control rules) for token transfers, including token type, amount, blocklist/allowlist, and approval thresholds (m/n approvals). Refer to Set up token transfer policy for details.
For your testing convenience, the development environment already includes pre-generated addresses for SETH, ETH, BTC, Tron, BNB, SOL, and TON.
To add more chains, refer to Add chains.
For your testing convenience, the system has created the following by default:
A Vault: Cobo Demo Vault (Testing Only)
A wallet: Default MPC wallet in the above Vault
Private key shares: Main Group 2/2; Signing Group and Recovery Group are not configured automatically in the development environment.
Both key shares are held by Cobo by default. When you initiate a transaction from this MPC Wallet in the development environment, Cobo will automatically sign the transaction for you, so you don’t need to sign it manually.
To fully experience the MPC Wallet creation process, refer to:
In the development environment, you can enable Fee Station to simplify gas fee management. It acts as a shared account for your team, and you can deposit gas tokens or USD stablecoins into it, and the system will automatically cover on-chain gas fees based on your settings, while consolidating all platform fees into a single bill.
For details, refer to Fee Station introduction.
For your testing convenience, SETH test tokens are automatically allocated to you in the development environment.
If you need to deposit other tokens (such as USDC or USDT), confirm the chain used (Tron / BEP-20 / ERC-20, etc.) and refer to Transfer (deposit / withdraw) for more details.To pay on-chain gas fees, ensure your wallet has enough gas tokens for the corresponding chain. You can deposit gas tokens or USD stablecoins into Fee Station to use the gas fee payment feature.
This section shows how to use the WaaS 2.0 API with MPC Wallets (Organization-Controlled) to deposit and withdraw tokens.
Generate an API Key and API Secret
Generate an Ed25519 key pair locally to serve as your API Key (public key) and API Secret (private key).
For more details, refer to Generate API Key and API Secret.
Register the API Key
After generating the API Key, register it in Cobo Portal and assign the user role and wallet scope.
Refer to Register API Key.
Integrate the WaaS SDK
After configuring your API Key, integrate the WaaS SDK.
To begin with, you can call a read-only API (such as list supported chains) to test if your SDK setup is working.
For details, refer to:
Set up callbacks and webhooks (optional)
For strengthened security, set a callback endpoint to confirm withdrawal requests.
Refer to Webhooks and callbacks guide.
Initiate a withdrawal transaction
If you have configured transaction policies, a Main Group, or callback endpoints for your wallet, these settings will affect the withdrawal process. For example, you may need additional approval before the transaction can be completed.
Before withdrawing, ensure your wallet has enough gas tokens or that you have enabled Fee Station for gas fee payment.The following is an example code using the JavaScript WaaS SDK. For more details, see the Transfer token API documentation.
Copy
Ask AI
const CoboWaas2 = require("@cobo/cobo-waas2");// Initialize API clientconst apiClient = CoboWaas2.ApiClient.instance;// Set environment (development: Env.DEV, production: Env.PROD)apiClient.setEnv(CoboWaas2.Env.DEV);// Configure API Secret. Replace <YOUR_PRIVATE_KEY> with your API Secret.apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");// Create TransactionsApi instanceconst apiInstance = new CoboWaas2.TransactionsApi();// Construct withdrawal parametersconst opts = {TransferParams: CoboWaas2.TransferParams.constructFromObject({ request_id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", // Request ID, must be unique source: { source_type: "Org-Controlled", // Wallet type: MPC Wallet (Organization-Controlled) wallet_id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", // Wallet ID address: "0xYourFromAddress", // Source address }, token_id: "ETH_USDT", // Token ID destination: { destination_type: "Address", // Destination type account_output: { address: "19AR6YWEGbSoY8UT9Ksy9WrmrZPD5sL4Ku", // Destination address amount: "1.5", // Amount }, },}),};// Submit withdrawal requestapiInstance.createTransferTransaction(opts).then((data) => { console.log("API called successfully. Returned data: " + data);},(error) => { console.error(error);},);
Example response:
Copy
Ask AI
API called successfully. Returned data: {"request_id": "f47ac10b-58cc-4372-a567-0e02b2c3d471","transaction_id": "c8964e6b-32d7-4da3-8407-6c4a4a8c92d7","status": "Submitted"}
Now you have completed the quick start for MPC Wallets in the development environment, including key tasks such as account setup, deposits, and withdrawals. To officially deploy and use MPC Wallets in the production environment, see the Production usage guide.