Skip to content

The restored address is different from the address generated on imtoken app #913

@AegisFor

Description

@AegisFor

Try recovering the address using a mnemonic phrase

 public function restore(){
        
        $mnemonic = "";
        
        $mnemonic = $mnemonic;

        $seedGenerator = new Bip39SeedGenerator(new Random());
        $seed = $seedGenerator->getSeed($mnemonic);

        $hierarchicalKeyFactory = new HierarchicalKeyFactory();

        $rootKey = $hierarchicalKeyFactory->fromEntropy($seed);

        $path = "44'/0'/0'"; 

        $key = $rootKey->derivePath($path);
        
        $publicKey = $key->getPublicKey();

        $pubKeyHash = $publicKey->getPubKeyHash();

        $address = new PayToPubKeyHashAddress($pubKeyHash);

        $Address = $address->getAddress();
        print_r($Address);die;
 
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions