in

Ethereum : With Web3J how do I get the raw private key from a WalletFile object?

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,
BigDecimal.valueOf(0.5),Convert.Unit.ETHER).sendAsync().get();




View the link

About Ethereum



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.

Author: murphy9191

Score: 3

Don’t forget to share the post if you love it !

Blockchain : IBM-Maersk alliance cut oceanic shipping times by 40%

Bitcoin : BTC DOMINANCE much bigger than the stat.