Skip to content

BhavaniBas/EthereumWallet

Repository files navigation

EthereumWallet

Ethereum. Ethereum is an open-source, public, blockchain-based distributed computing platform and operating system featuring smart contract (scripting) functionality. ... Ether is a cryptocurrency whose blockchain is generated by the Ethereum platform.

MetaMask a Wallet

Creating a wallet on MetaMask. MetaMask is an Ethereum browser. It gives you all the same functions, features and ease of access from regular Ethereum wallets, and it allows you to interact with Dapps and Smart Contracts.

Creation Of Wallet Using ## Web3j

1. Empty Local Directory Created.

File myDownload = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/NewWallet"); myDownload.mkdirs(); mKeyStore = new KeyStore(myDownload.getAbsolutePath(), Geth.LightScryptN, Geth.LightScryptP); String fileName = WalletUtils.generateLightNewWalletFile(SharedHelper.getKey(CreateWalletActivity.this, "password"), new File(String.valueOf(myDownload))); File file = new File(myDownload, fileName); file.createNewFile();

2. Wallet Creation // To get wallet account address, private Key & public key from Credentails part.

Credentials credentials = WalletUtils.loadCredentials( "Hello", "/path/NewWallet.json");

3. Using Private key to get wallet account address.

i) To pass both private key & public key values from ECKeyPair.

ECKeyPair ecKeyPair = new ECKeyPair(privateKey, publicKey);

4. Using Keystore file to get wallet account address.

Credentials credentials = WalletUtils.loadCredentials("Hello", "/path/newWallet.json");

5. Add Token using Contract Address.

To check token address verified or not & then invalid address using Api Calling to get response of the add token value stored from array list.

6. Send Transaction

i ) Normal Transaction

BigInteger privateKey = new BigInteger(private_key_value, 16); BigInteger publicKey = new BigInteger(public_key_value, 16); ECKeyPair ecKeyPair = new ECKeyPair(privateKey, publicKey); Credentials credentials = Credentials.create(ecKeyPair); TransactionReceipt transactionReceipt; try { transactionReceipt = Transfer.sendFunds(web3,credentials, "0xcfF997Ac428D3986c32aB45Cb80FB780301319F4", BigDecimal.valueOf(0.1),Convert.Unit.ETHER).sendAsync().get(); String transactionHash = transactionReceipt.getTransactionHash(); } catch(Exception e) { e.printStackTrace(); }

ii ) Custom Transaction

What is Gas?

Gas is a unit of measuring the computational work of running transactions or smart contracts in the Ethereum network. This system is similar to the use of kilowatts (kW) for measuring electricity in your house.

What is Gas Limit?

Gas limit refers to the maximum amount of gas you’re willing to spend on a particular transaction. A higher gas limits mean that more computational work must be done to execute the smart contract. A standard ETH transfer requires a gas limit of 21,000 units of gas.

What is Gas Price ?

  • Gas price refers to the amount of Ether you’re willing to pay for every unit of gas, and is usually measured in “Gwei”. An analogy for gas price – relating to the previous analogy for gas limits – is that it is similar to the cost of each litre of fuel that you’re paying for filling up your car.*

Transaction (Tx) Fees: Gas Used by Txn * Gas Price

  • From the above example, we can see that the actual gas consumed in executing the transaction is 21,000 gas while the gas price chosen by the user is 8 Gwei (0.000000008 ETH). Multiply both figures together and you’ll get the actual cost of executing the transaction, amounting to 0.000168 Ether (USD $0.14). *

  • It is important to note that the gas limit can be (and is usually) more than the actual gas used in the transaction. In times of an ICO, the average gas price will tend to be exponentially higher as people will be rushing to participate in the ICO. This would lead to more people increasing their gas prices to have a better chance of confirming their ICO transaction. *

This site was built using Refer Document Pages

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages