Skip to main content
Mint JWT is in beta and is enabled per organization. Contact sales to turn it on.

Who can call your app?

A TVC app can hold keys that move money, such as exchange API keys. Protecting the key is half the job. The other half is deciding who may ask the app to use it. If the app trusts an API key held by your backend, anyone who compromises the backend can call it. With Mint JWT, the app instead accepts only requests that carry a Turnkey-signed JWT. Turnkey’s policy engine decides who gets one, and each token authorizes one exact request.
The examples on this page use exchange API keys. The same pattern works for any TVC app that needs to authenticate its callers.

Who approves

Trading firm: administrator quorum

Your trading system mints tokens as a service user. Orders need only the service user. Withdrawals also need two administrators:
The jwt.profile.httpz policy fields are coming soon. See Mint JWT for the order policy.

Consumer trading platform: the customer approves

Your platform runs trading strategies for customers on their own exchange accounts. Auth to your app is non-custodial: each customer owns the policies that decide who can mint tokens for their account, and your platform can’t change them.
  1. Each customer gets a sub-organization and is its root user. They import their exchange API key there, so it never passes through your systems.
  2. Your TVC app has a delegated access user in the sub-organization. Policy lets only that user export the key, encrypted to the app’s enclave.
  3. The customer writes a policy that lets your strategy user mint order tokens for their account:
  4. No policy allows withdrawal tokens, so only the customer can mint one, with their passkey.
  5. The app checks that the token’s org is the customer’s sub-organization, and that sub may call that route: the strategy user for orders, the customer for withdrawals.
The customer can delete the policy at any time to stop automated trading. Give your delegated users no permission to create or edit policies, so your platform can only act within the rules each customer sets. Customers can also verify the app’s code before they import their key.

What the app checks

For every request, the app verifies the token:
  • The signature, against Turnkey’s published keys for the issuer.
  • The audience is the app’s own origin, and the token hasn’t expired.
  • The token’s method, path, query, and body digest match this request.
  • The subject and organization may make this request.
In Rust, turnkey_jwt_profiles does these checks for you.

Getting set up

1

Deploy the app

Deploy your app on TVC and give it the venue keys it needs. See Enclave only secrets.
2

Require a JWT on every route

Reject any request without a valid Turnkey JWT for that exact request.
3

Write the minting policies

Decide who mints each kind of request and who approves. Keep the quorum at 1 while you build, and raise it before production.
4

Mint from your clients

Call mintJwt from your trading system or your customer’s app, then send the request with the token.

Get started

Contact us to enable Mint JWT and design your app’s authorization with our team.