bitcoin core – Importdescriptors on Multisig Pockets

0
35


Im caught on this drawback since yesterday and that i dont get how one can repair it, how do i import a multisig handle to my bitcoin-cli pockets ?

I’m at the moment doing this:

public operate generateMultisigWallet($serverPubkey, $initiatorPubkey, $partnerPubkey) {
    $multisig = $this->request('createmultisig', [2, [$serverPubkey, $initiatorPubkey, $partnerPubkey], 'p2sh-segwit']);
    $multisig = json_decode($multisig)->outcome;

    if(!isset($multisig->handle)) {
        return [false, '', ''];
    }

    $this->importMultisig($serverPubkey, $initiatorPubkey, $partnerPubkey);

    return [true, $multisig->address, $multisig->redeemScript];
}

public operate importMultisig($key1, $key2, $key3) {
    $descriptor="sh(multi(2,".$key1.','.$key2.','.$key3.'))';
    
    $descriptorInfo = $this->request('getdescriptorinfo', [$descriptor]);
    $descriptorWithChecksum = json_decode($descriptorInfo)->result->descriptor;

    $importData = [
        [
            'desc' => $descriptorWithChecksum,
            'timestamp' => 'now',
            "label" => "my_multisig_wallet"
        ]
    ];

    $outcome = $this->request('importdescriptors', [$importData]);

    var_dump("RESULT IS :");
    var_dump($outcome);
    return $outcome;
}

The issue is, i can’t get across the Error Message “Can’t import descriptor with out personal keys to a pockets with personal keys enabled” for it, if i don’t import the handle i can’t get unspent UXTOs nor walletnotify works – does anyone have an answer for this ? Could be extraordinarily grateful if anyone might present assistence.

LEAVE A REPLY

Please enter your comment!
Please enter your name here