Skip to main content

Generate EVM Address

Derive a deterministic Ethereum address from an MPC key share. The address is computed from the public key at a specific BIP-44 derivation path — no private key is ever exposed.

Components used:


Code

import { WorkspaceClient, ComponentModule } from 'caller-sdk';

const workspace = new WorkspaceClient({ apiKey: process.env.WR_API_KEY! });

async function generateEvmAddress(keyId: string, addressIndex: number): Promise<string> {
// 1. Build BIP-44 derivation path for the given address index
// m/44'/60'/0'/0/<addressIndex>
const { derivationPath } = await workspace
.call(ComponentModule.GET_EVM_DERIVATION_PATH, { addressIndex })
.promise();

// 2. Derive the compressed public key from the MPC key share
const { publicKey } = await workspace
.call(ComponentModule.COMPUTE_PUBLIC_KEY, { keyId, derivationPath })
.promise();

// 3. Convert the compressed public key to an Ethereum address
const { address } = await workspace
.call(ComponentModule.COMPUTE_EVM_ADDRESS, { publicKey })
.promise();

return address;
}

// Example: derive first receiving address
const address = await generateEvmAddress('your-key-id', 0);
console.log('Ethereum address:', address); // 0x...

Derivation path structure

The path produced by GET_EVM_DERIVATION_PATH follows BIP-44:

m / 44' / 60' / 0' / 0 / addressIndex
↑ ↑ ↑ ↑ ↑
purpose ETH acct change index

Set addressIndex to 0, 1, 2, … to generate successive receiving addresses from the same key share.


In a workflow

Wire the three components sequentially on the canvas. Set addressIndex as a workflow trigger input so callers can pass any index at runtime:

[Trigger: addressIndex]


GET_EVM_DERIVATION_PATH
│ derivationPath

COMPUTE_PUBLIC_KEY ← keyId (constant)
│ publicKey

COMPUTE_EVM_ADDRESS
│ address

[Output]