Wallet Management
Get or Create Wallet
Get or create a wallet for the authenticated user and return its public address. If a wallet doesn’t exist for the user, one is created automatically and cryptographically bound to the user’s JWT identity.cURL
Request Parameters
Response Fields
Each user can have one wallet per blockchain. Calling this endpoint multiple times with the same user and chain will return the same wallet address.
Signing Operations
All signing operations use theAuthorization: Bearer JWT as the operation JWT (op_jwt). The Nitro Enclave verifies this JWT offline against JWKS baked into the enclave image and confirms the caller’s identity matches the wallet’s owner before authorizing the operation.
Sign Data
Sign a hash with the wallet’s private key. Send the hash together withtransaction_data, the content it was computed from. Magic recomputes the hash from that content and signs only when they match.
cURL
Request Parameters
The blockchain to sign for. Only
ETH is supported: other chains have no transaction_data to check the hash against, so their requests are rejected. For Solana, use Sign Message with the serialized transaction message.The hash to sign (hex string with 0x prefix), computed from
transaction_data as described below.What you’re signing. Required for
ETH. Set method and the fields for it:See EVM data preparation for code that builds each one. Transactions with an access list, blobs or an authorization list are not supported here.
Response Fields
Sign EIP-7702 Authorization
Sign an EIP-7702 authorization that delegates an EOA to a smart contract implementation. This is used to temporarily upgrade an EOA into a smart wallet for a transaction bundle, enabling features like batched calls and gas sponsorship.cURL
Request Parameters
Response Fields
Sign Message
Sign an arbitrary message using the wallet’s private key. Useful for authentication, off-chain verification, and personal signatures.cURL