Sign Transactions

Use sign() to perform MPC signing for transactions, messages, and typed data across supported blockchain networks.

sign() calls the Tatum enclave to sign using a specific RPC method. Unlike sendAssets(), it gives you control over the signing method and params — useful for contract interactions, message signing, and custom transaction flows.

Supported Methods

MethodChainDescription
eth_sendTransactionEVMSign and broadcast an EVM transaction
personal_signEVMSign an arbitrary message (EIP-191)
eth_signTypedData_v4EVMSign structured data (EIP-712)
sol_signTransactionSolanaSign a Solana transaction
stellar_sendTransactionStellarSign and send a Stellar transaction
tron_sendTransactionTronSign and send a Tron transaction

Sign an EVM Transaction

import { WalletChain } from "@tatumio/wallet-sdk";

const result = await client.sign({
  body: {
    share: shares.SECP256K1.share,
    method: "eth_sendTransaction",
    params: [{
      from: "0xYourAddress",
      to: "0xRecipient",
      value: "0x2386F26FC10000", // 0.01 ETH in wei (hex)
      data: "0x",
    }],
    chainId: WalletChain.ETHEREUM_MAINNET,
    to: "0xRecipient",
  },
});

console.log(result.data); // transaction hash "0x..."

Sign a Message

const result = await client.sign({
  body: {
    share: shares.SECP256K1.share,
    method: "personal_sign",
    params: [
      "0x48656c6c6f20576f726c64", // hex-encoded "Hello World"
      "0xYourAddress",
    ],
    chainId: WalletChain.ETHEREUM_MAINNET,
    to: "0xYourAddress",
  },
});

console.log(result.data); // "0x..." — EIP-191 signature

Sign EIP-712 Typed Data

const typedData = {
  domain: { name: "MyApp", version: "1", chainId: 1 },
  types: {
    Message: [{ name: "content", type: "string" }],
  },
  primaryType: "Message",
  message: { content: "Hello" },
};

const result = await client.sign({
  body: {
    share: shares.SECP256K1.share,
    method: "eth_signTypedData_v4",
    params: ["0xYourAddress", JSON.stringify(typedData)],
    chainId: WalletChain.ETHEREUM_MAINNET,
    to: "0xYourAddress",
  },
});

Sign a Solana Transaction

const result = await client.sign({
  body: {
    share: shares.ED25519.share,
    method: "sol_signTransaction",
    params: [serializedTransactionBase64],
    chainId: WalletChain.SOLANA_MAINNET,
    to: "SolanaRecipientAddress",
  },
});

Optional Parameters

ParameterTypeDescription
rpcUrlstringOverride the automatic RPC endpoint
sponsorGasbooleanEnable gas sponsorship (EVM only)
presignaturestringPre-computed presignature from a previous MPC round
presignatureIdstringID of the presignature
metadataStrstringArbitrary metadata string attached to the signing request

Response

interface SignResponse {
  data: string; // transaction hash (for send methods) or signature hex
}