Security Architecture
AWS Nitro Trusted Execution Environment
Core API leverages AWS Nitro TEE to provide hardware-level security for all cryptographic operations. This ensures that:- Private keys are never exposed in plaintext
- All cryptographic operations happen in an isolated, tamper-proof environment
- Even Magic cannot access your private keys without proper authorization
JWT-Bound Key Scheme
Every wallet is cryptographically bound to a user’s JWT identity at creation time. The Nitro Enclave bakes JWKS from your identity provider into the enclave image (measured in PCR0). This means JWT verification happens entirely offline inside the enclave — no external network call is needed during a signing operation.Key Material
When a wallet is created, the private key is split using a 2-of-3 Shamir’s Secret Sharing scheme:Shard A (Magic)
Stored encrypted in Magic’s secure infrastructure. Available for all key operations.
Shard B (Discarded)
Generated during wallet creation but immediately discarded. Not stored or returned. Recovery is handled via your identity provider’s JWT.
Shard C1 (Magic)
Stored encrypted in Magic’s secure infrastructure. Combined with Shard C2 to reconstruct the data key.
Shard C2 (Access Key)
Returned to your application as
access_key. Store securely in your database. Required for every signing operation.op_jwt that the enclave verifies before authorizing the request.
Operation Flow
Signing / Key Reveal- Your server retrieves
wallet_idandaccess_keyfrom your database - Your server obtains a short-lived
op_jwt(max 5 min) for the user from your IdP - Your server calls the TEE endpoint with
op_jwt,wallet_id, andaccess_key - The enclave verifies the JWT offline using baked-in JWKS, confirms the caller’s identity matches the wallet’s owner, and authorizes the operation
- The enclave signs using the reconstructed private key; the signed result is returned
Implementation Patterns
Wallet Creation Flow
- User authenticates with your identity provider and receives a JWT
- Server calls
POST /v2/api/walletwithauth_jwt,network, andwallet_group_id - Server stores the returned
wallet_idandaccess_keyin your database - Server returns the
public_addressto the client
Signing Flow
- Client initiates a transaction or signing request
- Server retrieves
wallet_idandaccess_keyfrom your database - Server obtains a short-lived
op_jwtfor the user (max 5 min expiry) - Server calls the appropriate sign endpoint with
op_jwt,wallet_id,access_key, and the payload - Server broadcasts or returns the signed result