Skip to content

Key Management for Wallets: TEE vs MPC vs Shamir vs HSM

Joan Alavedra, Co-Founder at Openfort•23 min read
Key management solutions for crypto wallets compared by architecture

TL;DR

Key management solutions differ in one property: how the private key is split, and who can put it back together. Five architectures are in production. TEE / secure enclave (Turnkey, Coinbase CDP) keeps the key whole and decrypts it only inside attested hardware. TEE plus secret sharing (Privy, Magic) splits the key across boundaries and recombines it inside the enclave. Shamir secret sharing with client-side reconstruction (Openfort, MetaMask Embedded Wallets) splits the key between the user's device and a key-management service. MPC / threshold signatures (Fireblocks) never assembles the key at all. Device hardware enclaves (Crossmint) keep a non-extractable key on the phone. All five can be non-custodial — non-custodial is determined by who holds the credential that authorizes signing, not by the cryptography. Openfort's Shamir implementation was audited by Cure53 in September 2024 and its key management by Quantstamp in October 2025; the signer itself (OpenSigner) is open source and self-hostable.

Last updated: September 13, 2026.

Every key management solution answers the same question in a different way: when a transaction has to be signed, where does the private key come from, and who could have produced it without permission?

This post compares the architectures in production today — TEE / secure enclave, TEE plus secret sharing, Shamir secret sharing, MPC threshold signatures, device hardware enclaves, and HSM / cloud KMS — and names which vendors ship which. Every architectural claim below is taken from the vendor's own documentation. Where a vendor does not publish a fact, the cell is blank rather than guessed.

What is non-custodial key management?

Custody is not about where the wallet lives. The wallet lives onchain. Custody is about who can authorize a transaction.

  • Custodial — your organization can sign on its own. You are the custodian. In most jurisdictions this is the configuration that attracts licensing obligations.
  • Non-custodial (self-custodial) — only the end user can sign. The provider holds infrastructure, not authority.
  • Hybrid — both parties must cooperate, or different operations require different parties.

Two details decide which bucket a product actually falls into, and both are routinely missed.

Recovery counts as signing authority. A recovery credential can usually sign transactions directly, and whoever controls recovery can add or remove signers on the wallet. A wallet with a user-held device key but a company-held recovery key is hybrid, not non-custodial. Crossmint states this plainly in its custody models documentation, and it applies to every vendor on this page.

Non-custodial is not a property of the cryptography. Shamir secret sharing, MPC and a secure enclave can each be deployed custodially or non-custodially. What makes a setup non-custodial is that the credential releasing the key material — a passkey, a password, an OAuth session, a device key — is held by the end user and not by the provider or by you. Turnkey makes this explicit: a wallet-as-a-service implementation is non-custodial only if each end user gets a separate sub-organization and key "accessible only by the end user's secret."

So when a vendor says "non-custodial," the follow-up question is: which credential releases the key, and who holds it?

Key management architecture comparison

This is the table to read if you read nothing else. One row per architecture, one column per property.

ArchitectureHow the key is splitWho can reconstruct the full keyRecovery pathCustody by defaultVendors shipping it
TEE / secure enclave (key not split)Not split. The whole key is stored as ciphertext and decrypted only inside an attested enclave with no persistent storage, no interactive access and no external networkingThe enclave, and only after the holder of the authorizing secret (passkey or API key) authenticatesRe-authenticate with the same credential; the enclave decrypts the ciphertext againNon-custodial when the end user holds the authorizing secret; custodial when the developer doesTurnkey, Coinbase CDP
TEE + secret sharingShamir secret sharing into a 2-of-2 set: an enclave share sealed with the TEE's key, and an auth share released only against valid credentialsOnly the TEE, which combines both shares to reconstitute the key for the duration of one signatureRe-authenticate to release the auth share to the enclaveNon-custodialPrivy, Magic
Shamir secret sharing (client-side reconstruction)SSS into a device/primary share and a recovery share, persisted to separate parties — the user's device and a key-management serviceThe client, in memory at signing time, once it holds enough sharesDecrypt the recovery share with a user password, a WebAuthn passkey, a backend-issued encryption session, or security questionsNon-custodialOpenfort, MetaMask Embedded Wallets (formerly Web3Auth)
MPC / threshold signaturesKey shares are generated independently on separate endpoints. A complete key is never assembled in one place at any point in timeNobody. The signature is produced by distributed computation across a quorum of endpointsShares are refreshed or reshared among the parties; the wallet address does not changeDepends entirely on who holds the sharesFireblocks, MetaMask Embedded Wallets (MPC Core Kit, enterprise plan)
Device hardware enclaveNot split. A non-extractable P256 keypair is generated inside the device's own secure element (iOS Secure Enclave, Android Keystore)Nobody. The key cannot be exported — not by the app, not by the vendor, not by the OSA separate recovery signer (email OTP, phone OTP, external wallet) enrolls a new device key onchainNon-custodialCrossmint
HSM / cloud KMSNot split. The key is generated and held non-extractable inside a hardware security moduleNobody extracts it, but whoever holds the KMS API credential can sign with it at willRotate to a second KMS key held in the same infrastructureCustodialCrossmint Cloud KMS signers (AWS KMS, Azure Key Vault, GCP Cloud HSM), Coinbase CDP in API-key mode

