Quickstart (iOS)
The tutorial explains how to run the Sample App on iOS with the WaaS React Native SDK.
Successfully building the sample app proves that you have the development environment to do multi-party computation (MPC), and demonstrates how the WaaS APIs work.
The WaaS SDK supports both iOS and Android.
Prerequisites
This tutorial assumes that you:
- Installed the prerequisites, iOS dependencies, and the SDK.
- Created an API key, and ideally tested it against the client libraries.
To simply run the demos below, you can clone the SDK rather than install:
git clone git@github.com:coinbase/waas-sdk-react-native.git
Authenticate
To run the SDK demos, you can authenticate as follows:
Navigate into the
waas-sdk-react-native
repo:cd {path_to}/waas-sdk-react-native
Edit the hidden file
/example/src/.coinbase_cloud_api_key.json
with your API credentials:tipTo see hidden files in your Mac Finder, press Command+Shift+Dot.
a. Analyze your keypair which looks like this (with the actual values replaced by
{variableNames}
here).{
"name": "organizations/{organizationID}/apiKeys/{apiKeyId}",
"principal": "{principalID}",
"principalType": "USER",
"publicKey": "-----BEGIN EC PUBLIC KEY-----\n{PUBLIC_KEY}\n-----END EC PUBLIC KEY-----\n",
"privateKey": "-----BEGIN EC PRIVATE KEY-----\n{PRIVATE_KEY}\n-----END EC PRIVATE KEY-----\n",
"createTime": "2023-03-21T02:02:45.362863508Z"
}b. Open
/example/src/.coinbase_cloud_api_key.json
{
"name": "organizations/organizationID/apiKeys/apiKeyName",
"privateKey": "-----BEGIN EC PRIVATE KEY-----ExamplePrivateKey-----END EC PRIVATE KEY-----\n"
}c. Replace and save:
organizationID
with the yourorganizationID
apiKeyName
with yourapiKeyId
ExamplePrivateKey
with your actualPRIVATE_KEY
between the\n
bookends.
Launch Simulator
Navigate to the root directory of the repo:
waas-sdk-react-native
Open Xcode and from a terminal run:
# Install packages for the root and /example directories
yarn bootstrap
# Start the Metro server
yarn example startIn a separate terminal window, navigate to
waas-sdk-react-native
and run:# Build and start the app on iOS or Android simulator
yarn example ios --simulator "iPhone 14"The iOS simulator launches and you are ready to run the Sample App demos.
infoTo test against Android, install the Android dependencies and run
yarn example android
from the root directory in a separate terminal window.
Run Sample App
In this tutorial, you are going to:
- Create a Pool to group your resources.
- Register your Device (a simulated iPhone) and put it into a DeviceGroup.
- Create a Goerli Testnet Ethereum address.
- Create and sign an MPCTransaction.
To scroll down the Sample App, left-click your mouse, hold, and drag down. You can also clear the footer message.
1. PoolService Demo
The PoolService or "Pool" Demo creates a Pool resource to contain other resources such as keys, addresses, and multiple wallets. For example, if you want to organize wallets by geography, you might have a US pool and an EMEA pool, etc.
Go to the PoolService Demo and click Run.
Input an arbitrary Pool name for display, e.g.,
US Pool
, and click Continue.The API calls CreatePool and returns:
- Pool Resource name, e.g.,
pools/bdfb2066-6ce1-4dcc-ba3d-f1db52c89c2a
- Pool Display name, e.g.,:
US Pool
infoResource names follow Google standard, AIP-122.
- Pool Resource name, e.g.,
Copy and save the resource name of your Pool to use in the MPCWalletService Demo.
Click Home.
Expand for image and click to enlarge

2. MPCKeyService
The MPCKeyService or "MPC Keys" Demo generates registration data for the Device and registers the Device on MPCKeyService.
Go to the MPCKeyService Demo and click Run.
Enter a passcode with 6 or more characters and click Continue.
Copy and save the registration data.
Click Copy and save the resource name of the Device to use in the following MPCWalletService demo.
Expand for image and click to enlarge

3. MPCWalletService Demo
The MPCWalletService or "GenerateAddress" Demo, creates an MPCWallet, computes the DeviceGroup associated with the MPCWallet, and generates a Goerli Ethereum Address in the MPCWallet.
Go to the MPCWalletService Demo and click Run.
Enter the Pool resource name from the PoolService Demo.
Enter the Device resource name from the MPCKeyService Demo.
Click Continue.
Copy the three returned resources -- you need to clear the footer message and scroll down to see the Address resource:
a. Copy the DeviceGroup resource name.
b. Copy the MPCWallet resource name.
c. Copy the Goerli Ethereum Address.
Paste your new address in Etherscan.io to verify that it's real. It should exist with no transactions.
Expand for images and click to enlarge



4. MPCSignature Demo
The MPCSignature or "Tx Signing" Demo creates an Ethereum transaction with an Address in MPCWallet, computes an MPCSignature for it, and returns the signed transaction.
Go to the MPCSignature Demo and click Run.
Enter your Ethereum address in the "Address resource" field.
Enter the DeviceGroup resource name.
Click Continue.
An EIP-1559 transaction is created and its data populates the window.
{
"ChainID": "0x5",
"Nonce": 0,
"MaxPriorityFeePerGas": "0x400",
"MaxFeePerGas": "0x400",
"Gas": 63000,
"To": "0xd8ddbfd00b958e94a024fb8c116ae89c70c60257",
"Value": "0x1000",
"Data": ""
}cautionIf you want to broadcast, replace this placeholder transaction with a valid transaction.
Click Continue again (or if you want to sign some other transaction, you can replace the text).
The hex-encoded payload of the Signature is returned.
Copy and save the Signature.
Copy and save the signed transaction.
Expand for images and click to enlarge

