WaaS Quickstart (Android)
This tutorial explains how to run the Demo App on Android with the WaaS React Native SDK.
Successfully building the demo 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 WaaS React Native SDK and its dependencies.
- Created an API key.
Getting Started
Clone the Demo App
The demo application is hosted within the GitHub repo for the WaaS React Native SDK.
To get started, clone the WaaS React Native SDK repo:
git clone git@github.com:coinbase/waas-sdk-react-native.git
Run a Proxy Server
As a security best practice, it is recommended that you use a proxy server to prevent your API keys from being compromised when making requests to the WaaS API.
We provide an open source proxy server for the WaaS API.
To setup, build, and run the proxy server, follow the Proxy Server Setup instructions.
Set Android Environment Variables
Before you can run the demo, you must ensure you have the following Android environment variables set correctly:
ANDROID_HOME
ANDROID_SDK_ROOT="${ANDROID_HOME}"
ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/<insert ndk version>"
ANDROID_NDK_ROOT="${ANDROID_NDK_HOME}"
Once the environment variables have been set, you should export them to your PATH
:
export PATH="${ANDROID_HOME}/emulator:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}"
Launch the Emulator
Navigate to the root directory of the WaaS SDK repo:
waas-sdk-react-native
From a terminal run:
# Install packages for the root directory
yarn install
# Use any x86_64 emulator with min SDK version: 30.
emulator -avd Pixel_5_API_31
# 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 Android emulator
yarn example androidThe Android emulator will launch and you are ready to run the Demo app.
Run Demo App
In this tutorial, you are going to:
- Select a WaaS SDK Mode.
- Create a Pool to group your resources.
- Register your Device (an Android emulator) and put it into a DeviceGroup.
- Create a Goerli Testnet Ethereum address.
- Create and sign an MPCTransaction.
To scroll down when using the Demo App, left-click your mouse, hold, and drag down. You can also clear the footer message.
1. Mode Selection
The WaaS React Native SDK contains two different modes:
- Proxy Mode (recommended): Allows an app to connect to the Coinbase WaaS API through a proxy server.
- Direct Mode: Enables an app to make requests directly to the Coinbase WaaS API.
This tutorial assumes you followed the steps to setup and run a proxy server keep your API key secure. Therefore, you should select Proxy Mode.
For more information on the differences between each SDK mode, see Proxy Mode vs. Direct Mode.
2. 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

3. 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

4. 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



5. 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

