Skip to content
Advanced

Solana signing

Configure Ed25519 HD material, derive public keys, and sign Solana message bytes.

Configure chain base keys

typescript
await leaf.setChainBaseKeys({
  keyVaultAddr,
  authProof: setupAuthProof,
  chain: 1, // ChainType.SOLANA
  basePrivateKey,
  baseChainCode,
});

This is a protected setup operation. Its proof commits to the chain and hashes of both key inputs.

Derive and sign

typescript
const publicKey = await leaf.getSolanaAddr({
  keyVaultAddr,
  index: 0,
});

const signature = await leaf.signSolana({
  keyVaultAddr,
  authProof: signAuthProof,
  index: 0,
  message: serializedMessage,
});