Transaction fees and transactions with bitcoin-cli. Wallet address balance negative I'm trying to make a bitcoin website and I tried to implement a sort of 'withdraw' button which would allow you to send your money in the wallet address to some other address. The problem I am facing is that post-transaction it is taking making the address balance negative.
This is the setup:

There is bitcoind running in the background so I have one wallet on the server. It has a default account name of "" (empty string) with some address.
I generate a new address for each user in the wallet. Let's say each user gets his/her own account named "user_1", "user_2", etc. I generate addresses by basically doing bitcoin-cli getaccountaddress user_1.
Users can deposit/withdraw money to/from this address.
If I withdraw too much money from this address it'll make the address balance negative and I presume it is also taking out coins from the master account, i.e. the "" account.

For the transfers I am using the following command bitcoin-cli sendfrom user_1 <some_other_bitcoin_address> <amount> <min_confirmations> <comment> <comment_to>. If I truly pick more money than is available in the wallet then it'll error and tell me that I don't have enough balance. But in a certain edge case it goes through and make the address balance negative.
I figure that there are two approaches to this solution:

Option 1: Calculate the precise transaction fee and based on that fee make a check.
Option 2: Use bitcoin-cli move "" "user_1" <amount_that_is_negative> so it seems that the balance it not actually negative and that the site owner has decided to pay for the excess fee.

So basically, I need to solve the negative address balance problem and could also some clarification on the following:

How to do #1? i.e. How to calculate the size of the transaction (in bytes) + transaction fee in advance?
Using bitcoin-cli settxfee <amount> seems to return true but the actual transaction fee that is applied to me was much higher. Why was this the case?
I need to know more details about how the move command works. Is move an actual transaction that will incur transaction fees?
Is option 2 a good option to hide/solve my problem?
What are other options / correct implementation for implementing a withdraw button?
Can sendfrom take out money from other accounts other than the "" account?

Thanks!

How to do #1? i.e. How to calculate the size of the transaction (in bytes) + transaction fee in advance?

You can use the recently-introduced fundrawtransaction RPC:

First create a transaction with just the outputs you want but no inputs, using createrawtransaction.
Then call fundrawtransaction on it (which will compute fee, and add inputs and change).
Observe the fee, and do balance checks for your user.
If acceptable, sign the transaction (using signrawtransaction) and broadcast it (using sendrawtransaction).

  Using bitcoin-cli settxfee  seems to return true but the actual transaction fee that is applied to me was much higher. Why was this the case?

settxfee sets the fee per 1000 bytes, not the total. If your transaction ends up being larger than 1000 bytes, the fee will be higher.

  I need to know more details about how the move command works. Is move an actual transaction that will incur transaction fees?

Read up on how the account system works. There is no transaction involved, as account balances are simply local bean counters. All coins in your wallet are shared across all accounts. Account balances just keep track how much of them belong to whom (but not which specific coins belong to whom). Move simply updates the balances without any transaction on the network.

  Is option 2 a good option to hide/solve my problem?
  What are other options / correct implementation for implementing a withdraw button?

No, because the account system is deprecated and will be removed in a future version. Reasons for this is that it is very hard to understand (as this question shows!), and makes backups nearly impossible (as the account information for sendfrom cannot be recovered from the blockchain, restoring a wallet backup will mess up your accounting).

Instead, use the fundrawtransaction mechanism described above, and implement user balances in a higher-level layer (which does for example stores the account information in a database with proper backups).

  Can sendfrom take out money from other accounts other than the "" account?

By definition, no. It creates a transaction using all coins in the entire wallet to fund it, and then subtracts the amount sent plus fee from the specified account.


Is withdrawal of BTC in cash possible on Bitcoin Wallet App So, I have installed one of the recommended wallets - https://bitcoin.org/en/wallets/mobile/android/bitcoinwallet/

But I see no option there for withdrawal, just to send and receive bitcoins.
Am I missing something?

I would like to withdraw it to a German bank account if that helps

But I see no option there for withdrawal

Because withdrawal is not the appropriate action, the money is not in a bank account. The money is already in the form of cash - digital cash.

If you want to exchange one currency (BTC) for another (EUR), use a currency exchange.


How to create both anonymity privacy and still achieve address reputation for merchants In what way can a merchant create a payment address that will gain reputation of trust (this address or some information connecting with the payment request will gain reputation over time and will be known as connected to the merchant ) but still maintain the privacy of the customers sending bitcoin to as if it acted as a new address each payment request ?

Could it be achieved with HD wallet mechanism and how ?

Could it be achieved at all ?

Stealth Address is the answer.

Adapted from CryptoNote technology by Peter Todd (I think), Stealth Address basically is a form of Diffie-Hellman key exchange that allows sender to create a one-time key pair that only receiver can derive the private key. Thus Stealth Address allows merchant to public their well-known address while prevent any payments to be link to that address.


I sent Bitcoin to an address but the recipient hasn't yet received it This is the transaction ID:
81f0babd0a3c6d9be17db45a62932679b05bac6a30df1abfb47c2eee83d9f0ff. The address is not wrong but the receiver couldn't get the payment. It has been 2 days.

The Blockchain is the only truth
At the time I wrote this, that transaction has 204 confirmations. That means it was absolutely definitely received.
If the address is correct and the recipient says they didn't "receive" it, they are wrong. Either their wallet isn't properly synchronised or they are mistaken (or lying to you)
Note that Bitcoin doesn't actually send money from wallet to wallet, it isn't a process that takes time between sending and receiving. At no point in time is money really out of one wallet and "on its way" to another wallet.
The only thing transmitted is a new block being transmitted to every node (wallets etc) in the Bitcoin world roughly every ten minutes. So long as you have the latest block, you know exactly which address has the money.

What follows is to clarify my point about the process taking no time. You should skip it unless you are interested in this detail or find it controversial.
Duration of transaction
Let's consider in a little more detail what happens when you make a typical Bitcoin payment. Note that Bitcoin is pretty complex, so I'll be simplifying. There are exotic forms of payment I won't cover (RBF, n of m, ...). My knowledge is limited but I think I can shed a little more light on this subject.
When you make a payment in your wallet, what happens is that your wallet constructs a kind of proposal for a transaction. This proposal is sent out into some nearby nodes in the Bitcoin network.
After sending that proposal, your wallet will mark the input amount as reserved for that transaction and won't let you try to spend it again. Your wallet will however know that this amount is still under your control and still as much "in your wallet" as it ever was and not yet in anyone else's wallet.
After a short time your proposed transaction will have been passed from node to node, being checked at each, and will reach some miners. Eventually a miner will incorporate your proposed transaction in a block and successfully mine that block.
Before this instant in time, the miner considers the money to be yours. After this instant in time, the miner considers the money to be the recipient's. There is no time when the miner considers the money to be in transit.
The miner transmits the new block to nearby nodes. As each node finishes checking the new block, that is the instant that particular node stops believing the money belongs to you and   starts believing the money belongs to the recipient.
The new block is passed from node to node until it reaches your wallet, At the instant in time it finishes checking that block your wallet ceases believing the money is yours and starts believing (provisionally†) that the money now belongs to the recipient.
There is no time in between. No time when your wallet believes the money is in neither wallet, in transit between wallets, sent but not yet received. None of those are really possible.
There is time during which the proposed transaction is circulating, but during that time all nodes consider the money to be yours. All nodes will accept other proposals from you for another transaction involving that money. This is because until one of those proposals gets included in a mined block, the money is still yours, still unspent.
The circulation of a proposed transaction takes time. Mining takes time. The Bitcoin network is large, so there are times when some nodes have the latest block and some don't. We say the network has not reached consensus - although each node has no doubt about whether the money is yours or the recipient's.
The change in ownership of money is instant (at each node separately) and money  is never really "in between wallets".

†Blockchain Forking
Since there are many independent miners (and mining pools), it can be that there are two or more blocks mined at about the same time competing to be accepted as the generally accepted next block. This means that sometimes a recently accepted block is discarded in favour of another block which has a greater number of subsequent blocks mined "on top of" it. This is why nodes generally wait for at least five blocks to be mined on top of the block containing your transaction (six blocks in total) before they accept the change of ownership of money as being fully confirmed.
So there is a period of time between the first block being mined and the sixth block being mined when a node might regard the change of ownership of the money as not sufficiently confirmed. This doesn't mean a node is unsure about who has the money. It doesn't mean the money is in transit. It doesn't mean the Bitcoin network can issue a second transaction to take money back out of the recipient's wallet. It just means that there is a tiny possibility the Bitcoin network might collectively decide your proposed transaction never got mined in the first place, that it never happened, nothing to see, move along. In most cases where this happens, the forgotten proposed transaction automatically gets included in some subsequent block and everything is OK and everyone forgets there was ever a hiccup.
This doesn't happen to every transaction, this is rare, it isn't really a case of money being "in transit" or "not in either wallet" or "not yet received".

Terminology and philosophical aspects
Proposed Transactions
Above I talk about proposed transactions and proposals. Those words are not generally used in the Bitcoin community. Mostly people talk about transactions, unconfirmed transactions and confirmed transactions. I wanted to use a different word to clearly distinguish a transaction which is circulating which has not yet been mined.
What is in your wallet?
The reason I put "in your wallet" inside scare-quotes the first time I mentioned it is that Bitcoin wallets don't really contain money. They contain a secret number, called a private-key, that can be used to prove you control some money (own some money). Anyone else who knows that secret number can take money "out of your wallet" from afar without any access to your wallet! Money isn't stored inside Bitcoin wallets but we go along with the charade because it is a useful shorthand that makes it easier to talk about Bitcoin. It is a useful way to explain Bitcoin to beginners even though it is misleading and unsafe.
This is weird!
Other people will feel my description of the way Bitcoin works places too much emphasis on the underlying dry technical (scary?) nature of transactions and that it is better to describe the process as if paper banknotes were taken out of your leather wallet, moved through an intermediary organisation and then placed into someone elses leather wallet. I agree this view has some utility but I worry it gives the impression that there is time in which banknotes are not in the senders wallet and not in the recipient's wallet but in the hands of some intermediary who can be asked to return them or intervene to change the outcome. Consider a literal reading of the original title of the question at the top of this page.