Splitting a private key with Shamir secret sharing into separate shares held by different parties

Three things fall out of that table that vendor marketing tends to blur.

  1. "Sharded" and "MPC" are not the same claim. Shamir secret sharing splits a key and then puts it back together. MPC never puts it together. Both are described as "the key is never stored in complete form," which is true of SSS only at rest — not at signing time.
  2. The enclave is a trust assumption, not a proof. A TEE is only as good as its attestation and the party that publishes it. Turnkey addresses this by publishing QuorumOS, the enclave operating system, as open source — though the signing applications running on top of it are not.
  3. Latency is architectural. MPC needs a round trip per signature across the quorum. Cloud TEEs need a network round trip to the enclave. A device enclave key signs locally with none.

Audits and attestations are different columns

This matters enough to separate out, because it is the single most-conflated pair in the category.

  • A SOC 2 Type II attestation audits a company's controls over a period — access management, change management, monitoring. It says nothing about whether the signing code is correct.
  • An independent code audit audits the implementation: the secret sharing, the enclave application, the contracts. It is scoped to a component and dated.

A vendor can hold one and not the other. Read the scope line, not the logo.

VendorSOC 2 Type IIIndependent code audits publishedWhat is open source
OpenfortNoCertiK (Dec 2023, smart contract wallet); Cure53 (Sep 2024, Shamir secret sharing); Omniscia (Dec 2024, smart contract wallet); Quantstamp (Sep 2025, 7702 contract delegator); Quantstamp (Oct 2025, key management)The signer — OpenSigner, self-hostable
PrivyYes (Type II, April 2026)Cure53 (Feb 2023); Zellic (Jun 2023); SwordBytes (Dec 2023); Doyensec (Feb 2024)The Shamir secret sharing primitive library, Apache-2.0, with Cure53 and Zellic reports attached — not the signer
TurnkeyYes (Trust Center; "SOC 2 Type II audited" on turnkey.com)Distrust, Cure53, Trail of Bits, Zellic named on turnkey.com — no dates publishedQuorumOS, the enclave operating system — not the signing applications
FireblocksYes, plus ISO 27001 and C4 CCSS QSP Level 3Cryptographic libraries stated as NCC-audited (dates not published)—
Coinbase CDP———
CrossmintYes (SOC 2 Type II and GDPR, stated on crossmint.com)—Wallet logic is onchain (ERC-4337 + ERC-7579), so signer permissions are publicly auditable
MetaMask Embedded Wallets———
Magic———

Openfort does not hold SOC 2 Type II. If a certificate is a hard gate in your procurement process today, that is a real gap and worth knowing before you start an evaluation. What Openfort publishes is five audits that are both dated and scoped to a named component — including a September 2024 Cure53 review of the Shamir secret sharing implementation itself and an October 2025 Quantstamp review of key management. The full set is on the Openfort security page.

Dating matters more than the count. Privy is the only other vendor here that dates its audits; Turnkey names four firms without dates, and Fireblocks names NCC without dates. An undated audit tells you a review happened at some point, not whether it covered the code running today.

