Skip to main content
Most Compose apps need some form of credential — an EOA private key, an auth token for an external service, etc. Compose handles both built-in smart wallets and arbitrary user-managed secrets.

Wallets

Many compose apps will need to make blockchain transactions and will need gas and payment funds to do so. By default, Compose will make you a smart wallet which allows you to pay gas fees in fiat as part of your normal monthly Goldsky bill. This allows simple USD based accounting for companies and users who are not “blockchain-native”. You can easily fund these smart wallets with any tokens you may require for your particular business logic (by default Goldsky will pay gas fees if you haven’t funded the wallet yourself). Goldsky hosted wallets are created dynamically and idempotently in your app code, allowing any type of logic in wallet creation — for specifics see Context. However there may be times when specific EOA wallets are needed for specific transactions, such as owner-only contract methods. In those cases you can store your private key securely in a secret — see below for details.
To fund your built-in smart wallet (beyond Goldsky’s default gas-sponsorship behavior), you can retrieve its public key from the compose Dashboard at app.goldsky.com. See monitoring for details.

Examples

Secrets

Compose secrets are scoped to a specific Compose app within your Goldsky project. You can set or update secrets at any time using the CLI, but a running app will only pick up new secret values after a redeploy. This protects running apps from accidental changes and lets you roll forward (or back) safely by pairing a deploy with the secrets it expects. The way secrets are managed in the cloud vs locally is slightly different.
Secret names must be in SCREAMING_SNAKE_CASE — all uppercase letters, digits, and underscores, starting with a letter (e.g. MY_SECRET, API_KEY_V2).

Manage Secrets for Local Dev

In local dev, you’ll put your secrets in your .env file. Every compose app created with goldsky compose init comes with a gitignored .env file by default.
.env

Manage Secrets for Cloud

To add or update a secret in the cloud:
To update a secret and immediately redeploy so the app picks it up:
To remove a cloud secret:
To list all secrets for the app:
You can also write secrets into your local .env with the same command by adding --env local:

How secrets are stored

Cloud secrets are end-to-end encrypted. When you run goldsky compose secret set, the CLI encrypts the value on your machine with your project’s public key before uploading it, so the value is never sent or stored in plaintext. There is no way to read a secret value back: not from the CLI, not from the dashboard, and not by Goldsky. goldsky compose secret list shows secret names only. A secret is decrypted only inside your running app, where it appears on ctx.env. To rotate a secret, set a new value. The previous value is never displayed, and the dashboard secrets page shows names, not values.
If a secret value would appear in a task run’s trace output, it is redacted in the dashboard. That is intended behavior, not data loss.

Syncing .env to the cloud at deploy

If you’ve been developing locally with secrets in your .env file, compose deploy --sync-env uploads every entry from your .env as a cloud secret before deploying. This is a convenient way to push a whole app’s secrets in one step.
A running app only picks up new secret values after a redeploy. Use --redeploy on secret set, or run goldsky compose deploy yourself.

Using Secrets

For secrets to be injected into your app at runtime, they have to be listed in the secrets: section of the manifest. Only secrets named in the manifest of the currently-deployed version are made available to your tasks — so older deploys keep working even as you add, rename, or remove secrets for newer ones.
compose.yaml
Inside a task, each secret is exposed on ctx.env under its exact name:

Next Steps

App configuration

Configure your app manifest, tasks, and secrets.

Deploying and monitoring

Deploy your app and monitor it in the cloud.