can not access bitcoin in an address that belongs to a discontinued wallet, although i have the 12 word phrase? I am still a Rookie regarding bitcoins and therefore apologize beforehand if I might use some words wrong.
I started a bitcoin wallet through a provider some years ago and bought some bitcoin. The wallets they provided were in the cloud and the didn't want to continue with that solution after some time so they discontinued their wallets. At that time I transferred my bitcoin to a new wallet.
This week I transferred the bitcoins back from the new wallet to the old wallet as I still had the old address written down and I thought that I could sell the bitcoin through my old provider (had forgotten about that they discontinued their wallets). I can see the public key or address which contains the bitcoin.
I have the 12 word recovery phrases for both wallets. I tried to recover my wallet with the 12 word phrase but the balance is 0. When I log on to the blockchain app i can see the old address under "imported addresses" but it says "not payable".
Is there any way to access these bitcoin on the old address or are they burnt?
I tried the steps in I have my 12 word seed from @Abdussamad, even with different import methods but unfortunately it can't see the balance.
Really appreciate your help.
br

If you have a 12 word recovery phrase for the old wallet, if the phrase is a BIP-39 recovery phrase and if you can find the derivation path, you should be able to recover control over your money using a standalone wallet that supports BIP-39 and which allows you to specify the derivation path.
You could use a list of popular derivation paths as a starting point for your own larger list and systematically work through them.
It would be easier if the original business could tell you the derivation path used in their discontinued wallet.


What does the term Mining means? People say a "block is mined". What exactly do they mean?
I know mining is related to some group of people does a lot of work and get rewarded for the power and energy they utilized during the process. But what process are they performing and why?
I read from white paper of bitcoin that they perform work like guessing the nounce number which is randomly generated number attached to the block. So, is it really necessary to attach this random number to the block containing transactions in the first place and then wasting resources in guessing it.
I didn't wanted to flood this portal with small questions like this, so I think only in one go the explanation to this thing will work.

When you hear about bitcoin "mining," you envisage coins being dug out of the ground. But bitcoin isn't physical, so why do we call it mining?

Because it's similar to gold mining in that the bitcoins exist in the protocol's design (just as the gold exists underground), but they haven't been brought out into the light yet (just as the gold hasn't yet been dug up). The bitcoin protocol stipulates that 21 million bitcoins will exist at some point. What "miners" do is bring them out into the light, a few at a time.

They get to do this as a reward for creating blocks of validated transactions and including them in the blockchain.

Nodes

Backtracking a bit, let's talk about "nodes." A node is a powerful computer that runs the bitcoin software and helps to keep bitcoin running by participating in the relay of information. Anyone can run a node, you just download the bitcoin software (free) and leave a certain port open (the drawback is that it consumes energy and storage space - the network at time of writing takes up about 145GB). Nodes spread bitcoin transactions around the network. One node will send information to a few nodes that it knows, who will relay the information to nodes that they know, etc. That way it ends up getting around the whole network pretty quickly.

Some nodes are mining nodes (usually referred to as "miners"). These group outstanding transactions into blocks and add them to the blockchain. How do they do this? By solving a complex mathematical puzzle that is part of the bitcoin program, and including the answer in the block. The puzzle that needs solving is to find a number that, when combined with the data in the block and passed through a hash function, produces a result that is within a certain range. This is much harder than it sounds.

(For trivia lovers, this number is called a "nonce", which is a concatenation of "number used once." In the case of bitcoin, the nonce is an integer between 0 and 4,294,967,296.)

Solving the puzzle

How do they find this number? By guessing at random. The hash function makes it impossible to predict what the output will be. So, miners guess the mystery number and apply the hash function to the combination of that guessed number and the data in the block. The resulting hash has to start with a pre-established number of zeroes. There's no way of knowing which number will work, because two consecutive integers will give wildly varying results. What's more, there may be several nonces that produce the desired result, or there may be none (in which case the miners keep trying, but with a different block configuration).

The first miner to get a resulting hash within the desired range announces its victory to the rest of the network. All the other miners immediately stop work on that block and start trying to figure out the mystery number for the next one. As a reward for its work, the victorious miner gets some new bitcoin.

Economics

At the time of writing, the reward is 12.5 bitcoins.
Although it's not nearly as cushy a deal as it sounds. There are a lot of mining nodes competing for that reward, and it is a question of luck and computing power (the more guessing calculations you can perform, the luckier you are).

Also, the costs of being a mining node are considerable, not only because of the powerful hardware needed (if you have a faster processor than your competitors, you have a better chance of finding the correct number before they do), but also because of the large amounts of electricity that running these processors consumes.

And, the number of bitcoins awarded as a reward for solving the puzzle will decrease. It's 12.5 now, but it halves every four years or so (the next one is expected in 2020-21). The value of bitcoin relative to cost of electricity and hardware could go up over the next few years to partially compensate this reduction, but it's not certain.

Difficulty

The difficulty of the calculation (the required number of zeroes at the beginning of the hash string) is adjusted frequently, so that it takes on average about 10 minutes to process a block.

Why 10 minutes? That is the amount of time that the bitcoin developers think is necessary for a steady and diminishing flow of new coins until the maximum number of 21 million is reached (expected some time in 2140).

creds: https://www.coindesk.com/information/how-bitcoin-mining-works/


Bitcoind, what's the command to see available funds? Bitcoind, what is the command to see how many btc is available combined in all wallets?

bitcoind getinfo

The Bitcoin daemon supports just one wallet, not multiple.


BlockChain.Info Incorrect Balance Recently my Bitcoin-Qt client started crashing on start-up (running Mac OS X 10.7.4). I was able to stop the crashing by removing the blocks directory and letting it re-download the blockchain.

However, I don't really have time to re-download the forever bloating 13GB blockchain! So I tried importing my wallet.dat file into blockchain.info. Upon doing this, my total balance is now 1BTC short.

When I inspect the transactions, nowhere did I send 1BTC from that wallet. And when checking in Bitcoin-Qt, the coin is there and verified.  Unfortunately I can't dump the private key for this coin as I get an error in Bitcoin-Qt (I think due to my blockchain being out of date). As I was hoping to then import this key manually.

Is there anyway around this? Ideally I just want to get my balance into a wallet like Multibit, so I don't have to worry about the 13GB+ blockchain! Backup my wallet safely and know that my coin is secure and safe! In a crashing Bitcoin-Qt with a forever growing blockchain I don't feel too happy at the moment.

Currently available to me I just have my encrypted wallet, and it is currently imported to blockchain.info with the incorrect balance. Any suggestions? I feel like I tip toe around a lot with Bitcoin as I don't want to accidently delete anything I shouldn't!

As long as you keep your private/public keypair, you aren't in danger of actually losing the funds.

The problem is most likely due to "missing inputs" for your current wallet. In order to spend bitcoins, your wallet must reference the inputs that gave your wallet the funds in the first place. The function of the blockchain is to keep track of these inputs from creation to their current wallet. Without the full blockchain, qt will not be able to reference inputs for spending, and thus won't show such inputs as existing in your wallet.

Download the blockchain. If you can't/won't sweep you private key into a new wallet that has access to the full blockchain. This will also serve to reset the oldest input in your new wallet.


Guidelines for creating a PHP driven web app for redeeming Bitcoin coupons I would like to issue Bitcoin coupons with a given USD value. The redeeming web app should accept the coupon pin-code and a Bitcoin address and transfer bitcoins to that address according to the current exchange rate. I'm looking for a quick / simple solution, preferably with PHP. Looking for design guidelines and any advice to help me get started.

[edit]
To be more specific:

Is there a sample code for sending coins using bitcoind / PHP ?
Is there a 3d party API providing such functionality (instead of using bitcoind)?
Do MtGox and Tradehill have APIs for transfers?
Is captcha a must?

[end edit]

I modified the open source Intersango exchange code so that it can issue and accept Bitcoin coupons.  You can view the code to see how I did it.  My code doesn't store the whole coupon code in the database, so even if a hacker gains read access to the database, they can't redeem the unclaimed coupons.

To answer your particular questions:

1) Is there a sample code for sending coins using bitcoind / PHP ?

Yes.  Here's some code that does it in a very simple way.

2) Is there a 3d party API providing such functionality (instead of using bitcoind)?

I don't know.  Maybe one of these has what you want.

3) Do MtGox and Tradehill have APIs for transfers?

Tradehill's no longer operating.  MtGox does.

4) Is captcha a must?

No.  They're annoying.  Have the code which checks the coupons take a long time to return a result, and only allow the users to check one at a time.  Then they can't brute force the coupons in reasonable time.


How long does it take to go from 51% hash power to 100% hash power? Once an attacker has acquired 51% hash power, is it possible to quickly get to 100% hash power by simply refusing to build on blocks created by other mining nodes and therefore discouraging mining entirely?

If 51% guarantees 100%, how quickly can this transition (from majority to total control) be expected to occur?

From What can an attacker with 51% of hash power do?

  Prevent some or all other generators from getting any generations

So, yes. However, it doesn't immediately give him more mining income. Once the block readjustment happens two to six weeks or so after the attack, the bitcoin network will notice that far fewer blocks were made, and the difficulty will go down.


Why should retailers prefer bitcoin over other cryptocurrencies that have shorter confirmation time? Considering that,

waiting 10 minutes for confirmation is too long in the retail world;
"zero confirmations" will become more risky once bitcoin popularity is high enough and people come up with services (automatic scripts) that try to do massive double spending,

why should retailers consider bitcoin over other cryptocurrencies that have shorter confirmation time, and therefore less potential risk?

Bitcoin is the incumbent in the space with a strong lead. It is not feasible to create faster blocks than about 60 seconds (as short block intervals create a host of other problems). 60 seconds however, is still way too long to wait at a cash register for a payment to confirm, and would be incompatible with current checkout processes.

This means:

Confirmation times cannot be short enough in another crypto currency to make waiting for confirmations feasible.
There are payment processors in Bitcoin that assume the risk of accepting zero confirmation transactions, while this is much less common in other cryptocurrencies. The risk is somewhat calculable, by assessing priority and other features of the transaction.
Retail payments is not where Bitcoin will break into mainstream, as it is the area where it has the least advantages.

So:
Right now, zero confirmation payments are possible through payment processors. Later, when "Bitcoin's popularity is high enough and people come up with services that try to do massive double spending", other services will be made use of to curb it. If and when this becomes a huge problem, e.g. multi-signature payments could be used more to change incentives.


