Layer 231
method
wallet.enableBackup#4500c525 flags:# parts:Vector<bytes> new_public_key:flags.1?bytes proof:flags.2?WalletOwnershipProof = WalletState;

Parameters

Name Type Description
Parts Vector<bytes> Encrypted shares of the secret phrase, each encrypted on-device to the public key of one backup holder DC
NewPublicKey flags.1?bytes New wallet public key, when rotating the wallet key in the same call
Proof flags.2?WalletOwnershipProof Proof of ownership of new_public_key, signed over the wallet. get Proof Challenge payload

Returns

WalletState

Gogram Example

holders, err := client.WalletGetBackupHolderDcs()
if err != nil {
	log.Fatal(err)
}
// encryptedShares: split the secret phrase on-device into len(holders) shares and encrypt
// share i to holders[i].PublicKey. The plain phrase never leaves the device.
fmt.Println("holder DCs:", len(holders), "shares prepared:", len(encryptedShares))
state, err := client.WalletEnableBackup(encryptedShares, nil, nil)
if err != nil {
	log.Fatal(err)
}
if s, ok := state.(*tg.WalletStateObj); ok {
	fmt.Println("backup enabled:", s.BackupEnabled)
}