Openfort — Shamir secret sharing with an open-source signer

Openfort embedded wallets split the private key with Shamir secret sharing. The shares are persisted to Shield — Openfort's key-management service — and to the user's account. The key is reassembled client-side inside an isolated signing boundary; the output is a signature, never an exported private key.

The recovery share is what determines the security model, and Openfort ships three ways to encrypt it:

  • Automatic recovery — the recovery share is encrypted with a combination of project entropy and Openfort entropy. Your backend mints a single-use encryption session at login. Lowest friction; requires one API route.
  • Password recovery — the recovery share is encrypted with user-provided entropy. No backend required. The user enters the password once per new device.
  • Passkey recovery — the recovery share is encrypted by a hardware-backed WebAuthn credential. Note that WebAuthn credentials are domain-bound, so a passkey created for one domain will not work on another.

Backend wallets use a different model: signing runs inside an isolated execution environment (TEE) with the private key stored encrypted and never exposed.

The part that is specific to Openfort: the signer is open source. OpenSigner is the key-management infrastructure itself, and you can run it on your own servers, keeping custody of the key shares and the authentication data inside your infrastructure. That is a different claim from publishing a cryptographic primitive — it is the whole signing service, not the library underneath it. Openfort as a company is not "open source"; the signer is.

Audited components, oldest to newest: CertiK (December 2023, smart contract wallet), Cure53 (September 2024, Shamir secret sharing), Omniscia (December 2024, smart contract wallet), Quantstamp (September 2025, 7702 contract delegator), Quantstamp (October 2025, key management).

Privy — 2-of-2 Shamir shares recombined inside a TEE

Privy runs sensitive wallet operations inside AWS Nitro Enclaves and splits private keys using Shamir's secret sharing into what its documentation calls a 2-of-2 share set:

  • an enclave share, "secured directly by the trusted execution environment and encrypted with the TEE's cryptographic key"
  • an auth share, "encrypted and stored by Privy," released only against valid authentication credentials

Both shares are required to produce a signature. Per Privy's docs, "only the TEE can decrypt the enclave share and combine it with the auth share to temporarily reconstitute the wallet and execute actions," and keys "only exist in complete form temporarily within the trusted execution environment during signing operations."

Privy publishes four dated code audits — Cure53 (February 2023), Zellic (June 2023), SwordBytes (December 2023) and Doyensec (February 2024) — alongside SOC 2 Type II (April 2026) and a HackerOne bug bounty. Its Shamir secret sharing library is published under Apache-2.0 with the Cure53 and Zellic reports linked — a cryptographic primitive, not the signer.

Privy's audit record is the closest comparable to Openfort's on this page, and worth being precise about: four audits to Openfort's five, with the most recent dated February 2024 against Openfort's October 2025. Privy also holds the SOC 2 Type II that Openfort does not.

Turnkey — encrypted keys, decrypted only inside an attested enclave

Turnkey does not split keys. It persists encrypted private key ciphertext in its primary and disaster-recovery databases, and that ciphertext "is only to be decrypted from within the bounds of a secure enclave running verified Turnkey applications."

The enclaves are AWS Nitro-based, running Turnkey's own enclave operating system, QuorumOS, with "no persistent storage, no interactive access, and no external networking." Key generation, signing and policy evaluation all happen inside. Turnkey's own analogy is a safety deposit box operator: it secures and facilitates access, but only the customer can unlock the box.

For the model to be non-custodial for your end users, Turnkey's docs are specific about what you have to build: a separate Turnkey sub-organization, user and private key per end user, "accessible only by the end user's secret (e.g., API key or Passkey credentials)." That is a design decision in your integration, not a default.

Turnkey's Trust Center documents SOC 2 Type II and GDPR compliance, and turnkey.com states it is "SOC 2 Type II audited" and names four audit firms — Distrust, Cure53, Trail of Bits and Zellic. No dates or component scopes are published for those reviews, so you cannot tell from the outside how recent any of them is or what it covered. QuorumOS is open source; the signing applications running on it are not.

Coinbase CDP — AWS Nitro Enclaves, two auth modes