Submitted a raw tx that was already on the blockchain, to test it. I got 'missing inputs' instead of 'already exists'. Why? In an attempt to more fully understand raw transactions etc, I went to look at tx 518c41d5e59114f6a23383afbe95f02cdd09cb50cabd8390bdd9162a890435b3 in its raw form being:

  01000000017871f56f7be2743293abb1adccf21526265e4ad793fddbc08508417293fd6b4e000000006a47304402201f3b98d55c16a1ff9e66cbdd5533fd74d18362477f50dbce357d66e1233ba469022066fd837cf7e1e030f5aab0f22fec06c7d98ee948fd8b9aba185512426079e0a201210284ca3e364bebb4cafb9fa76624927078e16a4244314f824ea8acff0ef1ba4627ffffffff0220a10700000000001976a91488d924f51033b74a895863a5fb57fd545529df7d88ac81f1d909000000001976a914db4c1f7949870fae5cdc366a45e2ea39c084547c88ac00000000

I then tried to submit that raw form, just copy and paste into my bitcoin wallet program to "sendrawtransaction" and got the error missing inputs (code -25).  This seems odd in it of itself because since this is an exact copy and paste of the raw transaction that is on the blockchain, shouldn't it not be missing anything at all?  Also, shouldn't I be getting a "transaction already exists" error instead?  Or do I not understand something about how raw transactions are submitted?

Bitcoin Core has no idea which transactions already exist in the chain. It does not maintain a full index, because... it doesn't need to. In fact, when running in pruning mode, it doesn't even have the chain or its transactions at all.

The only thing it has is the set of unspent transaction outputs. Since you're trying to replay an existing transaction, all the inputs are already spent by its previous instance. As a result, the expected and correct response is that inputs are missing - i.e. your transaction is a double spend, and thus invalid.

I'd say that this is one of the advantages of the UTXO model: a replay and a double spend are one and the same, and there is no need to distinguish.


Offline wallet (Electrum) + Trezor not signing transactions When I want to make a transaction I follow these steps

Create order in the ONLINE computer
Copy transaction to a USB
Plug USB to OFFLINE computer
Load transaction from file
Plug TREZOR
Sign transaction

But during the signing process an error popups with a message similar to "Unable to connect to servers ". In my opinion it makes no sense, it is supposed to be an offline wallet. There is no need of a server to sign the transaction. ¿Am I wrong?

As far as i know, both computers use the same Electrum version (2.8.3)

Well, yes, sortof.  Signing a transaction requires the scriptPubKey from the transactions that funded the source addresses, and if you don't have a copy of the blockchain there's no way to get that information.
I believe Armory handles this by including the necessary information in the data it gives you to take offline, but Trezor apparently does not, and does not considers this use case "redundant."

that's normal. Trezor requires the list of input transactions.  your offline wallet did not have them and tried to fetch them.
we will not fix that. the list of previous tx will no longer be needed with segwit.
Electrum issue

If you wanted to work around this issue, you could modify the Electrum plugin to load the necessary info from, e.g., a text file instead of trying to use the internet.  The place you would need to change is shown in this post (.../plugins/trezor/plugin.py).


Why would I choose to use Bitcoin and not other crypto currencies like Ethereum or Dash? Why is Bitcoin better or worse than the rest? The title basically says it all, I'm a new investor looking to fill out my portfolio but I also want to know the lay for the market, what cryptos are worthwhile, and why?

I find this article convincing in its analysis of the dynamics between Bitcoin and competing networks: The Coming Demise of the Altcoins

To summarize briefly, the author suggests:

The utility provided by a currency system is related to the willingness of its users to save using that currency.
Currencies have a strong network effect.
Most altcoins don't have a significant technological advantage over Bitcoin.
Therefore, altcoins are destined to lose value in comparison to Bitcoin in the long run.

I do recommend reading the article, though.


Do I need to keep updating my wallet address in faucets? I notice that my wallet address keeps changing and I am wondering two things:

Why does the address dynamically change?
Do I need to update the wallet address in the faucets I use in order to receive the satoshis?

It will be a pain if I have to constantly update my wallet address in the faucets.

You're using a HD Wallet which specifically avoids reused addresses. You can of course reuse an address, so putting the same address into faucets is probably the only way to spend the low value input.

So, yes, reuse the address


getreceivedbyaddress without knowing the private key Not considering any external services, is there any way (opensource implementation) that would keep up with the blockchain and expose an API with the same functionality as the original getreceivedbyaddress method in bitcoind?

To emphasize, I need the API to return the sum of coins ever received on that address, NOT a current balance. Preferably, this would work without the need of registering/importing that address in advance (so the system should auto-index all addresses spotted in the blockchain).

There's an old (0.8+) fork of bitcoind (https://github.com/TOCICI/bitcoin) that adds importaddress RPC call, which is the best I could find so far (even though it's not optimal since it requires the addresses to be imported first).

