โ๏ธEject a private key

The eject feature allows a user to construct a private key that can be imported into another wallet manager like Metamask.

To learn more about how eject works check out the reference documentation.

Providing the organization backup share on the client device puts both MPC shares on a single device

Ejecting a private key

In order to a private key

// same endpoint used for recovery
clientBackupCiphertext = callToYourBackendToFetchClientBackupShareCipherText()

// dangerous endpoint that should require extra authentication
organizationBackupShare = apiCallToYourBackendToFetchOrganizationBackupShare()

self.portal.EjectWalletAndDiscontinueMPC(clientBackupCiphertext: clientBackupCiphertext, method: backupMethod, orgShare: organizationBackupShare) { (result: Result<String>) in
    guard result.error == nil else {
      print("handleEject(): Error ejecting wallet:", result.error!)
      return completion(Result(error: result.error!))
    }
    
    print("โœ… handleEject(): Successfully ejected wallet with private key \(result.data!)")
    return completion(result)
}

Last updated