Ethereum update: With Web3J how do I get the raw private key from a WalletFile object?
From a Question on stackexchange: https://ethereum.stackexchange.com/questions/55718/how-do-i-get-the-raw-private-key-from-a-walletfile-object
How can I get the raw private key from a WalletFile object?
Here is how I am creating the wallet.
String seed = UUID.randomUUID().toString();
ECKeyPair exKey = Keys.createEcKeyPair();
BigInteger privateKey = exKey.getPrivateKey();
BigInteger publicKey = exKey.getPublicKey();
WalletFile wallet = Wallet.createLight(seed,exKey);
Here is the code where I am sending a transaction,and I need the private key created previously.
Credentials credentials = Credentials.create(“MY PRIVATE KEY”);
TransactionReceipt transactionReceipt = Transfer.sendFunds(
web3j, credentials, accountTo,
Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third-party interference.
Don’t forget to share the post if you love it !