Skip to main content

Store a Wallet on a Remote Drive

This section of the documentation focuses on the importance of storing a wallet.


During the development of a web application that incorporates a wallet, you might choose to store it using Unsafe Storage. This simple interface makes wallet implementation easier for developers, thereby streamlining the testing process and facilitating the development of new features.

Risks of Storing a Wallet in the Unsafe Storage

However, it is crucial to understand that this method of storing the wallet in Unsafe Storage MUST NOT be used in a production environment. Unsafe Storage does not provide the necessary security measures to protect sensitive data such as wallet key shares and such data can be easily lost.

For a production application, it is highly recommended to use a more secure and reliable storage method, such as a remote drive (e.g., Google Drive or Dropbox). These remote storage solutions provide robust security features, data encryption, and backup options, thereby ensuring the safety and accessibility of your wallet data.

Storing a Wallet

In this code snippet, we demonstrate how to set up and utilize the SDK for storing a wallet. The script initiates the SDK with a provided client ID, stores the wallet to the user's Google Drive. This serves as a foundation example for developers who are looking to build and manage a wallet using the SDK.


Retrieving a Wallet

Retrieving the wallet is completely transparent to the developer, as it is integrated into the instantiate method of the Wallet namespace.


  1. Eniblock class
  2. WalletNamespace.instantiate() method
  3. AccountNamespace.get() method
  4. Account.getAddress() method
  5. Account.alias property
  6. Account.getNativeBalance() method
  7. Account.getPublicKey() method
  8. Account.creationDate property

Store a wallet with Google Drive

Step 1: Create a Google Cloud Platform (GCP) Project

  1. Visit the Google Cloud Platform Console.

  2. Log in with your Google account or create a new account if you don't have one.

  3. Click on the project dropdown and select or create the project you want to use for your web app.

    Click on the project dropdown
    Create the project you want to use for your web app
    Name and save your new project
  4. Select your new project

Step 2: Enable Google drive API

  1. Enter in the "Enable APIS AND SERVICES" section

  2. Select "Google Drive API" and enable the API

  1. Navigate to the "APIs & Services" dashboard and open the consent screen configuration

    From the dashboard, click on "Explore and enable APIs"
    From the dashboard, click on "Click on "Credentials."
    Click on "Configure consent screen"
  2. Select the appropriate User Type for your app

    Create your consent screen
  3. Fill the consent screen configuration

    Fill all the consent screen configuration
  4. Edit scopes

  5. Add manually a new scope
  6. Optionnaly, function of the User Type, add Test users.

Step 4: Set Up OAuth 2.0 Client IDs

  1. Select Credentials and click on "Create credentials" and select "OAuth client ID."

    Click on "Create credentials" and select "OAuth client ID."
  2. Set the application type

    Choose "Web application" as the application type.
  3. Fill in the required fields

    Such as the "Name," "Authorized JavaScript origins," and "Authorized redirect URIs."
  4. Click "Create" to generate your OAuth 2.0 credentials

    Save the generated "Client ID" and "Client Secret" for later use.

Next Steps

Once you have created a wallet and added an account, you can perform various actions like checking the account balance, sending and receiving assets.