ton4j icon indicating copy to clipboard operation
ton4j copied to clipboard

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

Open xuanbin opened this issue 1 year ago • 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()));
``` `

xuanbin avatar Sep 30 '24 00:09 xuanbin