Coinbase Developer Platform Server Wallets run key operations inside AWS Nitro Enclaves with "no persistent storage, no interactive access, and no external networking." Keys are encrypted and decrypted inside the enclave and "never leave the enclave in plaintext." Private key operations are documented as not externally accessible to CDP, AWS, or other infrastructure components.

Custody depends on which auth mode you pick:

  • API key auth — your backend holds the credential. Developer-managed, and therefore custodial for those wallets.
  • End-user auth — device-specific key material is generated and stored locally on the end user's device. Non-custodial.

Recovery for a lost developer credential is credential rotation: delete the old Wallet Secret and generate a new one in the CDP Portal.

MetaMask Embedded Wallets (formerly Web3Auth) — 2-of-3 Shamir

Web3Auth is now MetaMask Embedded Wallets. Its default architecture is Shamir's Secret Sharing at a 2-of-3 threshold, with three named shares:

  • ShareA (device share) — stored locally on the user's device
  • ShareB (network share) — encrypted with the user's encryption key and held on the storage layer
  • ShareC (recovery share) — "generally not used during normal operation," available when the device is lost

Any two shares reconstruct the key via Lagrange interpolation. Users add devices by issuing further shares (ShareD and onward), which raises the total and the threshold together. ShareC can be derived from deterministic inputs such as security questions.

A separate MPC/TSS path exists via the MPC Core Kit SDK, which performs no key reconstruction, and is documented as enterprise-plan only. SSS is what ships on the Base, Growth and Scale plans.

Fireblocks — MPC-CMP, no key ever assembled

Fireblocks uses MPC-CMP threshold signatures. Key shares live across "multiple independent endpoints, e.g. cloud servers, on-premises hardware, or mobile devices," and per Fireblocks' own description, "the complete key is never assembled in one place, at any point in time." Signing requires a quorum of at least three endpoints, each independently validating the transaction, and the signature is produced by distributed computation.

Storage tiers map to where shares sit: hot shares in the cloud, warm and cold configurations keeping at least one share offline on an air-gapped device. Shares can be refreshed and rotated without changing the wallet's onchain address, which is why key rotation does not force a wallet migration.

Fireblocks publishes SOC 2 Type 2, ISO 27001, and C4 CCSS QSP Level 3, and states its cryptographic libraries are NCC-audited. It is built for institutional custody and treasury operations, not for per-user embedded wallets.

Crossmint — non-extractable device keys, permissions enforced onchain

Crossmint separates the wallet from the signer. The wallet is an ERC-4337 smart contract with ERC-7579 modules on EVM chains (PDAs on Solana, Soroban contracts on Stellar), so signer permissions are enforced and auditable onchain rather than in a vendor's backend.

The default signer is a P256 key generated inside the user's device secure element — iOS Secure Enclave, Android Keystore, or a browser credential store. The key is non-extractable: not by your application, not by Crossmint, not by the operating system. Signing happens on the device with no network round-trip.

Recovery is a separate onchain signer — email OTP, phone OTP, or an external wallet — enrolled in the wallet's signer set. Because the recovery signer can also sign transactions directly, the choice of recovery signer is what decides custody. Crossmint's own mapping: device signer plus email/phone OTP is non-custodial; device signer plus server signer is hybrid; server signer plus server signer is custodial.

For server-side and treasury wallets, Crossmint supports server key signers held in your own infrastructure, and Cloud KMS signers on AWS KMS, Azure Key Vault or GCP Cloud HSM, keeping keys non-extractable inside the HSM at up to 1,000 signing operations per second per key.

Magic — sharded keys recombined inside a TEE

Magic's TKMS (TEE Key Management System, successor to its earlier DKMS) splits keys into shards held across Magic and, optionally, the developer, "depending on the security requirements." Each shard is encrypted and secured in Trusted Execution Environments with AWS KMS. Per Magic's documentation, shards "are retrieved and securely recombined inside the TEE, never leaving hardware isolation," and "no single party — including Magic — holds a complete, usable key outside the enclave."

Which model do you actually need?

Match the architecture to the constraint that is actually binding on you.

