Skip to main content
An entity secret is a cryptographic key. Circle uses it to authorize signing on your developer-controlled wallets. You must generate and register an entity secret before creating any developer-controlled wallets.

Prerequisites

Before you begin, ensure that you’ve:
  • Created an API key in the Circle Console and added it to a .env file in your project:
    .env
    Open .env in your editor rather than writing values with shell commands, and add .env to your .gitignore. This prevents credentials from leaking into your shell history or version control.
  • Installed one of the following:
  • Installed the Developer-Controlled Wallets SDK:
If you are not using the Circle SDK, you can generate and register your entity secret manually using standard libraries or command-line tools.

Generate and register an entity secret

Create your script file with touch register-entity-secret.ts (Node.js) or touch register_entity_secret.py (Python), then add the following script, which:
  • Generates a 32-byte entity secret
  • Registers it with Circle
  • Saves the recovery file to ./recovery/ with a unique filename
  • Adds CIRCLE_ENTITY_SECRET to your .env file for local development (use a secrets manager in production)
Store your entity secret in a secrets manager or encrypted password manager. Save the recovery file to a separate, secure location. It is the only way to reset your entity secret if it is lost. Circle does not store your entity secret and cannot recover it for you. For more on storage and rotation best practices, see How the entity secret works.

Run the script

From the same directory, run:
You should see:
If you see Cannot find module '@circle-fin/developer-controlled-wallets', run the script from the same directory where you ran npm install (or pip install). The SDK lives in that project’s node_modules or virtualenv and isn’t visible from other folders.