Key Import and Export

Builder Vault supports import and export of keys by calling the ImportKey and ExportKey methods on the SDK. This allows you to (1) import an external key into Builder Vault; (2) export a key from Builder Vault; and (3) migrate a key between two Builder Vault instances.

Key import/export versus key share import/export

Builder Vault has two kinds of import/export that should not be confused, though they have somewhat overlapping use cases:

(1) Key import/export. These are MPC operations that require all MPC nodes to interact with each other. The main use case for this is import of an entire key into Builder Vault, out of Builder Vault, or between two Builder Vault instances.

(2) Key share import/export. This is a local operation on a single MPC node, that does not require communication with the other MPC nodes. The main application for this is to generate a backup of the key share held by a single MPC node, e.g. a node running on a mobile device.

For key import/export, Builder Vault applies several mechanisms to protect the key while in transit:

  1. The key is exported from / imported to the Builder Vault via an MPC session. The MPC session only runs if all MPC nodes holding key shares agree to perform the export. Each SDK user therefore has the opportunity to enforce whatever policy it finds necessary, before it allows the key export / import.
  2. The key is exported / imported as a secret sharing, one key share exported from / imported to each MPC node. This lets you transfer the key to its destination using multiple channels.
  3. The key sharing is automatically re-randomized before export and after import. This means that security will not be affected, even if up to t of the shares in transit are compromised, where t is the security threshold of the key.
  4. Each key share is not exported in the clear, but is encrypted (wrapped) using a provided public key before being exported. You can restrict the set of allowed wrapping keys in your application, simply by making sure that the SDK only requests the export MPC session with an allowed wrapping key. Alternatively, the MPC nodes can be configured to only accept a certain set of wrapping keys.
  5. The export MPC session outputs the public key along with the private key shares. The public key can also be provided to the key import session, and will be used to verify the authenticity of the private key.

Key Import/Export Use Cases