let addressInfos: [AddressInfo] = [ AddressInfo(bip32Path: "m/44/1/1/0/0", pubKey: "xpub6FRrW2AzsDQcVQPNCCQgiB7xSQ9UseQfrRCJdD9qjWswrNBmY1MysLdMYxpWbB1mnGJTwLCZWCfA4ko2kQNN37CPSzidD1c9aZCBXjTzfQn") AddressInfo(bip32Path: "m/44/1/1/0/1", pubKey: "xpub6FRrW2AzsDQcZahYm2GgsDz7VtqgkvNwR58boDejvwSuCYZ2ZRVvqP6Gaqef6hMGxKtkvj3PfcRxagKSycuh6XX7kJ3Bzc2vUrEAA4at5Jc")]do { let privateKeyInfos = try recoverKey?.recoverPrivateKeys(addressInfos: addressInfos) if let privateKeyInfos = privateKeyInfos { for privateKeyInfo in privateKeyInfos { print("Private Key Info: \(privateKeyInfo)") } } else { print("Failed to recover private keys.") }} catch { print("Error: \(error)")}
Recover keys
Recover private keys
This operation recovers the full private keys for the specified addresses using recovery key shares imported via the Import recovery key share operation.
Use this file to discover all available pages before exploring further.
Try Cobo WaaS Skill in your AI coding assistant (Claude Code, Cursor, etc.). Describe your needs in natural language to auto-generate production-ready SDK code and debug faster 🚀
public func recoverPrivateKeys(addressInfos: [AddressInfo]) throws -> [PrivateKeyInfo]
let addressInfos: [AddressInfo] = [ AddressInfo(bip32Path: "m/44/1/1/0/0", pubKey: "xpub6FRrW2AzsDQcVQPNCCQgiB7xSQ9UseQfrRCJdD9qjWswrNBmY1MysLdMYxpWbB1mnGJTwLCZWCfA4ko2kQNN37CPSzidD1c9aZCBXjTzfQn") AddressInfo(bip32Path: "m/44/1/1/0/1", pubKey: "xpub6FRrW2AzsDQcZahYm2GgsDz7VtqgkvNwR58boDejvwSuCYZ2ZRVvqP6Gaqef6hMGxKtkvj3PfcRxagKSycuh6XX7kJ3Bzc2vUrEAA4at5Jc")]do { let privateKeyInfos = try recoverKey?.recoverPrivateKeys(addressInfos: addressInfos) if let privateKeyInfos = privateKeyInfos { for privateKeyInfo in privateKeyInfos { print("Private Key Info: \(privateKeyInfo)") } } else { print("Failed to recover private keys.") }} catch { print("Error: \(error)")}
A list of address information objects, each containing the BIP32 path and the optional root extended public key, required to recover the corresponding private keys.
The extended public key of the address. This parameter is optional and can be left empty. If provided, the derived public key will be compared against this value during the key derivation process. A mismatch will result in an error.
The extended public key for the address.
For example: xpub6FRrW2AzsDQcVQPNCCQgiB7xSQ9UseQfrRCJdD9qjWswrNBmY1MysLdMYxpWbB1mnGJTwLCZWCfA4ko2kQNN37CPSzidD1c9aZCBXjTzfQn.