"We need non-custodial key management without holding customer keys." Any of TEE, TEE-plus-sharing, SSS or device enclave works — what matters is that the credential releasing the key stays with the end user, and that your recovery signer does not quietly hand you signing authority back. Check the recovery path before you check the cryptography.

"We're building a payment API and need to sign server-side, unattended." A user-device signer cannot sign at 3am on a cron. You need a TEE-backed server wallet (Turnkey, Coinbase CDP, Openfort backend wallets) or a server key in your own infrastructure (Crossmint server signers). Scope it with a smart account so the server credential can only do payouts, not arbitrary transfers.

"Enterprise-grade, and no single party may move funds alone." That is a separation-of-duties requirement and it is an MPC or multi-signer answer. Fireblocks' MPC-CMP with a quorum of independent endpoints is the established shape. No amount of policy configuration inside a single-signer system substitutes for it.

"We need transparent key management our security team can verify." Verifiability comes in three grades, and they are not equivalent: an attestation you can check (TEE remote attestation), a dated code audit naming the component it covered, or source you can read and run. Openfort's OpenSigner is the third, with the Shamir implementation covered by Cure53 in September 2024. Turnkey's QuorumOS is the third for the enclave OS but not the signing applications. Privy's SSS library is the third for the primitive but not the signer.

"Global payouts, high throughput, low latency per signature." MPC costs a quorum round trip per signature and cloud TEEs cost a network round trip. Device enclave signing (Crossmint) and in-process server key signing have neither. Measure signatures per second against your actual payout batch size before optimizing anything else.

"Consumer app — users will lose their phones." Recovery is the product decision, not storage. Passkey recovery gives you biometrics and phishing resistance but binds credentials to one domain. Password recovery works everywhere and needs no backend, at the cost of a forgettable secret. Backend-issued encryption sessions (Openfort automatic recovery, Privy auth share, MetaMask ShareB) give the lowest friction and require a server route.

Decision flow for choosing a crypto key management model by use case

Detailed comparison

PropertyOpenfortPrivyTurnkeyCoinbase CDPMetaMask EmbeddedFireblocksCrossmintMagic
Primary architectureShamir secret sharingTEE + 2-of-2 SSSTEE (key not split)TEE (key not split)2-of-3 SSSMPC-CMPDevice hardware enclaveShards + TEE
TEE hardwareTEE for backend walletsAWS Nitro EnclavesAWS Nitro + QuorumOSAWS Nitro Enclaves——iOS Secure Enclave / Android KeystoreTEE + AWS KMS
Key split at restYesYes (2 shares)No (encrypted ciphertext)No (encrypted in enclave)Yes (3 shares)Yes (n endpoints)No (non-extractable)Yes (shards)
Full key ever assembledYes, client-side at signingYes, inside the TEE onlyYes, inside the enclave onlyYes, inside the enclave onlyYes, client-side at signingNeverNever (non-extractable)Yes, inside the TEE only
Threshold—2-of-2——2-of-3Quorum of 3+ endpoints——
Who holds the releasing credentialEnd user (password / passkey) or your backend (encryption session)End user auth credentialsEnd user secret (passkey or API key)Developer API key, or end-user device keyEnd user OAuth + deviceShare holders (you)End user device / recovery signerEnd user auth
Non-custodial configuration documentedYesYesYes (requires per-user sub-org)Yes (end-user auth mode)YesDepends on share placementYes (device + OTP recovery)Yes
Custodial configuration availableYes (backend wallets)—Yes (developer-held secret)Yes (API key mode)—YesYes (server / Cloud KMS signers)Yes (dev-held shard)
Recovery: passwordYes———Security questions (ShareC)———
Recovery: passkey / WebAuthnYes—Yes (as auth credential)———Yes (passkey signer)—
Recovery: backend-issued sessionYes (single-use encryption session)Auth share——Network share (ShareB)———
Recovery: email / phone OTP——————Yes (onchain recovery signer)Yes
Recovery: reshare / rotate without address change————Add ShareD+YesYes (update recovery signer, same address)—
Key export to userYes (export private key)—————Yes (email / phone signers)—
Self-hostable key managementYes — OpenSignerNoNoNoNoOn-prem endpoints supportedServer / Cloud KMS signers in your infraOptional developer-held shard
Signer source code publicYesPrimitive library onlyEnclave OS only (QuorumOS)No—NoWallet logic onchainNo
Open-source licence—Apache-2.0 (SSS library)——————
Named third-party code audits5, dated, scoped4, dated4 firms, undated——NCC (crypto libraries)——
Audit dates publishedYesYesNo——No——
Audit covering the key-sharing implementationCure53, Sep 2024Cure53 + Zellic (SSS library)——————
Audit covering key managementQuantstamp, Oct 2025———————
SOC 2 Type IINoYes (Apr 2026)Yes——YesYes—
ISO 27001—————Yes——
Other certifications——GDPR——C4 CCSS QSP Level 3——
Bug bounty published—HackerOneVulnerability disclosure programme—————
Remote attestation published——Yes—————
Signing latency shapeClient-side reassemblyNetwork round trip to enclaveNetwork round trip to enclaveNetwork round trip to enclaveClient-side reassemblyQuorum round tripLocal, no round tripNetwork round trip to enclave
Smart account / ERC-4337Yes, native—————Yes (ERC-4337 + ERC-7579)—
Session keys / scoped permissionsYes—Policy engine——Policy engineYes (signer scopes, onchain)—
Solana supportYes (Ed25519)YesYesYesYesYesYes (PDAs)Yes
Built forEmbedded wallets + stablecoin productsEmbedded wallets + authKey infrastructure, treasuryCoinbase ecosystemEmbedded wallets + social loginInstitutional custodyEmbedded + treasury walletsEmbedded wallets + auth

