I'm using the web3j library with the generated SmartContract wrapper. I'm able to successfully sign a transaction, deploy it to 3rd party node, and interact with the smart contract using the keystore file and the password
Credentials credentials = WalletUtils.loadBip39Credentials(
"testpassword1",
"/path/to/key/store"
);
FastRawTransactionManager txMananger = new FastRawTransactionManager(web3, credentials, Constants.CHAIN_ID);
Optional<TransactionReceipt> receipt = SmartContract.deploy(
web3,
txMananger,
new CustomerGasProvider(),
"param1",
"param2",
"param3"
).send().getTransactionReceipt();
I'm now trying to use the mnemonic to sign the transaction and deploy it. But I can't get it to work because I believe I'm using the Credentials
with the WalletUtils
for the mnemonic incorrectly.
Credentials credentials = WalletUtils.loadBip39Credentials(
"password25", //Password
"art cat devote sauce lamb derive lawn awesome pole zebra original dog" //Mnemonic
);
https://docs.web3j.io/4.8.7/transactions/credentials/
What am I doing incorrectly here when creating the credentials using the mnemonic?
Credentials.create("0x2a52055c3...")
using private key loads the correct address, using the .keystore and password also loads the correct address. Can't figure out why using the mnemonic method is not loading the correct address.
I found some issues on the web3j issues page from a few years ago: