Turnkey icon

Turnkey

Use Turnkey

Overview

This node integrates with the Turnkey service to manage cryptocurrency wallets and accounts, as well as sign transactions. Specifically, the "Create Wallet" operation allows users to create a new wallet within a specified organization on Turnkey, optionally defining multiple accounts for that wallet.

Common scenarios where this node is beneficial include:

  • Automating wallet creation workflows in blockchain or crypto asset management systems.
  • Setting up wallets programmatically for new users or services.
  • Creating multiple accounts under a single wallet with specific cryptographic curves and address formats.

For example, a user can create a Bitcoin wallet with several accounts using different derivation paths and address formats, enabling flexible management of funds across various blockchain networks.

Properties

Name Meaning
Authentication Method of authentication; currently supports "API Key".
Organization ID The unique identifier of the Turnkey organization under which the wallet will be created. This is required.
Wallet Name The name assigned to the new wallet being created. Required field.
Accounts A collection of accounts to create within the wallet. Each account includes:
- Curve: Cryptographic curve used (SECP256K1 or ED25519).
- Path Format: Currently only BIP32 supported.
- Path: Derivation path for the account (required).
- Address Format: Format of the account's address, e.g., Bitcoin Mainnet P2PKH, Ethereum, Solana, etc.

Output

The output JSON contains the full response from the Turnkey API after creating the wallet. This typically includes details about the newly created wallet such as its ID, name, associated accounts, and metadata returned by the Turnkey service.

No binary data output is produced by this operation.

Example output structure (simplified):

{
  "walletId": "string",
  "walletName": "string",
  "accounts": [
    {
      "curve": "CURVE_SECP256K1",
      "pathFormat": "PATH_FORMAT_BIP32",
      "path": "string",
      "addressFormat": "ADDRESS_FORMAT_UNCOMPRESSED",
      "address": "string"
    }
  ],
  "metadata": { /* additional info from Turnkey */ }
}

Dependencies

  • Requires an API key credential for authenticating with the Turnkey service.
  • Uses the Turnkey client library (@turnkey/http) and an API key stamper utility (@turnkey/api-key-stamper) for request signing.
  • For certain operations (not relevant here), it dynamically imports bs58 for Base58 encoding/decoding.
  • The node expects the Turnkey API base URL and credentials to be configured properly in n8n.

Troubleshooting

  • Missing or invalid API key: Ensure the API key credential is correctly set up and has appropriate permissions.
  • Invalid Organization ID: Verify that the provided organization ID exists and the API key has access to it.
  • Invalid account parameters: Each account must have a valid derivation path and supported curve/address format. Missing or incorrect values may cause errors.
  • Network or API errors: Check network connectivity and Turnkey service status if requests fail.
  • Unsupported operation error: If the operation parameter is not set to "createWallet", the node will throw an error indicating unsupported operation.

Error messages thrown by the node are prefixed with "Failed to execute operation:" followed by the underlying error message from the Turnkey client or API.

Links and References

Discussion