Blank cells mean the vendor does not publish the fact in its own documentation, or it could not be read there. They are not "no."

Questions to ask a key management vendor

  1. Which credential releases the key material, and who holds it? This, not the cryptography, decides custody.
  2. Who holds the recovery signer? If the answer is "you do," the wallet is hybrid regardless of what the signing path looks like.
  3. Is the key ever assembled whole, and where? SSS assembles it; MPC does not. Both are described as "never stored in complete form."
  4. Can I read or self-host the signer? Not the primitive library — the signing service.
  5. Which components have been audited, by whom, and when? Ask for the scope line. "We're audited" without a component name is not an answer.
  6. Is your SOC 2 covering controls or code? Controls. Always controls. It is not a substitute for a code audit and should never share a column with one.
  7. What happens to the wallet address when keys rotate? MPC reshares and smart-contract wallets keep the address. Key-derived addresses do not.

Read the Openfort security page for the full audit record with dates and scopes, or start building for free.

Share this article

Related Articles

  1. Privy vs Turnkey (2026): Pricing, Architecture, and Fit

    Privy vs Turnkey in 2026: signing latency, MAU vs per-signature pricing, auth flexibility, smart account support, and who each one fits.

  2. OpenSigner: Vendor-Neutral Key Management

    OpenSigner enables non-custodial wallets and vendor-neutral key management — evolve your stack without asking users to start over.

  3. Software Cryptocurrency Wallet: A Developer's Guide

    How software cryptocurrency wallets manage keys, the MPC vs smart-account trade-off, and how to embed one in your app in days.

  4. AA and MPC: A Practical Approach to Security

    Explore the real-world benefits of account abstraction and multiparty computation (MPC) in delivering secure and scalable crypto applications

  5. Fireblocks vs Turnkey (2026): custody or infrastructure?

    Fireblocks and Turnkey are different categories. Compare custody, MPC vs TEE, certifications, deployment models, and pricing before you shortlist.

  6. Non-Custodial Wallet Infrastructure: Why Open Source Wins

    The difference between custodial, closed-source non-custodial, and open-source non-custodial wallet infrastructure, and why transparency matters.

  7. Wallet policy engines compared: Openfort, Privy, Turnkey

    Spending limits, allowlists, session keys, enforcement point and audit-trail export compared across five wallet policy engines, on documented evidence.

  8. Passkeys and Account Abstraction

    Passkeys are becoming an ever increasing option for users to sign transaction with their hardware devices. Let's explore how!

Ship your first wallet in minutes

No credit card required • 2,000 operations free