litecoin-qt get address

Bitcoin Core is a free and open source Bitcoin wallet software developed by the Bitcoin Foundation.In this tutorial we are going to look at how to install Bitcoin Core wallet on Ubuntu 16.04 and Ubuntu 16.10.Once it’s done, you will have your own bitcoin wallet address which you can use to send, receive and store bitcoins.Bitcoin Core wallet isn’t included in Ubuntu software repository, but we can easily install it from the Bitcoin Team PPA.This PPA is maintained by a Bitcoin developer named Matt Collaro and is recommended for Ubuntu users on Bitcoin Core download page.Fire up a terminal window ( ) and run the following 3 commands to add the PPA, update local package index and install Bitcoin Core wallet.bitcoin-qt provides a graphical interface, while bitcoind is the Bitcoin daemon.If you just want a graphical interface and have no plan to use the daemon, then don’t enter bitcoind in the command line.Once installed, Bitcoin Core wallet can be started from Unity Dash or your preferred app launcher.
Or using the command below.Upon first launch, it will ask you to set your bitcoin data directory which will be used to store the Bitcoin block chain and your wallet.The default is .bitcoin/ under your home directory.Make sure the data directory has more than 80GB free disk space.The block chain is about 80GB in size.So you may need to wait for a few days for it to be downloaded onto your computer and then you can start using Bitcoin.Once the Bitcoin wallet software is installed on your computer, there are 3 important items you need to be aware of.They are: Your Bitcoin wallet address is the hashed version of your Bitcoin public key.These 3 items are all stored in a file named wallet.dat under the data directory and it’s very important to back up this file.Should you lose this file, then your Bitcoin currency will be gone.Let’s say you install Bitcoin Core wallet on a new computer, and you don’t need a new Bitcoin wallet address or to download a new copy of the block chain but want to use your existing wallet address and block chain.
All you need to do is change Bitcoin data directory.First, find your previous Bitcoin data directory and copy this directory to your new computer.bitcoin escrow sitesNext, shut down Bitcoin Core on the new computer, and rename ~/.bitcoin directory.bitcoin rally 2014Start Bitcoin Core again.bitcoin math problemBecause the default data directory has been renamed, the Bitcoin Core software assumes this is the first session and let you choose a data directory.cours sur le bitcoinSelect the second option and choose your previous data directory.bitcoin cambio a dolarOnce you hit the Ok button, the client will verify blocks that are stored in your previous data directory.ethereum radeon
And in a few moments the blocks should be loaded and you will see your coins in the new Bitcoin Core software.I hope this tutorial helped you to install Bitcoin Core Wallet on Ubuntu 16.04 and Ubuntu 16.10.buy litecoin for cashAs always, if you found this post useful, then Subscribe to our free newsletter to get latest Linux tutorials.bitcoin fixed incomeYou can also follow us on Google+, Twitter or like our Facebook page.make bitcoin cloneAre you a developer working on a Bitcoin project or are you a power user discovering the more advanced Bitcoin features?This post explains how to get started with the Bitcoin testnet so you can play without using your real, hard-earned coins.None of the Bitcoin client applications implement all of those features, (yet) so you'll have to use the Bitcoin RPC interface from the command line.
Install Download and install the Bitcoin Core client (previously named Bitcoin-Qt).You can, but don't have to, start the application.It will start downloading the huge, real blockchain, which you don't need for testing.Configure Find the Bitcoin Core data directory for your system.Create this directory if it doesn't exist yet (should be there from when you ran the client before).On Mac OS X for example: mkdir ~/Library/Application\ Support/Bitcoin/ Create a bitcoin.conf configuration file in that directory.A minimal example might look like: =1 =1 = = = = Run Start the Bitcoin Core client.The application icon should be green instead of orange.The green icon indicates it's running in testnet mode.The client will start downloading the testnet blockchain and this will take a while.While you wait for the testnet blockchain to download, you can grab some testnet coins.Find a Bitcoin testnet faucet and send yourself some coins (you can find an address in the Bitcoin Core client).
The coins will only show up in the Bitcoin Core client application when the blockchain download has caught up, so wait for it to finish.Play Time to try it out.Here is a simple cURL command to ask the Bitcoin daemon for some general info using a JSON RPC: curl --user Ulysseys --data-binary -H http://127.0.0.1:8332/Bitcoin Core: The Reference Implementation .The reference client implements all aspects of the bitcoin system, including wallets, a transaction verification engine with a full copy of the entire transaction ledger (blockchain), and a full network node in the peer-to-peer bitcoin network.On Bitcoin’s Choose Your Wallet page, select Bitcoin Core to download the reference client.Depending on your operating system, you will download an executable installer.For Windows, this is either a ZIP archive or an .exe executable.For Mac OS it is a .dmg disk image.Linux versions include a PPA package for Ubuntu or a tar.gz archive. page that lists recommended bitcoin clients is shown in Figure 3-1.
Running Bitcoin Core for the First Time If you download an installable package, such as an .exe, .dmg, or PPA, you can install it the same way as any application on your operating system.For Windows, run the .exe and follow the step-by-step instructions.For Mac OS, launch the .dmg and drag the Bitcoin-QT icon into your Applications folder.For Ubuntu, double-click the PPA in your File Explorer and it will open the package manager to install the package.Once you have completed installation you should have a new application called Bitcoin-Qt in your application list.Double-click the icon to start the bitcoin client.The first time you run Bitcoin Core it will start downloading the blockchain, a process that might take several days (see Figure 3-2).Leave it running in the background until it displays "Synchronized" and no longer shows "out of sync" next to the balance.Bitcoin Core keeps a full copy of the transaction ledger (blockchain), with every transaction that has ever occurred on the bitcoin network since its inception in 2009.
This dataset is several gigabytes in size (approximately 16 GB in late 2013) and is downloaded incrementally over several days.The client will not be able to process transactions or update account balances until the full blockchain dataset is downloaded.During that time, the client will display "out of sync" next to the account balances and show "Synchronizing" in the footer.Make sure you have enough disk space, bandwidth, and time to complete the initial synchronization.Using Bitcoin Core’s JSON-RPC API from the Command Line The Bitcoin Core client implements a JSON-RPC interface that can also be accessed using the command-line helper bitcoin-cli.The command line allows us to experiment interactively with the capabilities that are also available programmatically via the API.To start, invoke the help command to see a list of the available bitcoin RPC commands: Getting Information on the Bitcoin Core Client Status Commands: getinfo Bitcoin’s getinfo RPC command displays basic information about the status of the bitcoin network node, the wallet, and the blockchain database.
Use bitcoin-cli to run it: $ {"version" : 90000,"protocolversion" : 70002,"walletversion" : 60000,"balance" : 0.00000000,"blocks" : 286216,"timeoffset" : -72,"connections" : 4,"proxy" : "","difficulty" : 2621404453.06461525,"testnet" : false,"keypoololdest" : 1374553827,"keypoolsize" : 101,"paytxfee" : 0.00000000,"errors" : "" } The data is returned in JavaScript Object Notation (JSON), a format that can easily be "consumed" by all programming languages but is also quite human-readable.Among this data we see the version numbers for the bitcoin software client (90000), protocol (70002), and wallet (60000).We see the current balance contained in the wallet, which is zero.We see the current block height, showing us how many blocks are known to this client (286216).We also see various statistics about the bitcoin network and the settings related to this client.We will explore these settings in more detail in the rest of this chapter.It will take some time, perhaps more than a day, for the bitcoind client to "catch up" to the current blockchain height as it downloads blocks from other bitcoin clients.
You can check its progress using getinfo to see the number of known blocks.Wallet Setup and Encryption Commands: encryptwallet, walletpassphrase Before you proceed with creating keys and other commands, you should first encrypt the wallet with a password.For this example, you will use the encryptwallet command with the password "foo".Obviously, replace "foo" with a strong and complex password!You can verify the wallet has been encrypted by running getinfo again.This time you will notice a new entry called unlocked_until.This is a counter showing how long the wallet decryption password will be stored in memory, keeping the wallet unlocked.At first this will be set to zero, meaning the wallet is locked: $ {"version" : 90000, #[... other information...]"unlocked_until" : 0,"errors" : "" } $ To unlock the wallet, issue the walletpassphrase command, which takes two parameters—the password and a number of seconds until the wallet is locked again automatically (a time counter): You can confirm the wallet is unlocked and see the timeout by running getinfo again: $ {"version" : 90000, #[... other information ...]"unlocked_until" : 1392580909,"errors" : "" } Wallet Backup, Plain-text Dump, and Restore Commands: backupwallet, importwallet, dumpwallet Next, we will practice creating a wallet backup file and then restoring the wallet from the backup file.
Use the backupwallet command to back up, providing the filename as the parameter.Here we back up the wallet to the file wallet.backup: Now, to restore the backup file, use the importwallet command.If your wallet is locked, you will need to unlock it first (see walletpassphrase in the preceding section) in order to import the backup file: The dumpwallet command can be used to dump the wallet into a text file that is human-readable: Wallet Addresses and Receiving Transactions Commands: getnewaddress, getreceivedbyaddress, listtransactions, getaddressesbyaccount, getbalance The bitcoin reference client maintains a pool of addresses, the size of which is displayed by keypoolsize when you use the command getinfo.These addresses are generated automatically and can then be used as public receiving addresses or change addresses.To get one of these addresses, use the getnewaddress command: Now, we can use this address to send a small amount of bitcoin to our bitcoind wallet from an external wallet (assuming you have some bitcoin in an exchange, web wallet, or other bitcoind wallet held elsewhere).
For this example, we will send 50 millibits (0.050 bitcoin) to the preceding address.We can now query the bitcoind client for the amount received by this address, and specify how many confirmations are required before an amount is counted in that balance.For this example, we will specify zero confirmations.A few seconds after sending the bitcoin from another wallet, we will see it reflected in the wallet.We use getreceivedbyaddress with the address and the number of confirmations set to zero (0): If we omit the zero from the end of this command, we will only see the amounts that have at least minconf confirmations, where minconf is the setting for the minimum number of confirmations before a transaction is listed in the balance.The minconf setting is specified in the bitcoind configuration file.Because the transaction sending this bitcoin was only sent in the last few seconds, it has still not confirmed and therefore we will see it list a zero balance: The transactions received by the entire wallet can also be displayed using the listtransactions command: [{"account" : "","address" : "1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL","category" : "receive","amount" : 0.05000000,"confirmations" : 0,"txid" : "9ca8f969bd3ef5ec2a8685660fdbf7a8bd365524c2e1fc66c309acbae2c14ae3","time" : 1392660908,"timereceived" : 1392660908} ] We can list all addresses in the entire wallet using the getaddressesbyaccount command: ["1LQoTPYy1TyERbNV4zZbhEmgyfAipC6eqL","17vrg8uwMQUibkvS2ECRX4zpcVJ78iFaZS","1FvRHWhHBBZA8cGRRsGiAeqEzUmjJkJQWR","1NVJK3JsL41BF1KyxrUyJW5XHjunjfp2jz","14MZqqzCxjc99M5ipsQSRfieT7qPZcM7Df","1BhrGvtKFjTAhGdPGbrEwP3xvFjkJBuFCa","15nem8CX91XtQE8B1Hdv97jE8X44H3DQMT","1Q3q6taTsUiv3mMemEuQQJ9sGLEGaSjo81","1HoSiTg8sb16oE6SrmazQEwcGEv8obv9ns","13fE8BGhBvnoy68yZKuWJ2hheYKovSDjqM","1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL","1KHUmVfCJteJ21LmRXHSpPoe23rXKifAb2","1LqJZz1D9yHxG4cLkdujnqG5jNNGmPeAMD" ] Finally, the command getbalance will show the total balance of the wallet, adding up all transactions confirmed with at least minconf confirmations: If the transaction has not yet confirmed, the balance returned by getbalance will be zero.
The configuration option "minconf" determines the minimum number of confirmations that are required before a transaction shows in the balance.Exploring and Decoding Transactions Commands: gettransaction, getrawtransaction, decoderawtransaction We’ll now explore the incoming transaction that was listed previously using the gettransaction command.We can retrieve a transaction by its transaction hash, shown at txid earlier, with the gettransaction command: {"amount" : 0.05000000,"confirmations" : 0,"txid" : "9ca8f969bd3ef5ec2a8685660fdbf7a8bd365524c2e1fc66c309acbae2c14ae3","time" : 1392660908,"timereceived" : 1392660908,"details" : [{"account" : "","address" : "1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL","category" : "receive","amount" : 0.05000000}] } Transaction IDs are not authoritative until a transaction has been confirmed.Absence of a transaction hash in the blockchain does not mean the transaction was not processed.This is known as "transaction malleability," because transaction hashes can be modified prior to confirmation in a block.
After confirmation, the txid is immutable and authoritative.The transaction form shown with the command gettransaction is the simplified form.To retrieve the full transaction code and decode it, we will use two commands: getrawtransaction and decoderawtransaction.First, getrawtransaction takes the transaction hash (txid) as a parameter and returns the full transaction as a "raw" hex string, exactly as it exists on the bitcoin network: To decode this hex string, use the decoderawtransaction command.Copy and paste the hex as the first parameter of decoderawtransaction to get the full contents interpreted as a JSON data structure (for formatting reasons the hex string is shortened in the following example): The transaction decode shows all the components of this transaction, including the transaction inputs and outputs.In this case we see that the transaction that credited our new address with 50 millibits used one input and generated two outputs.The input to this transaction was the output from a previously confirmed transaction (shown as the vin txid starting with d3c7).
The two outputs correspond to the 50 millibit credit and an output with change back to the sender.We can further explore the blockchain by examining the previous transaction referenced by its txid in this transaction using the same commands (e.g., gettransaction).Jumping from transaction to transaction we can follow a chain of transactions back as the coins are transmitted from owner address to owner address.Once the transaction we received has been confirmed by inclusion in a block, the gettransaction command will return additional information, showing the block hash (identifier) in which the transaction was included: Here, we see the new information in the entries blockhash (the hash of the block in which the transaction was included), and blockindex with value 18 (indicating that our transaction was the 18th transaction in that block).Exploring Blocks Commands: getblock, getblockhash Now that we know which block our transaction was included in, we can query that block.
We use the getblock command with the block hash as the parameter: The block contains 367 transactions and as you can see, the 18th transaction listed (9ca8f9…) is the txid of the one crediting 50 millibits to our address.The height entry tells us this is the 286384th block in the blockchain.We can also retrieve a block by its block height using the getblockhash command, which takes the block height as the parameter and returns the block hash for that block: Here, we retrieve the block hash of the "genesis block," the first block mined by Satoshi Nakamoto, at height zero.Retrieving this block shows: The getblock, getblockhash, and gettransaction commands can be used to explore the blockchain database, programmatically.Creating, Signing, and Submitting Transactions Based on Commands: listunspent, gettxout, createrawtransaction, decoderawtransaction, signrawtransaction, sendrawtransaction Bitcoin’s transactions are based on the concept of spending "outputs," which are the result of previous transactions, to create a transaction chain that transfers ownership from address to address.
Our wallet has now received a transaction that assigned one such output to our address.Once this is confirmed, we can spend that output.First, we use the listunspent command to show all the unspent confirmed outputs in our wallet: We see that the transaction 9ca8f9… created an output (with vout index 0) assigned to the address 1hvzSo… for the amount of 50 millibits, which at this point has received seven confirmations.Transactions use previously created outputs as their inputs by referring to them by the previous txid and vout index.We will now create a transaction that will spend the 0th vout of the txid 9ca8f9… as its input and assign it to a new output that sends value to a new address.First, let’s look at the specific output in more detail.We use gettxout to get the details of this unspent output.Transaction outputs are always referenced by txid and vout, and these are the parameters we pass to gettxout: What we see here is the output that assigned 50 millibits to our address 1hvz….
To spend this output we will create a new transaction.First, let’s make an address to which we will send the money: We will send 25 millibits to the new address 1LnfTn… we just created in our wallet.In our new transaction, we will spend the 50 millibit output and send 25 millibits to this new address.Because we have to spend the whole output from the previous transaction, we must also generate some change.We will generate change back to the 1hvz… address, sending the change back to the address from which the value originated.Finally, we will also have to pay a fee for this transaction.To pay the fee, we will reduce the change output by 0.5 millibits, and return 24.5 millibits in change.The difference between the sum of the new outputs (25 mBTC + 24.5 mBTC = 49.5 mBTC) and the input (50 mBTC) will be collected as a transaction fee by the miners.We use createrawtransaction to create this transaction.As parameters to createrawtransaction we provide the transaction input (the 50 millibit unspent output from our confirmed transaction) and the two transaction outputs (money sent to the new address and change sent back to the previous address): The createrawtransaction command produces a raw hex string that encodes the transaction details we supplied.
Let’s confirm everything is correct by decoding this raw string using the decoderawtransaction command: That looks correct!Our new transaction "consumes" the unspent output from our confirmed transaction and then spends it in two outputs, one for 25 millibits to our new address and one for 24.5 millibits as change back to the original address.The difference of 0.5 millibits represents the transaction fee and will be credited to the miner who finds the block that includes our transaction.As you might notice, the transaction contains an empty scriptSig because we haven’t signed it yet.Without a signature, this transaction is meaningless; we haven’t yet proven that we own the address from which the unspent output is sourced.By signing, we remove the lock on the output and prove that we own this output and can spend it.We use the signrawtransaction command to sign the transaction.It takes the raw transaction hex string as the parameter: An encrypted wallet must be unlocked before a transaction is signed because signing requires access to the secret keys in the wallet.
The signrawtransaction command returns another hex-encoded raw transaction.We decode it to see what changed, with decoderawtransaction: Now, the inputs used in the transaction contain a scriptSig, which is a digital signature proving ownership of address 1hvz… and removing the lock on the output so that it can be spent.The signature makes this transaction verifiable by any node in the bitcoin network.Now it’s time to submit the newly created transaction to the network.We do that with the command sendrawtransaction, which takes the raw hex string produced by signrawtransaction.This is the same string we just decoded: The command sendrawtransaction returns a transaction hash (txid) as it submits the transaction on the network.We can now query that transaction ID with gettransaction: {"amount" : 0.00000000,"fee" : -0.00050000,"confirmations" : 0,"txid" : "ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346","time" : 1392666702,"timereceived" : 1392666702,"details" : [{"account" : "","address" : "1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb","category" : "send","amount" : -0.02500000,"fee" : -0.00050000},{"account" : "","address" : "1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL","category" : "send","amount" : -0.02450000,"fee" : -0.00050000},{"account" : "","address" : "1LnfTndy3qzXGN19Jwscj1T8LR3MVe3JDb","category" : "receive","amount" : 0.02500000},{"account" : "","address" : "1hvzSofGwT8cjb8JU7nBsCSfEVQX5u9CL","category" : "receive","amount" : 0.02450000}] } As before, we can also examine this in more detail using the getrawtransaction and decodetransaction commands.