neodix42/ton4j

why does the wallet address generated by the same mnemonic using code differ from the one generated using Tonkeper?

Closed this issue · 3 comments

 Pair keyPair = Mnemonic.toKeyPair(words, "");

        TweetNaclFast.Signature.KeyPair tweetNaclKeyPair = TweetNaclFast.Signature.keyPair_fromSeed(keyPair.getSecretKey());
        WalletV5 contract = WalletV5.builder()
                .tonlib(tonlib)
                .walletId(42)
                .keyPair(tweetNaclKeyPair)
                .isSigAuthAllowed(true)
                .build();

        Address walletAddress = contract.getAddress();

        String nonBounceableAddress = walletAddress.toNonBounceable();
        String bounceableAddress = walletAddress.toBounceable();
        log.info("nonBounceableAddress: {}", nonBounceableAddress);
        log.info("bounceableAddress: {}", bounceableAddress);
        log.info("pub-key {}", Utils.bytesToHex(contract.getKeyPair().getPublicKey()));
        log.info("prv-key {}", Utils.bytesToHex(contract.getKeyPair().getSecretKey()));
``` `

You are using the wrong walletId.

Go to tonviewer.com, enter your address, go to Code tab, in the arbitrary method enter get_subwallet_id and click execute.

I used the test network https://testnet.tonviewer.com/ and when I entered get_subwallet_id, it prompted ‘entity not found’.

probably your wallet from tonkeeper is in the main net, not in a testnet.