Skip to content
On this page


Keystore provides an abstraction layer over key management. This abstraction helps with securely managing keys, as well as signing data with the appropriate key. EverscaleStandaloneClient requires a Keystore for signing transactions and other blockchain operations.

In this guide, we will explain what a Keystore is, how to use it with the EverscaleStandaloneClient, and how to manage the keys using a SimpleKeystore.


Keystore is an interface that comprises the getSigner(id: string): Promise<Signer | undefined> method. This method retrieves a Signer instance based on the provided ID.

A Signer is another interface that contains two properties:

  • publicKey: string: The hex-encoded public key.
  • sign(rawData: string, signatureId?: number): Promise<string>: A method to sign data and return a signature. The data can be encoded either in hex or base64.


SimpleKeystore is a class that implements the Keystore interface. It provides basic functionality to manage key pairs. It uses a map to store signers based on their ID and public key.

Here's a list of its methods:

  • addKeyPair: Adds a key pair to the keystore. You can add the key pair either by directly providing it or by providing an ID and a key pair.
  • removeKeyPair: Removes a key pair from the keystore based on its ID.
  • withNewKey: Generates and adds a new key pair to the keystore. This method accepts a callback function to decide whether to keep the key pair based on its public key. It returns the ID of the key pair.
  • getSigner: Retrieves a Signer instance based on the ID or public key.

Creating an instance of SimpleKeystore

import { SimpleKeystore } from 'everscale-standalone-client';

const keystore = new SimpleKeystore();

Adding Key Pairs

You can add key pairs to the SimpleKeystore using the addKeyPair method. This method accepts either a key pair or an ID and a key pair.

const keyPair = SimpleKeystore.generateKeyPair();

// Or you can add a key pair with a custom ID
keystore.addKeyPair('customId', keyPair);

// Remove a key pair

With predefined keys

The SimpleKeystore also allows you to create an instance with predefined keys. This can be useful when you have existing keys that you want to use.

You can provide the keys in the constructor, using an object. The keys of the object will be used as the key IDs and the values are objects that contain the publicKey and secretKey.

Here's how to create a SimpleKeystore with predefined keys:

import { SimpleKeystore } from 'everscale-standalone-client';

const keystore = new SimpleKeystore({
  0: {

Removing Key Pairs

You can remove key pairs from the SimpleKeystore using the removeKeyPair method. This method accepts the ID of the key pair to remove.

// Remove a key pair

Generating and Adding a New Key Pair to SimpleKeystore

const keyId = await keystore.withNewKey(async publicKey => {
  console.log('New public key:', publicKey);
  return true; // Return true to keep the new key

Retrieving a Signer

const signer = await keystore.getSigner('customId');
if (signer) {
  const signature = await signer.sign('data to sign');

Connecting SimpleKeystore to Client

After setting up your SimpleKeystore, you can now connect it to your EverscaleStandaloneClient instance:

const provider = new ProviderRpcClient({
  fallback: () =>
      connection: {
        // Connection configurations go here
      keystore: keystore, // Add your keystore here
  forceUseFallback: true,