Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

DynamicSvmWalletClient::createWalletAccount runs an Ed25519 MPC keygen ceremony and returns a KeygenResult carrying the wallet metadata (with base58 address) and the server key shares the customer must persist.

Prerequisites

Step 1: Choose Your Security Model

Same as EVM — see Create EVM Wallet. Solana wallets use the same ThresholdSignatureScheme enum (TWO_OF_TWO / TWO_OF_THREE).

Step 2: Create the Wallet

import xyz.dynamic.waas.DynamicWalletClientOpts;
import xyz.dynamic.waas.KeygenResult;
import xyz.dynamic.waas.core.types.ThresholdSignatureScheme;
import xyz.dynamic.waas.opts.CreateWalletOpts;
import xyz.dynamic.waas.svm.DynamicSvmWalletClient;

public final class CreateSvmWalletExample {
    public static KeygenResult createSvmWallet(
            String envId,
            String apiToken,
            ThresholdSignatureScheme scheme,
            String password
    ) {
        try (var client = new DynamicSvmWalletClient(
                DynamicWalletClientOpts.builder(envId).build())) {

            client.authenticateApiToken(apiToken).join();

            return client.createWalletAccount(CreateWalletOpts.builder()
                .thresholdSignatureScheme(scheme)
                .password(password)         // required when backUpToDynamic = true
                .backUpToDynamic(true)
                .build()
            ).join();
        }
    }

    public static void main(String[] args) {
        KeygenResult result = createSvmWallet(
            System.getenv("DYNAMIC_ENV_ID"),
            System.getenv("DYNAMIC_API_TOKEN"),
            ThresholdSignatureScheme.TWO_OF_TWO,
            "your-secure-password"
        );

        System.out.println("Solana address: " + result.walletProperties().accountAddress());
    }
}
result.walletProperties().accountAddress() is the base58-encoded Ed25519 public key — the standard Solana address format.

Step 3: Persist State

KeygenResult carries two pieces of state — each belongs in a different storage tier:
WalletProperties walletProperties           = result.walletProperties();
List<ServerKeyShare> externalServerKeyShares = result.externalServerKeyShares();

// WalletProperties — non-sensitive identity + backup-pointer info. Cache it.
redis.set(
    "wallet:" + walletProperties.accountAddress(),
    walletProperties.toJson()
);

// List<ServerKeyShare> — sensitive MPC key material. Vault it.
vault.write(
    "wallet:" + walletProperties.accountAddress() + "/shares",
    ServerKeyShare.toJsonList(externalServerKeyShares)
);
See Storage Best Practices for the full pattern.
.backUpToDynamic(false) means Dynamic will not store the key shares for you. Set it to true and pass a .password(...) to leverage Dynamic’s key share service — the password AES-256-GCM-encrypts your share before upload.

Deriving the address from a public key

DynamicSvmWalletClient.deriveAccountAddress(rawPublicKeyBytes) is a static helper that base58-encodes 32 raw bytes into a Solana address — useful when you have the public key out-of-band and don’t want a network round-trip.

Next Steps