A Bitski powered Ethereum wallet can be connected to your user’s account using a standard OAuth/OIDC login flow illustrated below. This flow can be managed by any standard OIDC client, or implemented directly.

Wallet Creation Flow

Curl Example

curl https://api.bitski.com/v2/federated-accounts \
  --user $CREDENTIAL_ID:$CREDENTIAL_SECRET \
  --json '{"userId": "YOUR_USER_ID"}'

Node JS Example

Here is an example using nodejs. There are only one endpoint required and it can be called at any time without requiring any user interaction.

const ISSUER = 'https://account.bitski.com';
const { BITSKI_CREDENTIAL_ID, BITSKI_CREDENTIAL_SECRET } = platform.env;

export async function createAccount(userId: string): Promise<string[]> {
    var credentials = btoa(`{BITSKI_CREDENTIAL_ID}:{BITSKI_CREDENTIAL_SECRET}`);

    // Use client credentials to create a wallet for your user.
    // The `userId` here can be any string to identify the user.
    const newAccount = await fetch(`${ISSUER}/v2/federated-accounts`, {
      method: 'POST',
      headers: {
        authorization: `Basic ${credentials}`,
        'User-Agent': 'account-creation-example/1.0.0',
        'content-type': 'application/json',
      },
      body: JSON.stringify({
        userId,
      }),
    });

    // The response contains an etherum `0x` address
    const { accounts } = await newAccount.json();

    return accounts;
}

Account Transfer

If enabled, users can transfer their wallets out of the WaaS offering by claiming their account and setting up login credentials. After claiming the account they can use it via the Bitski wallet applications on iOS, web, or browser extension, and use it across the ethereum ecosystem like normal.

Demo

See https://desolaris-demo.bitski.com for an example of creating and claiming accounts via Twitter.

Claim Wallet Example