Also, there's a continuing discussion going on about watch-only wallets, but I'm afraid (correct me if I'm wrong) this will only provide address balance, not the total amount ever sent.

I've also considered using Electrum server for this, but was only able to see that one can get a current balance of an address.

Any ideas?

Bitcoin Core 0.10 was just released with support for watch-only wallets.

You can use the importaddress command to make a wallet consider the address to be belonging to it, and track incoming payments to it. getreceivedbyaddress will work as expected in that case. In fact, Bitcoin Core does not support an "address balance" feature at all.

It does indeed require you to import the address in advance (or go through a lengthy rescanning procedure). The upside is that this approach scales much better (it doesn't require a fully indexed blockchain, and is compatible with future pruning features).


Paid the seller but did not receive my Bitcoin I bought my bitcoins from Remitano, the support team said it's been released but it's already 2 days I still haven't receive anything.

The following is my e-wallet : 17PvSJNcr8giYNDivs5z1CFiXYvV8Lh4NA

And the transaction is as below.

https://blockexplorer.com/tx/c0c40897b9a1c4d10c8c6ee692a7d6e4a475658fb4d8d451fd0d926ba4127a46

Can anyone tell me how can I solve this?

Checking the 17PvS.. address, there are a number of transactions in and out. It is perhaps worth mentioning that by design, bitcoin addresses should be used just once, to help protect your financial privacy.

The transaction ID you linked is for a transaction that has been confirmed, if the funds are not appearing in your wallet then I would guess that either your wallet is out of sync with the network, or someone has hacked your wallet and stolen the coins. Considering the 17PvS.. has outgoing transactions after the transaction you linked, I fear the latter may be the case for you.

(Also, for what its worth, I would not use blockexplorer.com. They have decided to refer to bitcoin cash as bitcoin, which makes using their site very confusing. In my answer I assume you are using bitcoin, and not bitcoin cash)


how can i do mining on vmware machine I am new to bitcoin mining.

i have gui-miner, setup a slash mining account, and i have a VM Ware machine setup for mining.

i have my own reasons for using a VM Machine and not my own...

now whenever i open guiminer and click on start mining(given all valid fields and having setup mining worker as well), the miner says that nothing to mine on, exiting.

i do not have any OpenCL or any graphics card as it is a VM Machine.

can anyone help me on this...

Currently, all mining software have GPU and CPU mining disabled by default. You're going to need to recompile from source and enable CPU/GPU mining to be able to mine with your CPU/GPU. You should be warned that this is not profitable in any way, shape, or form and that even on testnet, your CPU won't likely find a block for many hours.

That said, if you're determined to do it, get the source for bfgminer here: https://github.com/luke-jr/bfgminer

Compile with the --enable-cpumining flag and you should have a binary that lets you use the CPU.


Why doesn't each node store only a portion of the blockchain? Why doesn't each node only store a portion of the blokchain instead of the entire blockchain? Is it possible and why is it possible or impossible?

Your question is vague, but I assume your real question is why every node must store the full blockchain.

The answer to that is that they don't. In fact, nodes can choose to not store any part of the blockchain at all. The blocks are only needed when validating history, to build up the state of the global ledger (the "UTXO set").

Nodes that do store the full chain advertize so on the network, so that new nodes that join can fetch history from them. However, they themselves do not need the chain at all after validating it, and since Bitcoin Core 0.11, it is in fact possible to configure your node to throw away older parts of the chain to reduce disk space.

To summarize: the only data that every fully validating network node needs is its own validated copy of the UTXO set.

Given that information, maybe your question becomes: why isn't the UTXO set stored in a distributed fashion?

The answer to that is more complicated:

Trust model we cannot trust other nodes to store the UTXO set for us. The reason we went through the entire blockchain to build up the UTXO set is because the blockchain is auditable while the UTXO set is not. It allows us to check whether the entirety of history is valid. If we go outsource the UTXO set, and rely on other nodes to keep part of it, they could modify it to their advantage (for example, to make us believe they have more money than they do).
Performance Access to the UTXO set must be very fast. Faster nodes often are configured to keep large portions of it in RAM rather than on disk. The reason for that is that it directly influences the time we need to verify new blocks that are being broadcast. Delays in verification cause blocks to propagate slower across the network, which results in more stale blocks, and indirectly an advantage for a 51% attacker.


creating OP_RETURN script on bitcoin core console. i.e. with the help of commands I want to create a OP_RETURN script on bitcoin core console. Not using GUI, i.e. available on proofofexistence.com , Just as we create raw transaction and then sign it and then broadcast it, I am curious about how to create OP_RETURN script. Anyone here can give reference or want to share their knowledge? Step by step explanation would be much appreciated.

createrawtransaction has an option for data. That will create an OP_RETURN output with whatever hex-encoded data you want in it. So you would have a createrawtransaction command that looks something like this:

createrawtransaction '[]' '{"data":"deadbeef"}'


How to manually verify a signature given scriptSig and scriptPubKey? First transaction

Given a transaction on the blockchain:
3a1b9e330d32fef1ee42f8e86420d2be978bbe0dc5862f17da9027cf9e11f8c4

One of the outputs transfers 424,242.42424242 BTC to 1eHhgW6vquBYhwMPhQ668HPjxTtpvZGPC

scriptPubKey:

OP_DUP OP_HASH160 070d550bc5bc843149410b8863b5b72857d91439 OP_EQUALVERIFY OP_CHECKSIG

Second transaction

And the input to spend that output is in this transaction: 7a2a6f66e87ed4e72d85ba7a82eda1572605c3330c461e171f58d7ff2763ac63

scriptSig:

30450221009c45573098c41e5ebd1e41fea5f6d0f96c7833a631c7ae890de328ca7e643a79022037cb1736d6aeeed517b234a16d731072cddf1917947dab25776a0f6dff9d741f01
041b4c38a55f7d3de915a0732c2237e13349c17250c05b4803e147fcee08ebad75fa76cfcde6aa5f45cde1201f63920c3625c6cba17c42ce052c07cdea0607f488

Question

How does one go about manually verifying the signature with ECDSA given the signature, public key, and the two transactions?

My naive attempt using pybitcointools:

>>> from bitcoin import *
>>> public_key = '041b4c38a55f7d3de915a0732c2237e13349c17250c05b4803e147fcee08ebad75fa76cfcde6aa5f45cde1201f63920c3625c6cba17c42ce052c07cdea0607f488'
>>> sig = '30450221009c45573098c41e5ebd1e41fea5f6d0f96c7833a631c7ae890de328ca7e643a79022037cb1736d6aeeed517b234a16d731072cddf1917947dab25776a0f6dff9d741f01'
>>> tx = '7a2a6f66e87ed4e72d85ba7a82eda1572605c3330c461e171f58d7ff2763ac63'
>>> print ecdsa_verify(tx, sig, public_key)
False

It might be that I have to go through this diagram to construct the "message" to use in verification: https://dl.dropboxusercontent.com/u/1139081/BitcoinImg/OpCheckSigDiagram.png

Thanks in advance for any help on this!

Remember that 'scriptPubKey' and 'scriptSig' are scripts.  They are intended to be executed by an interpreter.  The reason your naive attempt didn't work, is because these values are not simple numbers, but are executable lines of code.

What happens, is that scriptSig is executed first, leaving values on the stack.  Then scriptPubKey is executed to check if the values left by scriptSig are valid.  Because scriptPubKey is the script specified by the output being spent, it encumbers the bitcoins, and is also called the encumbrance script.  So whoever last spent the bitcoins, gets to decide the terms by which the bitcoins are encumbered.  Usually it says something like "pay this output to whosoever has the private key that matches this public key"...but it doesn't have to.  This is how the system can handle multisig transaction, storing data, smart contracts, and multiple types of payments.  It's actually fairly complicated, which is why there is a programming language used rather than static keys and signatures.

Unfortunately, the best reference on how this code executes would be the interpreter.cpp file of the reference client (Bitcoin Core).  I know that's probably not the answer you were looking for, but this is really at the heart of what makes Bitcoin so flexible.


Wallet programming, search transactions by address This may be a silly question, but I keep running in circles. Using either bitcoind or JSON-RPC is there a way to search all transactions involving a address hash? I understand every wallet and most block explorer websites have this feature, but is it a native one I'm overlooking, or does everybody keep a separately indexed database off the blockchain?

I assume from the research I've done its #2, but given the size, history and Speed at which the blockchain updates building this database seems like it would take longer then actually downloading the blockchain.

Can someone please stear me in the correct direction so I'm not wasting the next 6 years rebuilding the wheel?

Thanks in advance for the assistance.

You do need to keep a separately indexed database of the blockchain,

insight.is is a good place to start,

bitcoind would have to do an extensive rescan to answer that query.


json-rpc and p2p port protocol type What type of port protocol do json-rpc and p2p use? does it use TCP or UDP?

If possible, can you config or reprogram the open-source and compile the source to use TCP only if it also uses UDP?

What type of port protocol do json-rpc and p2p use? does it use TCP or UDP?

Both use TCP.

  If possible, can you config or reprogram the open-source and compile the source to use TCP only if it also uses UDP?

Certainly. It's open source, you can change whatever you want.


What has a lower long term cost per hash: LTC, BTC or other alt coin? I'm trying to understand the cost per hash operation with Litecoin vs Bitcoin over time.  The theory is that the network that has the best prospects for long-term security (via hashing) will set a standard that may influence its own price.

Specifically I'd like to compare

Capital outlays (reasonable mining hardware ASIC vs GPU)
OPEX (Electrical, etc)

Suppose I were to compare BTC/Litecoin mining to ore mining.  Once the ore is extracted and purified, no more cost is needed other than to secure the facility where the gold is stored.

Its clear the mining process is technology dependent (ASIC vs GPU).  What isn't clear to me is once the technology matures, what approach has a greater chance for long term efficiency for maintaining and securing the network.

I suspect that the scrypt -vs- sha256 implementations will have different power requirements, and I'd like to understand which one is "greener" for the environment in the long haul.

Any information relating to

Cost of current mining rigs to power efficiency
Cost of future mining rigs and projected efficiency

Would be very interesting.

One of scrypt design goals was to make CPU and GPU performance balanced, which meant that it was far more dependent on memory speed.

The GPU had a solid work around and as far as I know CPUs don't have any advantage.

But that did cause it basically impossible to do scrypt mining with an ASIC unless it has a ton of memory and memory channels added in, which is a huge design problem.  Unlikely unless GPU mining for scrypt is very profitable.

This also makes Scrypt far more energy intensive for the same amount of useful hashing, but the network adapts as it requires far less hashes to solve problems (Difficulty number)

Which is greener? By far ASIC mining, it's power usage is tiny compared to performance, 4500MH for 4.5w vs 275MH for 100w.

But again, the network balances.


What is the block maturation time? I was reading the wiki article about the blockchain and I didn't understand the part in bold:

  When a block becomes an orphan block, all of its valid transactions
  are re-added to the pool of queued transactions and will be included
  in another block. The 50 BTC reward for the orphan block will be lost,
  which is why a  network-enforced 100-block maturation time for
  generations exists.

I don't know the details behind block creation and acceptance, so how does the block maturation time work? Is the block only accepted after a while?

Generated coins can't be spent until the generation transaction has 101 confirmations. Transactions that try to spend generated coins before this will be rejected.

The reason for this is that sometimes the block chain forks, blocks that were valid become invalid, and the mining reward in those blocks is lost. That's just an unavoidable part of how Bitcoin works, and it can sometimes happen even when there is no one attacking the network. If there was no maturation time, then whenever a fork happened, everyone who received coins that were generated on an unlucky fork (possibly through many intermediaries) would have their coins disappear, even without any sort of double-spend or other attack. On long forks, thousands of people could find coins disappearing from their wallets, even though there is no one actually attacking them and they had no reason to be suspicious of the money they were receiving. For example, without a maturation time, a miner might deposit 25 BTC into an EWallet, and if I withdraw money from a completely unrelated account on the same EWallet, my withdrawn money might just disappear if there is a fork and I'm unlucky enough to withdraw coins that have been "tainted" by the miner's now-invalid coins. Due to the way this sort of taint tends to "infect" transactions, far more than 25 BTC per block would be affected. Each invalidated block could cause transactions collectively worth hundreds of bitcoins to be reversed. The maturation time makes it impossible for anyone to lose coins by accident like this as long as a fork doesn't last longer than 100 blocks. If a fork does last longer than 100 blocks, then the damage caused by invalidated transactions would likely be a huge disaster. (However, something else would have to be seriously wrong with Bitcoin or the Internet for a fork to last this long.)


How does Coinmarketcap calculate volume? Does Coinmarketcap read all  trade history from the APIs of all exchanges and sums them up to calculate overall 24h volume? Or Does it retrieve it directly from specific coin's api?

It connects to the api of the exchange and returns the traded volume.

The volume of the exchange is the sum of all coin's volume in that exchange that is returned from the exchange API.

The volume of the coin is the sum of that coin's traded volume that is returned from all exchange's api.


Multisig created from Multisig address Can a multisig address creation process use other multisig addresses as signers to result in a new multisig address

Would this also result in a greater number of signers to be necessary to approve a result/transaction?

No.  A "multisig address" is really a hash of a redeem script encoded as a P2SH address.  Redeem scripts can't be nested, which means you can't include one redeem script inside another redeem script, so it is impossible to implement the feature you describe under current Bitcoin consensus rules.


Why are all testnet transactions currently unconfirmed and all faucets empty? what is happening with btc testnet, all transactions are unconfirmed and all faucets are empty?

For an example that is on of my transactions:
https://live.blockcypher.com/btc-testnet/tx/d32652489a8131657ad05fba8a57bb075e16b20567c824ad67ded067f6b350c4/

Last time I checked there were about 10x as many transactions in mempool as fit in a block. This means it can take easily about 3 hours for a particular transaction to confirm, on average. Strangely, increasing the miner fee does not seem to help the situation.

Unfortunately, the only faucet that ever worked for me (https://testnet.manu.backend.hamburg/faucet) is now down for maintenance, but there is no indication that it is "empty".


Setting up BAMT root access The official BAMT faq says "never use sudo. never never, always log in as root. [emphasis in original]". Is this a BAMT-specific issue, a more general issue with sudo that I should ask about on Super User or Server Fault, or what? I can't find any general complaints warranting this strong a reaction, and I can't find anything BAMT specific. Why, in an application where security is usually important, should I never use a tool which is designed to enhance security and which I've never heard this complaint about before?

In the absence of a reason, I'm going to assume it's specific to their distro, and they meant "we only created (and always use) the root account, so our documentation assumes you are logged in as root. We haven't tested for odd corner cases that arise because of subtle differences in the way sudo works".

sudo is considered more secure than logging in as root for a number of reasons. It should always be used on mainstream distros.

But for a tiny USB stick distro (with no ability to login as root over the network), the security benefits of sudo may not be worth the complexity.


Send Bitcoin payments to any bank via API I am looking into paying our overseas suppliers via bitcoin to speed up the process of settling invoices. The issue is that I don't want them to have to deal with bitcoin themselves.

My question is - is there an API available that I can use to build my app that will allow me to deposit BTC to any bank account number that I choose?

Thanks!

The closest solution to this is setting up your supplier with a payments processor like Coinbase or Bitpay, who will convert your BTC to fiat instantly. However, there's no way to send BTC to a bank account directly without some action by the other party.


API for montly and weekly averages Bitcoinwisdom shows in their charts lines for weekly and montly averages. Are these numbers somewhere available in an API? If so, one could setup an automated strategy for trading BTC based on this data.

I have not heard about an API that would return averages per se. But there are APIs that will provide you with a historical price data which you can use to calculate averages on your own.

One example would be CoinDesk, but I am pretty sure there are more. They have a JSON endpoint that will return closing prices for a given period (1 month by default). Examples:

Default (one months period): https://api.coindesk.com/v1/bpi/historical/close.json

Custom date range: https://api.coindesk.com/v1/bpi/historical/close.json?start=2018-01-01&end=2018-07-01


Create OP_RETURN tx with Bitcoinjs-lib I know how to create a basic TX:

var bitcoin = require('bitcoinjs-lib')

var tx = new bitcoin.Transaction()

// Add the input (who is paying) of the form [previous transaction hash, index of the output to use]
tx.addInput("aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31", 0)

// Add the output (who to pay to) of the form [payee's address, amount in satoshis]
tx.addOutput("THEADDRESS", 15000)

// Initialize a private key using WIF
key = bitcoin.ECKey.fromWIF("L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy")

// Sign the first input with the new key
tx.sign(0, key)

// Print transaction serialized as hex
console.log(tx.toHex())
// => 0100000001313eb630b128102b60241ca895f1d0ffca2170d5a0990e094f2182c102ab94aa000000008a47304402200169f1f844936dc60df54e812345f5dd3e6681fea52e33c25154ad9cc23a330402204381ed8e73d74a95b15f312f33d5a0072c7a12dd6c3294df6e8efbe4aff27426014104e75628573696aed32d7656fb35e9c71ea08eb6492837e13d2662b9a36821d0fff992692fd14d74fdec20fae29128ba12653249cbeef521fc5eba84dde0689f27ffffffff01983a0000000000001976a914ad618cf4333b3b248f9744e8e81db2964d0ae39788ac00000000

// You could now push the transaction onto the Bitcoin network manually (see https://blockchain.info/pushtx)

But I didn't find out how I could create a OP_RETURN transaction with bitcoinjs-lib in Node.js. Does anyone know?

Here:

var bitcoin = require('bitcoinjs-lib')

data = new Buffer("Melons.")

var tx = new bitcoin.TransactionBuilder()
tx.addInput("aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31", 0)
tx.addOutput("some address", 15000)
ret = bitcoin.script.compile(
  [
    bitcoin.opcodes.OP_RETURN,
    data
  ])
tx.addOutput(ret, 0)
key = bitcoin.ECPair.fromWIF("L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy")
tx.sign(0, key)
console.log(tx.build().toHex())

That should do it.

Also, if you have more than 40 bytes of data, your transaction will be non-standard.


Where does the money i am receiving come from? Say i was to have 100,000 dollars worth of bitcoin in my wallet and i want to cash out, where does the money i am receiving come from? Is it taken out of the volume amount of dollars currently in circulation or can you only get paid out if someone is willing to buy it?

You would need to find someone to buy the bitcoins from you. Simple as that!

You can do this in person (probably with someone you trust if its $100k!), or through an online exchange (a service that matches up buyers and sellers).


How can I accelerate confirmations in ledger nano s? I am using Ledger Nano S hardware wallet to store my bitcoins. Last week, for an experiment, I decided to send bitcoins to hitbtc currency exchange with zero btc fees. I was wondering how many hours will it take to transaction to be completed, but it turns out that transaction will never be completed with zero fee. I try to accelerate the procedure with ledger nano s option, but it failed many times as well. I am looking at my balance in blockchainfo, it looks like I have all the coins in my wallet, is not sent anywhere, but I cannot see the same balance in my ledger wallet. So does anyone know how can I access to my bitcoins? Thanks.

Screenshots

There are a few services that can accelerate Bitcoin transactions. According to the Bitcoin wiki, PushTx seems to be reliable.


How can other currencies be "issued" via Bitcoin? I've heard a few prominent bitcoiners (Andreeseen, ppl from BitPay) say that currencies such as US Dollars can be "issued" over the bitcoin network. I'm not exactly sure how this is possible, and I don't think this has to do with the exchange rate necessarily. Can someone explain?

If you are quoting correctly, he is 100% incorrect, and he should've consulted an old white man first.

"Issuance" as defined by economics and more importantly by law is the creation of a liability by the liable.  The Bitcoin blockchain is not liable for Federal Reserve debts, in this case US Dollar banknotes; further, the Bitcoin blockchain has no power to create a liability owed by the Federal Reserve; therefore, the Bitcoin blockchain has no power to issue US Dollars.

Now, if it's a slight misquote, that the Federal Reserve could issue USD via a cryptocurrency implementation, that is 100% correct and would be a superior depository management system.  Of course, the Bitcoin code would have to be altered and centralized to provide this functionality, but the point remains.

It would be superior for central banks to manage deposits with cryptocurrency implementations because the accounting can be made 100% accurate, and the security is bulletproof until the digital signature algorithm is broken.  Costs would plummet, but gov't agencies rarely are concerned with cost...nor revenue for that matter.


Two weeks have past, still nothing on my transactions Two weeks have past, still nothing, can anybody advise? tried the zap wallet thing, and its just removed the transactions, so theres nothing in my wallet on my mac. the only thing i have to go on is the bitcoin link:

https://blockchain.info/tx/44c784d8f82d962103ffdf5d463a1460150a21cc67a0750d4a3f6a35a0d18d9a?show_adv=true

Since you already tried "-zapwallettxes", your client is now no longer broadcasting this transaction.
You have four choices(I listed them after difficulty):

1. Wait until it gets dropped from mempool or picked up by a miner.

2. Ask miners for help.
Since you are in urgent need: bitcointalk.org have plenty of members providing free transaction accelerator services. You can also go for the paid services, but be aware don't fall for the scammy ones.

3. Attempting a Replace-By-Fee (RBF) double spend transaction.

4. Attempt a Child-Pays-For-Parent transaction if you are also the recipient of this transaction.


i lost access to my bitcoin I did not have any idea about bitcoin but I wanted to get in, I met this guy who knew about it on facebook asked him if he could help. he sent me the link on blockchain to signup showed me how to buy coin from a merchant, I did as he said. everything was on going, later told me to give him my id and password so he can connect to a miner i asked y he said to make it possible to profit. so i did, which was my biggest mistake but i did not know then. my blockchain was growing close to $10000 trying to withdraw was the only problem. there was always a privatekey for to go ahead but i never got it. when ever i ask him he tills me to invest more to be able to withdraw. i woke up one day and all my profit was gone also when i gain profit it shows on my phone but doesn't appear on my portfolio i knew it was my id and password i gave this guy cause me damage. he doesn't reply my messages any more.

I know i cant get the coins back if any of u can help me redeem my account to show the profit i continue to get . all my profit was $27,830 but i never got a $ out of it.....some address are also on watch with profit close to $800 i just need support so i can support my mum. am out of collage cant get on rent even meal a day i will be grateful with any help.....somethings i feel like doing something to myself all depress everyday coz i have no one to talk to.....i just need a normal life .....will be grateful for help out...thank you.

please do not go no with this guy on facebook and anywhere for help name {DESCOMM OSAS he's a nigerian but says he live in California}, he's heartless

I'm sorry to say that you were scammed. Do not ever give someone your wallet identifier, password, private keys, seed phrase, etc!

  later told me to give him my id and password so he can connect to a miner i asked y he said to make it possible to profit

This is not how mining works at all. The scammer enticed you with 'profits', but in reality there were no mining profits. The scammer simply wanted you to think there was, in an effort to get more btc out of you.

What likely happened: When the scammer logged into your wallet, they made a copy of your wallet's seed phrase. With that phrase alone they can re-create your wallet on any other device, and they will have full access to your bitcoin. Your password protects the login to blockchain.info, but if you use the seed phrase to re-create the wallet on another device using different software, the password will not be required.

The second thing the attacker did was add a 'watch-only' bitcoin address to your wallet. Your wallet shows you the balance of that bitcoin address, but your wallet does not have the private key for that address, and thus cannot spend the bitcoin located there.

Once that is set up, the scammer will send some bitcoin to the watch-only address, and tell you it is 'mining profits'. This is a lie, while you thought you were generating profits, the real story is the scammer was just slowly adding bitcoin to that address, while telling you to deposit more btc to your wallet. Once you deposited more bitcoin, the attacker could use the seed phrase to recreate your wallet, and steal your bitcoin.

Sorry for your losses :(

At this point, abandon that wallet, do not ever use it to store bitcoin again. Create a new wallet, and be sure to guard it carefully.


Where do mined bitcoins go? I am running a bitcoin node with the following bitcoind.conf

# bitcoind.conf
bind=127.0.0.1

# use minimum disk space
prune=550

# Pare down traffic to bare minimum
blocksonly=1
maxconnections=20
maxuploadtarget=150

# Use only tor
proxy=127.0.0.1:9050
listenonion=1
onlynet=onion

torcontrol=127.0.0.1:9051
torpassword=Not_Posting_Here
##############################
addnode=gyn2vguc35viks2b.onion
addnode=kvd44sw7skb5folw.onion
addnode=nkf5e6b7pl4jfd4a.onion
# more onion nodes elided

I have pared down the disk usage and bandwidth as much as possible.  I want to run a node that will allow me to spend coins anonymously - small purchases like 4chan passes etc.  Not too concerned with being robbed as my wallet would never have more than 50 dollars worth in it but want to be able to spend anonymously.

It's in the process of downloading enough of the blockchain to be ready to spend now ( I think - not too much traffic over tor according to nyx ) and I tail the debug log and see this sort of thing:

6b756b2d2cb7db97f39c7bd2 height=14835 version=0x00000001 log2_work=45.75637 tx=13952 date='2009-05-09 05:00:57' progress=0.000044 cache=3.0MiB(15823txo)
2018-04-17 13:11:31 UpdateTip: new best=00000000349ad71b516db92e4799a7bad2dc8976ca6b3cd2d894167011d51b92 height=13836 version=0x00000001 log2_work=45.756474 tx=17956 date='2009-05-09 05:44:46' progress=0.000044 cache=3.0MiB(14829txo)

and it keeps spitting these out

bitcoind is using like 1-3% of cpu according to top.

Is bitcoind  mining?  I don't want it to mine.

Is there a way to shut this off?

Also if it is mining, and if I can't stop it from mining, where would coins I'd mine go?  I search for this, but it says the miner gets them. BUT WHERE?  If I am the miner, how does bitcoind know what my bitcoin address is?

I have not created any addresses in my wallet. So where would the coins go?

The mining question is moot if I can find a way to shut off mining anyway.

I have run a node once and deposited some coins in the wallet, and then later spent them.  But I want to do this all over tor without hogging all my bandwidth or disk space.

Bitcoin Core no longer contains any mining code, so it's definitely not mining.  (If it were, you'd see 100% CPU usage.)  Mining has nothing to do with the behavior you are seeing.

You're downloading the entire block chain (150+ GB) and checking it for validity, which explains the CPU usage.   The UpdateTip message simply records that you've received a new block, and you've checked it and determined that it is a valid addition to the blockchain.  This is normal behavior for Bitcoin Core or any other full node, and is inherent to its operation.

I see you have enabled pruning, so that will save disk space.  It won't save bandwidth or CPU though.  If you don't want to use that much bandwidth, don't use Bitcoin Core.  There are other "thin" wallet clients that don't need to download the entire blockchain - the tradeoff is that you have to trust other nodes to tell you that transactions are valid, instead of being able to check it for yourself.


What's the difference between 12 word seed and 24 word seed? Why was the format switched to 24 words for some newer wallets?

The English-language wordlist for the BIP39 standard has 2048 words, so if the phrase contained only 12 random words, the number of possible combinations would be 2048^12 = 2^132, and the phrase would have 132 bits of security. However, some of the data in a BIP39 phrase is not random, so the actual security of a 12-word BIP39 mnemonic phrase is only 128 bits. This is approximately the same strength as all Bitcoin private keys, so most experts consider it to be sufficiently secure.


What happens if I send bitcoins to my private key instead of my actual bitcoin address? I recently used the website https://www.bitbrothersllc.com/Bitbrothersllc/Welcome.html to obtain my bitcoins, but when I was asked what address to send my coins to, I accidentally put down my wallet's private key, not my bitcoin address.

I'm wondering if the coins are lost forever now, or if they will still appear in my wallet because the private key is attached to my address.  I'm really hoping they are not lost forever, and I would greatly appreciate any assistance anyone could provide.

A private key can be encoded in a number of different formats:

51 characters base58, starts with a '5'
(for example: 5JrnhhNpRNsC6xPUhLfc4yJEviuRxMcvpcB4pc1opgHTSVi64aP)
64 characters [0-9A-F] hexadecimal format,
for example: 89609C6B52AE0061FB8FFE3AF83528AC24AC637A386FE61D2822128ABE80162F
44 characters base64,
for example: iWCca1KuAGH7j/46+DUorCSsY3o4b+YdKCISir6AFi8=
52 characters base58, WIF Compressed, starts with a 'K' or 'L',
for example: L1pkidDJJbWY1HUDF3oPnXV6U7xR9L1aZ8FRs7YZfSPdh5NPzRB5

A bitcoin address, which is a hash of the public key, is 25-34 characters, typically 34 characters,
for example: 1A5QMFw4vXVwLF1zZMSvAYJStuVMcjSqAa

Maybe a bitcoin address could be encoded in some other format, but 25-34 characters of base58 is the standard.

I don't know what kind of validations are in place at bitbrothersllc, but they should easily be able to see that you entered 51, 64, 44, or 52 characters instead of the 25-34 characters that would make up a valid bitcoin address.

Contact them.  If they are legit, you'll get your funds back.  Good luck!


added security/safety to multiple blockchain.info wallets If I want to store a substantial number of Bitcoins, would there be any add security or safety to doing this in multiple blockchain.info hybrid ewallets, in stead of all in one?

For large numbers of coins, software wallets (online or desktop), no matter how well designed, are not safe. Online clients aren't safe because the ones that are encrypted your side (like blockchain) might somewhat be susceptible to man-in-the-middle attacks. As Lohoris mentioned, Blockchain uses js verification with Github, requiring both websites to be compromised - of which there is a slim chance. Standard desktop clients are inherently not safe either, not when you're storing thousands of $/£ in coins. Even with all the safeguards in place, the absolute safest storage method is to keep the keys offline.

You would be much better off generating a large number of keys using an offline computer and storing them on encrypted flash drives in safe locations. This is what the biggest known BTC hoarders (Winklevoss) do.

You can then add the addresses without the keys to Blockchain for easy monitoring and zero risk.


Breaking down the hex value for output 1 Within the hex generated by createrawtransaction, I am trying to understand the output 1 hex.

The output 1 hex I have is:

  76a914ab68025513c3dbd2f7b92a94e0581f5d50f654e788ac

Spacing out the sections:

  76 a9 14 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 88 ac

Breaking it down further:

  76 = OP_DUP

  a9 = OP_HASH160

  14 = ?

  ab68025513c3dbd2f7b92a94e0581f5d50f654e7 = HASH160(pubKey)

  88 = OP_EQUALVERIFY

  ac = OP_CHECKSIG

What does that 14 mean/represent?

Values from 1-75 represent a number of bytes to be pushed into the stack. I that case, 14 hex is 20 dec, and will push the 20 bytes of the hash160.


SegWit Version - is there a proposal for new versions? I can see transactions with version 0
Are there any other versions of SegWit proposed or in existence?

BIP-114 which was published a while ago comes to mind :
https://github.com/bitcoin/bips/blob/master/bip-0114.mediawiki


Why is my Coinbase transaction pending? Just bought some Bitcoin for the first time. Then I tried to transfer some of my purchase from Coinbase to my Blockchain wallet. The sent Bitcoin is pending; Blockchain isn't letting me confirm the transaction. Did I do something wrong? Is there a way to cancel the payment? Thanks!

Bitcoin is [in]famous for being slow to process. This is because of how the block-chain works. Miners have to add your transaction to the next block in order to approve it, and this doesn't happen instantly. Miners will prioritise transactions with higher transaction fees since the money is more incentive to approve it faster. Transactions can take as much as a week to process which is why Bitcoin has issues commercially since you'll buy a coffee, but the transaction might not be processed for days after. It's also why Bitcoin is often described as better for long term investment than day-trading, but it's a trade-off for the added security of the block-chain!


buying bitcoins from ebay I am brand new to bitcoin and I only know the very basics of it. I have a few questions:

As the title says I am looking in ebay to buy bitcoins and there are some sellers are selling 5 bitcoins at opening of auctions for only 1 USD is it a scam I mean at the current exchange rate from my understanding 1 coin alone is valued at 900 USD which is a total value of 4500 USD is this a scam or is this legit I only ask this since should I place a bet and win for only like 10 USD the seller must be mad to take a massive loss like that
if it isn't a scam how does the seller deposit his coins into mine do I send him my wallet address
if I have to send him my address can he hack my wallet using my address or worse send my address to other hackers

Sorry to seem like such a noob but I had just learned about bitcoin recently and like I said previously I don't know much about it basically any information I found from bitcoins's website summarizes m=the extent of my knowledge on bitcoins

Do not use Ebay to buy Bitcoins, it is against their terms and conditions are may cause problems for both you and the seller.


Transactions seen by peers, but not confirming I have an old MultiBit wallet (v. 05.16) and within the last month I have experienced delays when transferring bitcoin.  Some transfers have been seen by 2 peers and some by 6 peers, but none have gone through.

One of those transactions was f0ecb670ba640eeff7762c63c2e220ec469180feb08305e1af64c271530e8a2e0: Seen by 10 peers. Pending/unconfirmed.

Can you provide any troubleshooting advice? Can I reverse or cancel the transaction?

Okay, some observations:

MultiBit Classic 5.16 is more than two years old.
The transaction you mentioned doesn't appear on either blockexplorer.com, blocktrail.com or blockchain.info. It seems that they didn't get propagated in the network.

The Bitcoin transaction market has evolved in the past two years and due to a higher demand, the transaction fees have become more competitive. I would guess that your old version of MultiBit wouldn't have a good estimation for fees. Therefore, it seems likely that your transactions didn't fulfill the 'minimum relay fee' criterion and didn't get relayed by the peers that did see them.

I found this FAQ that addresses specifically your issue: I sent bitcoin from MultiBit Classic but they are stuck., which provides a similar explanation as one of the most likely reasons.

You should:

Update your software to a more current version to mitigate this issue in the future.
As suggested in the above FAQ: "You can remove the transaction that never propagated by doing a Tools | Reset Block chain and Transactions."

As always, if you don't have a backup of your wallet, you should create one, especially before changing things about your Bitcoin software, but also in general.


What are the biggest motivations for common people to adopt crypto currencies? So far I've seen only two sets of people using crypto currencies:
1. Who does illegal things (like black money/drug trading etc)
2. Who sees them as shortcut to become rich

But what are the other motivations for common people to adopt? I earlier read that crypto currencies only have deflation and no inflation, but I don't think that is true because if a new crypto currency gets launched with better features, people may shift to the new currency and existing currency price may go down.

One of the benefits of cryptocurrencies that I recently heard at a Bitcoin Meetup that seemed very promising was how they lower the cost of remittances. I've heard remittances be defined as the act of returning a payment you previously accepted, and as the act of sending money across borders such as when immigrant workers earning income outside of their home country try to send money they earned back to their home country. The first definition of remittance benefits from cryptocurrencies because the Bitcoin protocol allows you to program money. Just like web technologies like HTML, CSS, and Javascript allow you to program the information that flows through the web, Bitcoin allows you to program how money flows through a financial system (whether that system be your immediate family, a school system, or a nation). If one could automate the return of payments when certain conditions are met, then much of the accounting apparatus that exists would not be needed. This is difficult to do, though. For instance, If you were a merchant that sold radios and you wanted to guarantee customers that they could return a radio they bought if the transmitter didn't work, how can you programmatically instruct 0.1 BTC to be sent to the customer when their transmitter breaks? You could write broken-transmitter recognition software, but then your remittance system is only as good as your recognition software. Nevertheless, the Bitcoin protocol let's the common person who has the necessary programming skills automate this general type  of service.

With regards to the second type of remittance, since the bitcoin network is made up of a bunch of connected nodes that exist all over the world, a computer with internet access is all someone from a migrant-worker-sending country would need to receive bitcoins from a family member working abroad. The industry for this type of remittance is in the 10's of billions, so people are waiting for the regulatory environment to become a little bit clearer before implementing services that do this sort of thing.

In general I think bitcoin makes more sense for citizens in a developing country who don't have trusted organizations like exist in developed countries. If you live in a place where the government can arbitrarily freeze your bank accounts which holds your life savings, then Bitcoin offer the common person the ability to store their money in a trustless system where nobody can seize their value. Unless of course you divulge your private keys, or they physically come to your home and demand you give them your private keys.


how to see bitcoin blockchain and addressess for testnet in my site the user has a link to check the transactions and his wallet address.

right now I am using this:

blockchain: https://blockchain.info/tx/#{txid}

address_url: https://blockchain.info/address/#{address}

and works perfect for btc mainnet

in my code I have this to get the blocks and addresses info, my question is how can I get the same thing but using testnet?

I tried https://www.blockcypher.com api but did not work, any help? thank you.

what I want it is get the transactions and addressess info from their in my website.

it is already working but just with btc main chain

I am using testnetchain already: bitcoin.conf testnet=1

can someone one explain how to get this info using the testnet?

is blockcypher or another website similar to blockchaininfo to me get these parameters.

Blockchain.info does appear to support testnet blocks and transactions by simply using the "testnet" subdomain.

For example:

txid: 4200cea53a075f3081156a9d664fe05cfe108a09e26e8f20ee65e7ebe141060b

block: 1443900

address: mum6KQEwAHGDRr7HRXx7hufcsyqiGPUCtN

So in your case simply use this:

https://testnet.blockchain.info/tx/#{txid}

https://testnet.blockchain.info/address/#{address}


you subscribe to the wss feed you can see most the subsecond stuff is opening and canceling limit orders which doesn't effect the ticket price. Only market orders represent the exchange of bitcoin. Market orders are liquidity takers so get a fee. They represent actual market movement. The limit orders often will never get matched. I often market orders may only come in every minute to five minutes under normal trading atmosphere. So ticker price more constant. Hope this help.


Multi-signature public key validation In a pay 2 script hash transaction, does the redeem script get checked for valid public keys before a transaction can be signed? I have noticed that if I have a redeem script with one invalid pubkey out of 3, even if I sign with a valid private key for the multi-sig transaction, the "scriptSig" is blank and the hex returned for the signrawtransaction is small/incomplete.

Any ideas?

I saw a comment on here that led me to believe that public keys in redeem scripts could be text or 'anything'

For m of n multisig, only the last m pub keys are checked for validity, given that at least the last m pub keys are valid public keys and match to signatures in the correct order. Other pub keys are not checked and can be used to push arbitrary data.


How to determine the geographic distribution of the hashrate? I would like to map the hashrate distribution geographically, which would require knowing the IP address of the winning miner for each block.

According to the paper by Miller et al
several aggregator websites, including blockchain.info, maintain low-latency connections to thousands of nodes and record the IP address of the first connected node to relay each block. Is this information provided somewhere? While blockchain.info provides a hashrate distribution, it is aggregated at the pool level while I would like to know more about how the hashrate is distributed among the pools' servers.

While blockchain.info provides a hashrate distribution, it is aggregated at the pool level while I would like to know more about how the hashrate is distributed among the pools' servers.

That is not possible to ascertain with certainty. When a Bitcoin block is mined, there is no way to determine which node/pool mined it. Block explorer sites like blockchain.info look at the coinbase data in coinbase transaction to possibly link the block to a particular pool. For example, if you look at the last mined block 594,041 the coinbase transaction has the coinbase data as:

037910091a4d696e656420627920416e74506f6f6c39331400332020d34beafabe6d6d38d664d05278d5312fc43b4a47d259012d94db2c113f41e0ee36a6711161138004000000000000006cbf008036030000

The first byte 0x03 indicates to push the next three bytes on to the stack. Then bytes 0x791009 indicate the block height (594041 in this case) in little-endian. Then if you look at the bytes 0x4d696e656420627920416e74506f6f6c it represents "'Mined by AntPool" in ASCII. This is what the explorers use to say that the block was actually mined by Ant Pool. Nothing prevents me from mining a block tomorrow with the coinbase data that points to a particular pool when in reality it has nothing to do with them. The block explorer sites will use this false data to show on their websites that the block was actually mined by that pool name that I sneaked in.

  Several aggregator websites, including blockchain.info, maintain low-latency connections to a thousands of nodes and record the IP address of the first connected node to relay each block

This data is also unreliable. I can run VPN, mine a block and relay it to the network with an IP address located thousand of kilometers away from my actual location. Moreover, you can run Bitcoin full node on tor which would completely obfuscate your identity.


Does bitcoind send message headers and payload separately in P2P protocol? I am connecting to my local bitcoind using TCP and observed the following behavior:

I see many messages where only header is given or only part of the payload is attached. Of course, it could be a bug my code too.

Are the bytes sent in chunks? Which of the following are valid?

|header1|payload1|     (as per documentation, this is valid)
|header1|              (no payload, even though required. Have seen this)
|payload1|             (no header, have seen this)
|header1|partPayload1| (incomplete payload, not sure if seen these)
|partPayload1|         (part earlier header's payload, not sure if seen these)
|header1|payload1|header2|payload2|
|header1|payload1|header2|partPayload2|
|header1|partPayload1|header2|
|partPayload1|header2|payload2|

Note: I am using version number 70002, relay = 1 and services = 0.

EDIT: Generally I wait for the remaining bytes, and most of the times they arrive, but in rare cases, around 2%, some other header arrives. This happens only with tx messages.

EDIT2: Based on the comments below, it seems likely that there is a bug in my code. I'll check and revert.

EDIT3: Was a bug in my code. I was assuming that partial data packets correspond to a single header. There can be multiple headers after the data is complete (in the same packet). This makes sense once I consider it as a stream.

TCP is a stream protocol. Even though on the wire the stream is submitted as a series of IP messages, semantically it is just a stream of bytes.

This means that at the application level you shouldn't care about the message boundaries. Routers and other internet infrastructure can arbitrarily split up data into packets to fit in their underlying protocols (e.g. Ethernet has frames of at most 1500 bytes).


Continuous integration setup using bitcoind regtest on travis-ci Subtitle: travis-ci fails to run generate JSON-RPC method on regtest

I'm trying to setup CI process on https://travis-ci.org platform to install bitcoind and start new blockchain using regtest mode.
I want to do this to run unit tests of my applications which uses wallet data. Methods against bitcoind are working fine except the generate method which is needed to mine some bitcoins in regtest private chain.

It looks like some bitcoind/travis-ci related issue.

generate method is working fine in my local CI process (non-travis).
Travis-CI is working fine if I comment the generate method call in CI tests.

generate method call when using travis-ci fails with the following error:

{"code":-32601,"message":"Method not found"}

bitcoin.conf:

server=1
regtest=1
gen=1
rpcuser=someuser
rpcpassword=somepass

.travis.yml:

language: r
sudo: required

before_script:
  - sudo apt-add-repository ppa:bitcoin/bitcoin -y
  - sudo apt-get update -qq
  - sudo apt-get install bitcoind -y

r_github_packages:
 - jangorecki/rbitcoind

after_script:
 - cat $(find . -maxdepth 1 -name "*.Rcheck" -type d)/tests/tests.Rout

Is there any trick in setup I should use to make travis-ci capable to run CI on regtest chain, including generate method?

Leaving the build links just for reference:
- generate method commented - CI passed: https://travis-ci.org/jangorecki/rpc.generate/builds/77207297
- use generate - CI failed: https://travis-ci.org/jangorecki/rpc.generate/builds/77208666

v0.11.0 and after:

Check and make sure that your daemon version is v0.11.0 or greater. If it is, the generate method should work.

Pre v0.11.0:

The setgenerate true method should be used.

In a standard network (such as testnet or main), setgenerate true will turn mining on indefinitely. In regtest, it just mines one block. You can also do

setgenerate(TRUE, 10)

To mine 10 regtest blocks. The second parameter is called the generation limit.


Untypical input script There are many untypical Input script data in blockchain. What does it mean?

For example, transaction:

4A253F17E5F4B24B41F72A6AE46DD1BCB25F7F33769C2AA5D50C6A6A7CF9F76E (link)

has it's input script:

3046022100EE238CAD1E8AC7F14661760B1B1FB2CF171F41AFB31E3B59D3CED2284A1C2A71022100BEF7FB989CCFB00A65C009A77B46BC818D2E80458668F73DA0072966AAA28B620103B2ABE09A1C4E67C3EB9ACD5596452A5D785C6E5A772FBEA9A29CA95C15598EA6

When I trying to parse this raw data, the result is:

30

46

02

21

00EE238CAD1E8AC7F14661760B1B1FB2CF171F41AFB31E3B59D3CED2284A1C2A71 – Sig r

02

21

00BEF7FB989CCFB00A65C009A77B46BC818D2E80458668F73DA0072966AAA28B62 – Sig s

01

03

B2ABE09A1C4E67C3EB9ACD5596452A5D785C6E5A772FBEA9A29CA95C15598EA6 – Unknown data.

What is the unknown data? This is not a Public Key, but what is it?

P.S. I checked that this unknown data is not a part of public key (X coordinate of Public Key as I thinking). After calculating Y coordinate (on EC) of Public Key I get 9F203515694856269C76C797D8E8E784EBDB927B650705E348F6FBA07DC56FAF. After I check the signature (Sig) with this:

Public Key = B2ABE09A1C4E67C3EB9ACD5596452A5D785C6E5A772FBEA9A29CA95C15598EA6, 9F203515694856269C76C797D8E8E784EBDB927B650705E348F6FBA07DC56FAF

Transaction hash for this Sig = 59E4367A829551DE94594777789B9274BFBDAC9F66550B02B85639945F21BE3A.

Then I calculate x and y from Public Key, Hash and generator point G. But x does not match the Sig r from raw data. So this way did not working.

It is a public key. I think you're parsing this transaction incorrectly - what you should get is that there are two elements. The first is a signature, and 73 bytes long, starting with 3046022100ee238c... The second element is a public key, and 33 bytes long, and starts with 03b2abe09a1c4e67...

Here's the transaction you linked, broken up into sig and pubkey.

version

01000000

vin count

01

outpoint

3abe215f943956b8020b55669facbdbf74929b7877475994de5195827a36e45900000000

script len

6c

push immediate 73 bytes

49

bytes

3046022100ee238cad1e8ac7f14661760b1b1fb2cf171f41afb31e3b59d3ced2284a1c2a71022100bef7fb989ccfb00a65c009a77b46bc818d2e80458668f73da0072966aaa28b6201

push immediate 33 bytes

21

bytes

03b2abe09a1c4e67c3eb9acd5596452a5d785c6e5a772fbea9a29ca95c15598ea6

sequence

ffffffff

(Everything below is part of the outputs.)

0206cfbb9f0f0000001976a914a66ba35c1d9bdcc8dfeb0fb8bedb16e1a570487d88ac09165612000000001976a914b420350a7b274e059d7ba5c97e8887d447b7287588ac00000000


Question regarding MultiSig outputs Just saw good question on Telegram:

So I working on an algorithm that would download and process bitcoin blocks, specifically the transactions in them. I want to take every output address of every transaction in a block and query my database if any users own this address as their deposit address. Initially I thought an output can only have one address and so I can just credit the person who owns it with the amount of that output. But now I found out that an output can actually have multiple addresses to it and thats called multisig. I don’t really understand the concept of this. So what if a person uses his deposit address that I’ve given them as first address and they also use another address of their own as second address in a single output? Can they use that output with their address to waste it so then so I lose the money they deposited?

No, when multiple entities create a multisig address together, it's still a single address. It's merely that the locking script that holds the funds needs more than one signature to allow funds to be sent. So, when you're writing an indexer, you can likely get away at first with simply not distinguish singlesig and multisig addresses.


Is PPS or DGM better for pooled mining when difficulty has a high "beta" According to this thread on BFL, BFL_Josh says

  PPS may be a better bet for you if you don't like variance. However if you are mining for the long haul, DGM will pay out more but your variance will be higher.

If I expect a few weeks of volatile (spiking or increasing difficulty) and I have sufficient Gh/s, what pool method is best suited for

A steadily increasing difficulty
A fluctuating or rapidly increasing (spiking) difficulty)

Mining, by construction, is a stochastic process. A Poisson Process to be precise. This means that even at a constant difficulty the time between a miner finding a block and the next is randomly distributed. As difficulty rose, this meant that you could go months without finding a block and then have a single afternoon where you found 2 in a row. This variance in the time between finding blocks is intrinsic to how mining works and is independent from any change in the difficulty. It's this variance PPS reduces, it is therefore independent from the difficulty changing.

Mining pools basically gather the computational power of multiple users, and should a single user be lucky, everybody gets their share. The way this share is distributed however is different between the two models you cite. The PPS model has the pool operator take on a certain risk, because he pays you for every share you submit. This means that you as a miner get payouts frequently even if the pools as a whole did not find a block. The other model waits for a block to be found and then distribute the reward among the users that participated.

Basically, if you are mining and are not directly reliant on a regular stream of bitcoins coming in, DGM is the way to go. If you are living on a knifes edge, reliant on a regular flow of bitcoins to keep you going PPS might be for you.

As a personal opinion: if you are serious about mining, go for non-PPS as you don't have to pay for the risk of the operator.


how bitcoin mining works The way I understand mining is that you hash the previous block hash with the new transaction files and a variable to get certain amount of zero in the hash. So the stronger your hash power is the faster you find the new block hash. My problem is that thinking about it this way means that only the one with the highest hashing power will find the block first and get rewarded, then what are the others with lower hashing powers doing ? and how do they get rewarded ?

and do you get rewarded when you find the hash or you get rewarded every second of mining proportionally to your hashing power ? because the websites that offers hashing powers shows your balance to be continuously increasing and not as expected to increase step by step with each hash found.

The way I understand mining is that you hash the previous block hash
  with the new transaction files and a variable to get certain amount of
  zero in the hash.

You have chain A-B-C-D- , you create a new block, E, with its header (with variable called nonce and a reference to D's header hash) and body (the new transactions). You change the nonce in E's header and then hash the header. This hash should have certain amount of zeros.

  So the stronger your hash power is the faster you
  find the new block hash.

True, but searching the correct hash means guessing the nonce from entire range of nonces, and everybody guesses their own variable. So the fastest computer will only have highest number of guesses. This doesn't mean someone else with only a few guesses won't guess it first. Like in a lottery, the guy who buys 1000 tickets is not sure to win comparing to the guy who bought 2 tickets, he just has better odds.

  and how do they get rewarded ?

Only the one who guessed the hash is rewarded.

  because the websites that offers hashing powers shows your balance to be
  continuously increasing and not as expected to increase step by step
  with each hash found.

If this site is a mining pool it gives rewards by some strategy, rather than giving the reward to the one who finds the hash at the moment when he finds the hash.


Unconfirmed transaction. How to make my wallet made whole I am running a node with an unconfirmed transaction. I tried shutting down my btc qt so the transaction would be forgotten. To no avail it keeps rebroadcasting the transaction. I am in the process of upgrading and syncing my btc qt now too. But it's taking forever to sync. What will happen if I import my keys to a software wallet, electrum? Will my electrum wallet be made whole from the unconfirmed transaction? Any suggestions? I'm not in love with running a node anymore or coinbases ability to retrieve my transaction. Coinbase was the supposed recipient. It's been two weeks.

It's not possible to remove your transmitted transaction from the network.

Even if you shut down and clean your own local client, other clients around the world have it in their mempool. That's why your local client reflects the balance minus the amount you sent, even though it's not confirmed. That's how it's supposed to work, Bitcoin TX's are supposed to be irreversible even before being mined.

So, Bitcoin does not have a TX revocation network message available.

Only thing you can do is, before this unwanted TX is confirmed, to use another client, which either didn't see your TX or allows you to craft TX's and broadcast them, to submit a new transaction containing a much higher fee and same UTXO's. (Double spending on purpose.)

This new TX will cost you the fee, but if you set your own address as beneficiary, the funds will return to your wallet and the old transaction will get discarded by the network as a double spend. This higher fee is your cost to revoke the old unwanted TX. All this has to be done before the old TX is confirmed in a block.


Can a Non-Segwit Miner mine segwit transactions? I understand that non-segwit nodes interpret segwit txes as Anyone-Can-Spend txes, and they cannot validate txes that spend segwit outputs.

But when an old style miner receives a segwit tx to mine he consideres it invalid, right? (That's because it appears to them as a strange transaction with no input and 1 output.)
So, does it follow that segwit txes can only be mined in a block by upgraded miners?

An old style miner would only receive a stripped transaction, i.e. a transaction from which the witness has been removed. They will consider a segwit transaction to be valid but non-standard because one element remains on the stack when resolving the redeem script.

If a miner included this transaction in their block, the block would appear valid to segwit-incapable nodes, but invalid to any segwit-capable nodes as any segwit input would be missing the required witness and thus would not be properly signed. This would lead to the block being rejected by 98% of the nodes on the network, and thus the segwit-incapable miner to lose their block reward as it would not become part of the heaviest blockchain. Segwit-incapable miners can however contribute blocks that only include non-segwit transactions that build on top of the chain that includes segwit-blocks.

This means that only a miner collecting transactions with a segwit-capable node is able to create a valid block that includes segwit transactions.


Coins sent to unknown address in Multibit Premise: I'm quite new to all this bitcoin thing.

After experiencing some problem with a bitcoin transaction, I made few attempts with small quantities (0,0001).

In particular, I've sent 0,0001 to each of three different addresses. However, I've noticed that on MultiBit, on the transactions details, under "description", all of them appear "Sent to [address]" to the same address for all the 3 transactions. Is that normal?

Ok, none of the transaction were addressed to 17iU5t8JXuJux4maPEwWHtuy6cGU4cRiJQ

For example, at 16 Apr 2015, 15:35, I sent 0,0001 bitcoin (plus 0,0001 commission) to 12m1i78fnz31eTbK4cut18y1sTyP6ZHhw5 (which is another wallet of mine). However, I've never received them on 12m1i78fnz31eTbK4cut18y1sTyP6ZHhw5,a and on MultiBit it appears to be sent to this unknown 17iU5t8JXuJux4maPEwWHtuy6cGU4cRiJQ. Same holds for the other two transactions: they weren't meant to be addressed to 17iU5t8JXuJux4maPEwWHtuy6cGU4cRiJQ.

(I am one of the MultiBit devs).

The MultiBit code is hosted on multibit.org ONLY.
The 'tv' copy is a phishing site.

DO NOT USE IT.


What's a good resource explaining the best ways to buy Bitcoin (noob friendly)? We have a slew of questions about specific regions ... but I couldn't find a general, concise, good resource on how to buy Bitcoins.

This article offers too many choices and isn't noob friendly.

I want to link to the answer from the Newbie Guide I'm making.

An answer to this question should not be a specific way to buy (it will get stale, Stack Exchange does not handle staleness issues very well), but rather an external resource that is maintained and up to date (and will likely remain so in the future). I suggest a new Wiki entry that is noob friendly.

Update: I've opened up a new wiki entry for this, you can help edit it.

A guide almost needs to be one that provides results dynamically based on responses to questions.

The factors that matter are:

Where are you (country)?
How much are you looking to buy?
What payment methods can you use?
How soon do you need the bitcoins?
Is privacy / near-anonymity important?

Only once those are known can recommendations be made.

A fairly comprehensive list of methods exist on the Bitcoin wiki:

http://en.bitcoin.it/wiki/Buying_bitcoins


Electrum setup problem I was trying to install electrum, and for some reason, I wanted to see what multisig wallet was, and now I'm stuck on the master public keys window, I can't cancel and select standard wallet. Every time I open the installer it asks me to input the master public keys.

Just had this problem today. You need to close Electrum, delete the Electrum folder, and start Electrum again. This will "reset" the installation.

The Electrum folder is ~/.electrum on Linux and Mac. On Windows it should be Users\<YourUserName>\AppData\Roaming\Electrum\wallets (it's shown without slashes on the official Electrum website but this should probably be where it is). You might need to show hidden files in order to see it on Windows.

Note that this folder contains your wallets so if you have existing ones, you'll want to back them up first.


Automatically close the bitcoin-qt when enable SSL for RPC I Just try to enable SSL for bitcoin-qt RPC call. I follow the SSL on RPC
link to archive my target. But I am getting the following error and close the bitcoin-qt automatically.

I am using the bitcoin-qt 0.16.3

Support for SSL protected RPC was removed in Bitcoin Core version 0.12.0 (released in february 2016).

See https://bitcoin.org/en/release/v0.12.0#rpc-low-level-api-changes for the release notes on this, and also a workaround.


Main wallet unspent transaction I have a question about an unspent transaction, we know that after some transactions we have a change address created by the main address, now imagine that Bob mined 6 BTC, now he transferred 2 of the two Alice and now in Bob's change address there is 4 BTC and they are unspent, now the question is that if I try to get unspent transaction of the main wallet with bitcoin core that I imported the address of Bob's main wallet, will it show me 4 BTC? or it can show if I try to get with child address?
Another question is that, is there any way to find a parent or main wallet, child keies?

All wallets will calculate and show the same amount as the "balance" for an address. In your example, all wallets would show the balance as 4 BTC. There are exceptions if a wallet is faulty or is not synchronised (not up-to-date, doesn't yet know about latest transactions).
If you import an address into a wallet, it will show the correct balance but it will show that amount as "watch-only" or "non-spendable".
There is no way to discover private-keys from addresses.