Skip to main content

Overview

This guide teaches you how to sign EVM transactions using Dynamic’s Node SDK. You’ll learn how to prepare transactions, sign them securely, and send them to the blockchain.

Prerequisites

Before you begin, make sure you have:

Step 1: Set Up Your Environment

First, install the required dependencies:

Step 2: Prepare Your Transaction

Create a transaction using viem’s transaction preparation utilities:

Step 3: Key Share Management for Signing

The approach for signing transactions depends on how you created your wallet: If you created your wallet with backUpToDynamic: true, you can sign directly without retrieving key shares:

With Manual Backup

If you created your wallet with backUpToDynamic: false, you must retrieve and provide external key shares:
Password Handling Notes:
  • If your wallet was created without a password, omit the password parameter
  • If your wallet was created with a password, you must provide it for all operations
  • The password parameter is always optional in the API, but required if the wallet is password-protected

Step 4: Send the Transaction

Send the signed transaction to the network:

Complete Example: Send ETH

Here’s a complete example that sends ETH from one address to another:

Step 5: Handle Transaction Errors

Implement proper error handling for transaction signing and sending:

Best Practices

  1. Gas Estimation: Always let viem estimate gas automatically unless you have specific requirements
  2. Nonce Management: Use viem’s transaction preparation to handle nonces automatically
  3. Error Handling: Implement comprehensive error handling for different failure scenarios
  4. Transaction Monitoring: Monitor transaction status after sending
  5. Security: Never expose key shares in client-side code

Common Transaction Types

Simple ETH Transfer

Contract Interaction

Gas Optimization

Next Steps

Now that you can sign transactions, you can:
Last modified on May 21, 2026