text:
Transaction shows up as sent, but was never recieved
I sent 0.002 BTC to 15bPd9YSB3kpuAFFz2tBZh39A3XdnN5UoX (I paid the transaction fee), but Bitcoin-Qt crashed when I pressed send. When I reopened it the transaction showed up, but it isn't in Blockexplorer.com or Blockchain.info or the reciving client. I tried rescanning both the sending and recieving clients.

I just had to run getrawtransaction on the transaction ID (from the transaction list) then run sendrawtransaction on the result.


text:
What does "Reindexing blocks on disk" mean?
When I upgraded to 0.8.1, it said Reindexing blocks on disk and it took about four days (Grr).  But later, it said something about a corrupted database and it had to do it again! What is it doing?

0.8x versions of the bitcoin-qt client now use a different database to store the blockchain.  This change was necessary to allow for larger block sizes.
The reindexing process is converting the previous database (which used BerkleyDB) into the new one (Which uses LevelDB).

Okay, but how come it had to do it again? It said something about a "Corrupted database".

@lurfjurv - Either something went wrong during the reindexing or your current copy of the old-DB blockchain is corrupted.  If it blows up the same way again, your best option would be to blow away the blockchain and redownload it from scratch.

Thanks, although I would like to avoid redownloading if at all possible; it took about 48 hours the first time.

@lurfjurv - As opposed to the ~96 hours you just waited for it to attempt to reindex?

Oh, I wasn't running the reindex all the time. It probably took about 10 hours total, just when my computer was open.

The way the blockchain is stored on your computer has changed with the latest version.
The developers tweaked it, so that future users can profit from a faster init-proccess.
The new indexing made it necessary to reinitialize your blockchain.
However it should not have taken so long. On my laptop it took about 2 hours. Do you have a very weak computer?

I don't think so. It's  MacBook Pro, about 2 years old. Downloading the blockchain also took a long time (about 15 hours).

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Can you help me fix this address?
I just got this address: 1a8LDh3qtCdMSAgRXzMr4zB8w1EG4h1Xi, but the checksum doesn't validate. Can someone help me fix it by changing some characters that look/sound similar?

This is risky. There might be more than one way to "fix" the address, and you might get the wrong one. In that case, you might send coins to the wrong address, and if you do they are lost forever. You should instead talk to whoever gave you the address and ask them to correct it.

If only one character is different, there's a ((58*33)/2^32~=) 0.000045% probability you'll "fix" it to the wrong address. Lower if you throw out substitutions that seem unlikely. Two or more characters would increase this quickly. Still, Bitcoin addresses are not designed to recover lost data. It'd be safer if you could just get the correct address from the source.

This question appears to be off-topic because it is about doing something impossible and have most likely the wrong outcome

Just for fun, here is some code I threw together that will try substituting up to n characters to try to make a valid address.
As a disclaimer, there's no guarantee that any address it finds is actually the "right" one; it could be a different address that is valid but doesn't belong to anyone, in which case any coins sent there would be lost forever.  Use at your own risk.
Running it with n=3 found the address

1a8LDh3qtCdMFAgRXzMrdvB8w1EG4h1Xi

which has a balance of BTC 29658.80268195.  It appears to be the current resting place of the Bitcoins seized from Silk Road that were auctioned today.

To compile (on Linux):
gcc -O3 -o subst subst.c -lssl -lcrypto

You will need the OpenSSL headers and libraries installed.
To run:
 ./subst 2 1a8LDh3qtCdMSAgRXzMr4zB8w1EG4h1Xi

Will try to replace up to any 2 characters to make a valid address.  You can replace 2 by 1 if you are impatient, or by a larger number if you are very patient.
Here is subst.c.  There is an unused function to try transposing characters from the address, but it is redundant with n >= 2.  The validation code is from Rosetta Code.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <openssl/sha.h>

const char *coin_err;
#define bail(s) { coin_err = s; return 0; }

static const char *tmpl = "123456789"
        "ABCDEFGHJKLMNPQRSTUVWXYZ"
        "abcdefghijkmnopqrstuvwxyz";

char *xstrdup(const char *s) {
    char *p;
    p = strdup(s);
    if (!p) {
        fprintf(stderr, "How can you be out of memory?\n");
        exit(1);
    }
    return p;
}

int unbase58(const char *s, unsigned char *out) {
    int i, j, c;
    const char *p;

    memset(out, 0, 25);
    for (i = 0; s[i]; i++) {
        if (!(p = strchr(tmpl, s[i])))
            bail("bad char");

        c = p - tmpl;
        for (j = 25; j--; ) {
            c += 58 * out[j];
            out[j] = c % 256;
            c /= 256;
        }

        if (c) bail("address too long");
    }

    return 1;
}

int valid(const char *s) {
    unsigned char dec[32], d1[SHA256_DIGEST_LENGTH],
        d2[SHA256_DIGEST_LENGTH];

    coin_err = "";
    if (!unbase58(s, dec)) return 0;

    SHA256(SHA256(dec, 21, d1), SHA256_DIGEST_LENGTH, d2);

    if (memcmp(dec + 21, d2, 4))
        bail("bad digest");

    return 1;
}

inline void try(const char *s) {
    if (valid(s)) {
        printf("Valid:\t%s\n", s);
    }
}

void subst_int(char *s, char *p0, int n) {
    if (n == 0)
        return;
    char *p;
    for (p = p0; *p; p++) {
        char orig = *p;
        const char *q;
        for (q = tmpl; *q; q++) {
            if (*q != orig) {
                *p = *q;
                try(s);
                subst_int(s, p+1, n-1);
            }
        }
        *p = orig;
    }
}

void subst(const char *s, int n) {
    char *buf = xstrdup(s);
    subst_int(buf, buf, n);
    free(buf);
}

inline void swap(char *p, char *q) {
    char tmp;
    tmp = *p;
    *p = *q;
    *q = tmp;
}

void transposition(const char *s) {
    char *buf = xstrdup(s);
    char *p, *q;
    for (p = buf; *p; p++) {
        for (q = p + 1; *q; q++) {
            if (*p != *q) {
                swap(p, q);
                try(buf);
                swap(p, q);
            }
        }
    }
}

int main(int argc, char *argv[]) {
    int i;
    int n;

    if (argc < 3 || (n = atoi(argv[1])) <= 0) {
        fprintf(stderr, "Usage: %s n addr...\n", argv[0]);
        fprintf(stderr, "Substitute up to n characters\n");
        exit(2);
    }

    for (i = 2; i < argc; i++) {
        char *s = argv[i];
        printf("%s:\t%s\n", valid(s) ? "Valid" : "Orig", s);
        subst(s, n);
#if 0 /* redundant with n >= 2 */
        transposition(s);
#endif
        if (i+1 < argc)
            printf("\n");
    }
    return 0;
}

Thanks! The correct address seems to have only 2 characters different than the one I posted, so your code would work for n=2 as well, correct?

@lurfjurv: Nope, look again.  Characters 13, 21 and 22.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
how are lightning network payments instant and secure at the same time?
I have a question regarding lightning network. It's a bit of a long question so please bear with me.
If have 1 bitcoin in my wallet and buy an item costing that amount from a shop. I leave the shop before they have a confirmation (before it's put into a block).
It's my understanding this would put the shop at risk as i still have the 1 bitcoin technically in my wallet as the transaction with the shop is still floating around in the meme pool.
I could at this point create a new transaction sending the 1 bitcoin to another wallet owned by myself. I could attach a relatively large miner fee to this transaction.
This transaction would probably then get put into a block before the shop transaction. If this happened the shop transaction would now be considered invalid as according to the block chain i now have 0 bitcoin in my wallet.
This is why the shop needs to wait for 1 confirmation before allowing me to walk out of the shop with the purchased item.
The problem here is i could potentially be waiting for around 10 minutes before confirmation is received. Bitcoin isn't exactly user friendly from the shops point of view.
I have heard lightning network solves this issue but i don't fully understand why.
My understanding is to open a LN channel with the shop a transaction is created on the main bitcoin block chain.
This transaction would be saying to take 1 btc from my wallet and 0 btc from the shop's wallet and open a multi sig wallet. My understanding being the multi sig wallet is a temporary address which will remain active until the LN channel is closed. When it's closed a new transaction would be created distributing the funds to my wallet and the shop's wallet depending on where the funds were in the LN channel when the channel was closed.
My question is how do confirmations work with regards to the initial transaction which opened the LN channel? When the LN channel is opened presumably this transaction is in the meme pool.
Can i send the 1 btc to the shop in the LN channel while that transaction is still in the meme pool? If yes then surely it's the same situation as before where i could then create another transaction on the main blockchain for 1 btc and if that transaction gets put into a block before the LN transaction is put into a block then the LN transaction would now be invalid.
Basically i don't understand how LN allows instant payment in a shop while maintaining security of that payment from the shops point of view.
I know i must be not fully understanding how this process works. Can anyone shed some light on this?

This is a very good question and I will give a quick summary of what is happening here. The longer version can be seen on my educational video on how to create payment channels starting at 33:41 (though I would recommend to watch from the beginning to review bitcoin and notation.)

My understanding being the multi sig wallet is a temporary address which will remain active until the LN channel is closed.

yes this is true! The key is a multi sig address which already prevents the attack setting to the shop which you discribed in the onchain bitcon setting without confirmations. If only you need a key for a double spend you can double spend. In the setting of the multisig you would need collaboration from the victim (shop) which would not do help you

When it's closed a new transaction would be created distributing the funds to my wallet and the shop's wallet depending on where the funds were in the LN channel when the channel was closed

I think this is where you might not have the concept fully right. While it is true that the funds from the multisig wallet will be moved according to the distribution of funds to the two channel partners the initial transaction that spends those funds will be created even before the channel is opened by sending funds to the multisig from which this commitment transactions spends.
All that being said. the funding transaction is not in the mempool as you guessed but in fact confirmed within the blockchain for the channel to be open and operational. So for an initial channel opening (unless using the somewhat special setting which allows turbochannels) one also has to wait for a couple of confirmations to use the channel safely. The setting with the shop also would not require you to have a direct channel with the shop. As soon as both you and the shop have channels connected to the network you should be able to pay the shop over a path of channels without the necessity to open another channel with the shop.

The "instant" payment of Lightning is only possible for already-established Lightning channels. New channels are subject to confirmation times like any other bitcoin transaction.
When a channel is opened, the fundee specifies a minimum depth at which the channel must be confirmed for it to be considered active. Once it has been broadcast and has reached minimum depth, the funder will send the fundee a new commitment_point as part of the funding_locked message, and the fundee will respond with an equivalent message. The channel is considered active once both participants have sent the message.
It is not necessary for you to open a new channel with a specific merchant in order to transact with the merchant. The Lightning Network allows you to utilize a network of payment channels to deliver an amount to the merchant through several proxies. These payments are conditional payments, with the condition being that the merchant must surrender a preimage to a hash which was previously agreed with the payer via an invoice.
A payment in LN is not necessarily instant. The time taken depends on how long it takes for the payment request to be forwarded through each of the proxies until it reaches the intended recipient (usually milliseconds). The recipient can potentially withhold the preimage for a period of time, but eventually the payment will expire if they do not explicitly reject the payment or reveal the preimage. (The default expiry setting is 9 blocks I think). It is in the interest of a merchant to reveal it as soon as possible, because the preimage serves the equivalent function of a reciept of payment, and they probably don't want you in their shop for 90 minutes waiting for one.

The two answers provided are great, but I just wanted to add something short and to the point, to address what I think is the main point of your misunderstanding:
To open a LN channel, you will coordinate with a peer to create a multi-sig address and funding transaction that pays to it (there are some further details that are agreed upon during channel setup, but we can ignore them for simplicity).
This transaction is then published to the network, and once it is confirmed (with some specified minimum depth), the channel becomes active. You can think of the multisig address UTXO created by this transaction as representing the channel (more or less.. there is additional information about the channel state, known to the LN nodes, but for simplicity we can again ignore that for now).
To close the channel, the channel's peers will craft and publish a second transaction, which consumes the multisig UTXO and pays funds to each channel participant as appropriate and agreed upon. Once this transaction confirms, the channel will be closed.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How can I simulate ProofOfStake (PoS) for a testnet (clone of Pivx)?
After the end of PoW blocks, I am unable to mine using PoS. Here is my setup.
1) Server with the following config file.
server=1
daemon=1
listen=1
rpcuser=user
rpcpassword=password

2) Two clients running from 2 different VPS with individual unique IPs pointed to the server using the following in config file.
staking=1
addnode=<ip of the server>

3) A Mansternode installed on a separate VPS configured to one of the client VPS above.
4) I set the last block for PoW as 200. After that it must use PoS.
5) I start the mining using the server.
6) I send 100,000 coins each both to the client wallets. In one of them I lock 10,000 coins for Masternode, which works fine.
7) The mining continues and all are updating the blocks properly without any issues.
8) However, I see that none of the wallets report that their coins are enabled for staking. when I check the status using "getstakingstatus", this is what I see.
"validtime" : true,
"haveconnections" : true,
"walletunlocked" : true,
"mintablecoins" : true,
"enoughcoins" : true,
"mnsync" : true,
"staking status" : false

Everything is true, but, "staking status" alone is false.
9) PoW stops at 200 blocks. After that, no blocks are produced and none of the clients are active for staking (PoS).
What am I doing wrong? How do I solve this so that I can test PoS and understand it better? Is there any code that I need to look at and chance some setting in the code? Please let me know.

Ok. For some reason, I got this working when I tried it for the second time. This time, I set the Last PoW block number to 350. I mined first 5 blocks using the server. Then, I setup 4 different wallets in 4 different systems. I sent enough coins to all those 4 different wallets and make it available for staking. All these I did by the first 20 blocks. Then, I started to mine again using the server. Once the block number reached 350, I stopped mining on the server and suddenly, PoS took over and started producing blocks one by one using those 4 wallets. From this experience, I feel that just having 1 server and 2 clients are not enough to simulate PoS. We may need many more wallets connected to the network to get this working. Hope this helps some one.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Can I recover btc sent to an incorrect address? (electrum)
So I have an electrum wallet and I sent about $150 in btc to it. That all worked but when I tried to send it to another address, it didn't go through. Looking at the transaction, the btc went to an address similar (3F***...) to the one I entered, but not exactly the same (3D***...). I realize now that I had a malware copy of electrum, but I've taken care of that. What I'm worried about is recovering the funds sent to that address. When I look at it on a blockchain explorer, I can see that it started at 0, I sent 0.009 btc to it, and nothing has been done with it since. I read somewhere something about "restoring" a read-only wallet from the transaction ID and then getting the address' private key from the send address and sweeping it into my main wallet, but I haven't figured out how to do that with electrum yet. Does anybody know how to do that or something else to get those funds back?

Can I recover btc sent to an incorrect address?

Confirmed Bitcoin transactions cannot be cancelled, reversed, undone or recovered.
The only person who can give you your money back is the recipient, by creating a new transaction to send the same amount back to you.

I realize now that I had a malware copy of electrum

If the initial mishap was due to a malware copy of Electrum, there is no chance the criminals, who created that, would choose to give back money they stole from you.

I read somewhere something...

The things you describe won't work.

something else to get those funds back?

Nothing. Anyone who says otherwise is trying to scam you.

Just for the record, this is where I read that explanation: https://wordpress.org/support/topic/scam-unknown-btc-addresses-are-generated-funds-never-received-on-electrum/

@johnbchron: If I understand it right, that article seems to be about people who use wordpress to create a website to sell products, use woocommerce to provide e-commerice features on their website and use the cryptowoo plugin to enable their customers to pay using cryptocurrecies like Bitcoin. If that's what you were doing I'd expect you to have mentioned it in your question. As originally written, your question reminded me of the scam explained in the "Warning" atop https://electrum.org/ - folk were tricked into downloading a fake Electrum that rewrote addresses.

Yes I fell victim to the electrum scam, but I was referencing the technique explained in that forum post.

@johnbchron it's not possible to use public information to derive the private key. if it were possible then it wouldn't be secure at all. btc would have no value.


text:
Why do so many Bitcoin wallets and accounts exist?
Why so many bitcoin wallets do exist? Why it is not just single like other conventional currency? Multiple wallets means I have to have multipe accounts; is it possible to transact among multipe wallets bitcoins and if yes is it without fee?
For bitcoin account, public key is actually address which will be used in bitcoin transaction (sending bitcoins to me). And private key is used to decrypt the transaction. I also got to know that the key can also be changed. If my understanding is correct, what is the actual key for the bitcoin account?

What exactly was a bitcoin wallet intended to be?

Multiple wallets means I have to have [multiple] accounts;

The original creator of Bitcoin, Satoshi Nakamoto, wanted to create a currency for internet use which did not depend on any trusted third parties! Originally all wallets were software programs that you downloaded and ran on a personal computer. You would only have one wallet, not multiple.
There were no accounts, no exchanges or other businesses that you had to trust with your money. That was deliberate. You can still use Bitcoin like this today.
Over time people and businesses have seen an opportunity to offer services to people who either don't understand the original intent or who want to treat the currency not as a currency but as a speculative asset to be traded. These businesses have set up custodial accounts and have often described those accounts as wallets. These "custodial" wallets are not the type of wallets that the founder of Bitcoin intended.
You don't have to have multiple accounts. You don't have to have any accounts. You can use Bitcoin with no accounts whatsoever. Just download the wallet software of your choice, transfer all your Bitcoin to that wallet and close all your other accounts.

What is electronic cash?
Consider the way most USA citizens use US dollars. Very few of them ever buy and sell US dollars. They just receive their income in US dollars and spend their money at businesses that accept US dollars for goods and services. There is never any need for these people to buy US dollars or to "cash out" their US dollars.
This was how Satoshi Nakamoto and other early adopters hoped that Bitcoin would be used.
--
Two hundred years ago, many US citizens would have received their wages as US dollar bills (banknotes) and would have used those for all their spending. They
wouldn't need a bank account at all. Their finances could be totally cash based.
Nowadays many countries are moving rapidly towards a cashless society where all money is controlled by banks.
Nakamoto wanted a return to a cash based system where people, not banks, controlled their own money. But he wanted it based on an electronic currency that could be used online and which wasn't controlled by governments - because governments use inflation to effectively take money from savers.
So Bitcoin was intended as a return to a cash-based society, but one that could be used online and not subject to government or bank control
So each person would have a single wallet, no accounts.
You can still use Bitcoin like this.

The role of Cryptography

private key is used to decrypt the transaction.

The Bitcoin network does not use any encryption. So no decryption is necessary.
The private keys are used to provide a mathematical proof that you have the right to spend amounts of Bitcoin associated with a Bitcoin address (or more correctly, associated with a Bitcoin script that can usually be represented as a Bitcoin address).
Private keys are effectively used to prove ownership of money.

I also got to know that the key can also be changed.

Not really, however you can use a transaction to move money to the control of a different private key.

what is the actual key for the bitcoin account

The Bitcoin network doesn't know about or keep track of accounts. Many Bitcoin wallets don't have any sort of account concept.
If you have an account with some sort of trusted third party, the way that works is proprietary and may be different for each business.

[quote]You can use Bitcoin with no accounts whatsoever. Just download the wallet software of your choice, transfer all your Bitcoin to that wallet and close all your other accounts. [/quote] No accounts mean? If I just download a wallet application then how I'll get the ownership of Bitcoin? How can I use my Bitcoin to another computer or from mobile phone? What will happen if my computer crashed?

@user3717550: You should really ask those as new questions - 1) By knowing the seed or private key that controls all amounts of Bitcoin you own. 2) By installing wallets on them using the same seed or key. 3) You restore wallet from backup or from a written note of seed or key kept somewhere very safe.


text:
Coinbase has the address of a bitcoin stored on a blockchain account. How do I access it?
I don't have the login to the Blockchain account that I stored the bitcoin on. I do have proof of the purchase and transaction of the coin and the coins address, as it is stored on Blockchain. How can I retrieve the coin from Blockchain back into my wallet on Coinbase ?
Thanks.

I assume you mean that you have a a blockchain.info/.com wallet.
You will have to log into the wallet and initiate a transaction.
If you cannot do that, and you do not have a wallet backup, then you are likely out of luck, the coins would be effectively lost.
You could attempt to contact their customer service to see if they can somehow let you log into the account.


text:
Why doesn't Bitcoin-Core support Lightning Network?
I first learned about Bitcoin in 2009. Ever since, I've (very) slowly pieced together information, while shaking off 99% disinformation, about how Bitcoin works. I run a Bitcoin Core fullnode and have multiple wallets in it. I'm able to talk to the API to handle payments in an automated fashion. I have it working.
My two "minor" issues are the large (compared to microtransactions) fees and the oftentimes long waiting.
I've been learning about Lightning Network since it was announced, which feels like "a number of years" ago now. I understand it on a very abstract level, and have attempted to read through this: https://github.com/lnbook/lnbook/blob/develop/02_getting_started.asciidoc
Looking at the table on that page, it turns out that there is only one single client running on desktop computers which uses Bitcoin Core: "Electrum". When looking up "Electrum", I got very sketchy vibes from its website. I really don't want that running on my computer. But I also need to support this Lightning Network thing. None of my potential customers are going to send $5 in BTC to my service when the fee for sending that $5 is another $5, or more.
But let's say that I somehow manage to trust this "Electrum", and actually get it working. Most people barely know what Bitcoin is, but I guarantee that nobody outside our bubble knows what "Lightning Network" is. At best, they will think it's one of the thousands of "altcoins" created daily, and will have zero desire to learn about this.
In short, I wish that Bitcoin Core would just have built-in support for Lightning, and although I've heard the (valid) argument that this would cause much more complexity to the Bitcoin Core project, which should remain "minimal" to be as secure as possible, one might also argue that if something isn't done about these huge fees for microtransactions, as well as the often long waiting for confirmations, Bitcoin isn't going to be actually used for anything but "digital gold".
While I like my "digital gold", I also want people to be able to reasonable give me more of it. If they have to pay such large fees and wait for so long each time, they will be very reluctant to.
Something about this doesn't add up to me. Either this is a revolutionary technology which should indeed be part of Bitcoin itself, or it's some sort of very ambitious and honest-sounding scam or attempt to take over or destroy Bitcoin.
I don't understand the mentality that "those who want to support and use it can do so". Shouldn't it be a good thing and the highest priority for everyone involved in Bitcoin to enable "lightning fast" (pun intended) transactions that cost next to nothing, which may exist in some kind of "limbo" for a while until they are settled using standard/real Bitcoin transactions?
I have the feeling that I could be sitting here and on my hands waiting for another several decades without anything happening in terms of Lightning getting adopted/user-friendly/integrated into Bitcoin. I can't wait that long. In fact, my current project is in sore need of instant and almost-free transactions. And, given the situation, I don't understand how I'm going to get a single customer.
Can somebody offer some kind of comforting news in relation to this? I have zero desire to use/support any of the "altcoins", including Ethereum. The same basic problems of low adoption and added complexity/no trust applies to those too. To me, there is only Bitcoin.

There are lots of lightning node/wallet implementations. You don’t like the look of electrum? Fine. Choose one of the many others.

@chytrik Please read before responding.

I did read, no rudeness intended. bitcoin-core does not need to encapsulate every possible functionality of higher layer protocols, and in fact doing so may present a security concern (which is a major downside). Luckily, there are many other lightning implementations to choose from, which are well-maintained and reviewed, and under active development. If you are in need of a business solution, look at something like btcpayserver + LND or c-lightning for added lightning integration.

Does this answer your question? Does, or will, Bitcoin Core support Lightning?

Something about this doesn't add up to me. Either this is a revolutionary technology which should indeed be part of Bitcoin itself, or it's some sort of very ambitious and honest-sounding scam or attempt to take over or destroy Bitcoin.

The mentioned book should also say somewhere that the lightning network is a protocol built on top of Bitcoin or a very creative and non obvious way to use bitcoin.
Let's take a comparison with some other more known software and communication protocols to understand what that means:
The world wide web (http) is a protocol on top of the internet (tcp/ip). That does neither mean that the world wide web "should indeed be part of" the internet nor that it is "some sort of very ambitious and honest-sounding scam or attempt to take over or destroy" the internet. Many people love the world wide web so much that the term is actually often confused with the internet. People say they surf on the internet when they actually browse the world wide web.
However many people don't need the world wide web to find value of the internet. For example Bitcoin is build on top of the internet not on top of the world wide web. While Bitcoin might have worked using http requests for communication it was just more convenient to implement a communication protocol on top of tcp/ip. Thus it is very good that the internet exists as is and http like Bitcoins offer various ways of using it.
Thus (as with Bitcoin and lightning network) it is good to have the more general technology kept clean and stand alone. Not every application and protocol build on top of Bitcoin should be a direct part of Bitcoin. That doesnt make it a scam either. Similarly with the internet. Separating tasks and applications is what helps to keep software working and secure and while I feel for all your requirements I believe if the security of neither Bitcoin nor lightning network was given in principle we would not even have this discussion.

Actually good points, but still, at the end of the day, we are in a situation where the "base" Bitcoin is only good for "digital gold". And I say that as somebody who truly don't want this to be the case; I want it to be used as a currency as well.

I disagree but this site is not about opinions, speculations of the future or believes. Thus I will not elaborate why I believe that the lightning network protocol will be crucial to help Bitcoin achieve becoming a currency

I don't understand what you disagree with.


text:
What are the economics of confirming a block of transactions?
From what I understand, CREATING a block to confirm or verify transactions is hard work, and is rewarded with 25 bitcoins, or something like $12,325 (depending on the daily exchange rate). But how do the economics change afterward?
Is it a case of "high fixed costs (to create the block), low variable costs (to follow the path of a particular set of bitcoins)? Suppose you take a single bitcoin and carve it up for numerous smaller transactions? Is this economically feasible because the forward-going costs are low after you've absorbed your fixed costs creating the block? Or is this kind of transaction where confirming it is likely to cost more than the transaction is worth?
Edit: In searching the literature on the site, what is described in the paragraph 2 appears to be the case. This link, explains how a person earns 25 bitcoins creating a block. What does a person do to earn the .03334571 bitcoins (about $16) as a commission in this link?

Mining a block (also called confirming) is not dependent upon the number of transactions in the block. A block with a single transaction is just as hard to mine as one with 1,500 and earns you the same reward.
In addition to the reward, miners can claim a fee, which practically is the difference between the sum of the inputs and the sum of the outputs. The rule to compute whether a fee is required can be a little complicated. The person issuing the transaction is free to include a fee or not but a transaction that doesn't may not get confirmed.
Finally, the mechanism by which reward and fees are claimed is by inserting a transaction in the block, in the first position, that sends the total amount to the miner's public address. The network validates it with all the rest.

Welcome to the site. An upvote for a good answer.


text:
How do mining pool operators work?
How does one get to be a mining pool operator? Is there an election by people who want to pool their computing resources? What checks and balances exist to ensure that a pool operator doesn't misappropriate funds?
This question was inspired by my comment, and a response on this question? What prevents miners in a pool from retaining the reward?

You, the miner, are the one being paid by the pool operator for doing some computation. It's a free and open market. You can switch pools if you're unhappy with the reward or the honesty of an operator.
To become a pool operator there's no election process or formal checking whatsoever. Again, it's a game based on reputation. Just like any other business, if an operator misbehaves (by stealing funds or something), they lose reputation and therefore users.

On Traditional Pooled Mining: How miners choose which nonce to try to create different solutions between each other? @Luca Matteis

Its totally open to anyone! You can create your own mining pool and get miners based on your reputation. Miners getwork from mining pools and submit their work to the mining pool and get their payouts. There are different types of payouts like PPS, PPLNS and ...
There are new mining pools like P2Pool which is totally a decentralized pool and it doesn't have an operator. You might be interested to check those out.


text:
What would happen if there are more blockchain imitators like Factom?
I was referring to this question.
Apparently Factom creates its own "chain" for timestamping purposes, "hashes" the entries, and then stores these hashes on the blockchain, to create an unalterable record.
What would happen if "everyone" in the world did this? Could the blockchain support a million (or a billion) more "Factoms?"

It's, by definition, not an "alternative chain" (it can't do without the Bitcoin blockchain, see answer). More like a "dependant chain" or "child chain" or something like that. So it's not actually Factom that is doing the timestamping (it would need Proof of Work to do that), it uses Bitcoin to do the timestamping. It simply bundles a lot of facts into one hash that gets timestamped on the Bitcoin blockchain.

@Jannes: took out the "alternative" part.

Factom stores data in a blockchain that's maintained by their network of federated servers. Tierion lets you create a verifiable record of any data or business process by anchoring your data to the blockchain. No altcoin required.
We've created an open standard called Chainpoint for anchoring data in the blockchain. Like Factom, we use Merkle trees and periodically insert a transaction containing a Merkle root in the Bitcoin blockchain. Unlike Factom, we give you a blockchain receipt that can be stored in your local database and shared with other systems. You stay in control of your data.
If you build an application on Factom, you're dependent on the Factom blockchain.  If Factom fails, your application stops working. You have to continually acquire Factoids to write data to Factom.  With Tierion, your data and your blockchain receipts can be stored anywhere - even in another decentralized datastore.  There is no long-term dependency on Tierion.
I suspect that we'll see many approaches to anchoring data to the blockchain. Each approach will differ to accommodate various use cases. For example, Blockcypher has a free API call that allows you to store data in OP_Return, and Stampery has a product for notarizing documents in the blockchain.
Disclosure: I designed the Factom Explorer and played a key role in the launch of Factom.

Welcome to the site. Glad to hear from an expert.

Since any data included in Factom is cryptographically linked to its anchor in Bitcoin (entry->entry block->directory block->bitcoin anchor), you can create blockchain receipts for any data on Factom as well.

Factom is a distributed protocol.  Many independent servers will run the protocol, and it will run even if some fail.  With centralized solutions, your applications depend on Tierion the company.  No company, no support.

Factom is censorship resistant.   Commits obligate the protocol prior to reveals of your data.
Factom has no terms of service you must agree to like Tierion.  You cannot be cut off from the protocol with Factom like is possible with Tierion.
Tierion is a very nice product, and many people will use their services.   Others may find Factom more useful.   Depends on the application.

Factom does NOT require the purchase of factoids to use the protocol.  You can use Entry Credits (which are basically a credit balance that isn't transferable, so no need for a wallet) to access the protocol.  Factom also creates cryptographic proofs to your data, so your data is secured by Bitcoin over time, not Factom.

The way Factom works, they store the merkle root of the various hashes on the blockchain in an OP_RETURN output. This amounts to 80 bytes in the OP_RETURN and the actual transaction is going to be on the order of 500 bytes. The way they scale is that they store the actual merkle tree elsewhere and only put the root into the blockchain, about once per block.
Assuming that everyone uses Factom, this would mean that the blockchain would only get one Factom transaction per block, which is what it's already doing. If there were a million other services using OP_RETURN, then no, currently, the block size is limited to 1MB per block, which can only take about 2000 such transactions per block.

The question was (partly) "Could the blockchain support a billion Factoms?" The answer to that would be no, but it doesn't need to (as Jimmy's answer explains and any it's cheaper to combine facts into one or a few "Factom-like services" than into a billion, as every timestamp requires Bitcoin fees. So it will naturally gravitate to only a few services.

If you run "Factom on Factom" there is no real limit to how much data you can secure.  So if you run a fork of factom, and anchor into Factom, there isn't much of a limit to how much the anchors (~13 Meg placed into Bitcoin by Factom) can secure.

Disclosure: I'm a senior developer at Factom.
What you are describing is essentially BitPay's ChainDB - a cryptographic chain of records anchored into the Bitcoin blockchain. Since systems like Factom or ChainDB would ideally only include one anchoring transaction per block into Bitcoin, your upper limit as to how many chains can co-exist is the transaction limit on the Bitcoin blockchain.
However, since such systems should provide cryptographic proof that any data included in them is also included in the Bitcoin blockchain, there is nothing stopping you from creating sub-chains - anchored into Factom or other chains, which are in turn anchored into Bitcoin. The cryptographic proof should work on sub-chains, sub-sub-chains and so on ad infinitum (although the proofs would be getting longer each time). This means that in theory there is no limit as to how many chains can exist, provided you are okay with some of them being moved down to a lower level.


text:
What would happen to people's money if the Bitcoin project was discontinued?
Here in the Arabic world the biggest problem with online trading is the absence of a good, secure, and flexible money transfer tool or solution. I think Bitcoin is a great solution for this. I have an idea to start a payment processing service using Bitcoin in the Arab world.
I need to know what would happen if the Bitcoin project was discontinued for any reason.
What would happen to people's money?

Note that only Bitcoins you hold are at risk. Depending on the way you set up the system, Bitcoins may not need to be held by anyone for any significant period of time. And, of course, if you hold them, they may also increase in value.

OT: Good luck with your project!

@DavidSchwartz if you hold them they may also decrease in value

Incidentally, there is a payment processor in the region: https://en.bitcoin.it/wiki/Karsha_Shopping_Cart_Interface

I think you have a misunderstanding besides. Bitcoins are not a way of storing money that is in a conventional currency like dollars or euros or pounds, it is a separate currency. So, if you buy bitcoins, your conventional money isn't "stored" anywhere, it goes to the person you bought it from and you are counting on being able to sell or spend the bitcoins later.

Bitcoin exists on a few levels. One is the protocol which evolves through a proposal process. Second is the Bitcoin client and bitcoind project which is an implementation of the protocol. Third is the currency managed by what's referred to as the Satoshi-blockchain. All of the above are available under free software licenses or are, at the very least, public information (in the case of the blockchain and protocol). It is therefore unlikely for any part of Bitcoin to be meaningfully discontinued.
Should everyone in the world stop using Bitcoin, the transactions and private keys to spend again would still exist so you could say the money will stay right where it is. The exchange rate wouldn't fare well but the Bitcoins would all just be there in deep freeze until someone started mining again. Once you know more, you'll see how unlikely any kind of discontinuation would be.

Yes, if everyone stopped using bitcoin and you started with 100btc you would still have 100btc, of course it would not be worth anything just like say the Zimbabwe dollar is not worth anything

Bitcoins are stored in the blockchain. As long as at least one person holds a copy of it, all Bitcoins will remain in place no matter how many people are in the network or if new software is still being developed.
As the main client is open-source, even if it was discontinued anyone can pick it up and continue development on their own. Even if that was unavailable, the Bitcoin protocol is not too complicated, so one could create a new client from scratch if needed be.
Lastly, the main client is pretty mature at this stage, so even if no further versions were developed, it could provide enough functionality for a long while.
All in all, as long as you store your own copy of the blockchain and a client, your money is completely safe, at least in regards to the amount of it you have. The value of the stored Bitcoins, however, can always drop or rise regardless of the state of the project, which is another factor to consider.

... up to possible inflation if Bitcoin usage drops for some reason.

@ripper234 Well, that is true for anything really, dollars, gold, etc.

I think you have several main risks/issues
1) Local political risk. Some government decides that using bitcoin breaks some local law and makes your life hard. That is beyond the scope of this site I think.
2) A collapse in the value of bitcoin. We have seen the price of a bitcoin go all over the place and while it is about $5/btc now it is very hard to predict what it will do tomorrow. It could be $20 or it could be $0.20. Now that does not mean that bitcoins have gone away, just that they have lost much of their value. At this point the total number of people using bitcoin is quite small and there is HUGE volatility in the market because of a general lack of liquidity.
3) Converting Bitcoin to and from local currency. If your goal is to transfer money from one country to another you need a way to use currency 1 to buy bitcoin and then use bitcoin to buy currency 2.
4) The bitcoin market is not very efficient, which is to say that if you want to change say Jordanian Dinars to say South African Rand by way of bitcoin you may find that you end up with a lot less Rand at the end than had you done it some other way.

I agree with https://bitcoin.stackexchange.com/a/3095/807 in that the biggest risk is in exchange rates with fiat currencies, rather than any "the Bitcoin project is discontinued" scenario.  Even since I began last year it's been way too volatile and have way too large bid/ask spreads on exchanges for me to rely on in any substantial values.  Not to mention on top of that, the percentage fees some party cuts almost every step of the way.
While one can't feasibly swap out every copy of the current blockchain in the world with your own copy, or with a blank copy (which would be like erasing everyone's balances), let's turn your question into: let's say by next century Bitcoin gets superceded by an entirely new and better government-free, decentralized currency, built on new standards and protocols obsoleting today's, that quickly becomes predominant.  People would gradually cease using BTC in favor of the new one, it seems.  Not sure if comparing legacy Eurozone currencies transitioning to the unified Euro is a good comparison.

Bitcoin has a dependency in that its hashing power must remain decentralized (no single party or cartel controls the majority of hashing power).
While the geographic distribution of this hashing power isn't easily identifiable, know that it will tend to gravitate towards where electricity is less expensive.  Here's where Bitcoin nodes exist today:

http://www.weusecoins.com/globe

So even if those in one jurisdiction or region discontinue the use of bitcoin, it will likely still have utility elsewhere in the world.  When using a local wallet you are peering with these nodes, so there is no risk that those in a single geographic area would lose the ability to participate.  Even in a network environment that is relatively hostile to bitcoin there are measures that can be taken to maintain connectivity to the bitcoin network.
But do keep in mind that the value of a bitcoin is entirely based on the price others are willing to pay for it.  That value can, technically, go to zero -- just like with any other commodity.

The Bitcoin project cannot be discontinued as such.
Bitcoin is not a company and if the core development team for some reason just decided to stop working on the project, anyone else could continue as they were. In fact although the core development team is regarded as the "main" developers of Bitcoin, all changes made by the team need to be approved by a majority of the community and miners, before the changes can take effect.
Even if development completely came to a halt and no one proposed any new changes, it would not kill Bitcoin necessarily as long as the miners and other ecosystem are still in place. And as long as it still has uses then it will still have value and the miners will still mine.

I think your question is about trust. You may rephrase the question asking if you should trust the Bitcoin network. Bitcoin is backed by the unique intrinsic and mysterious properties of mathematics instead of faith in human institutions. Technology will spawn to serve Bitcoin to make it stronger as we are already seeing with GPU, FPGA and ASIC processors.


text:
Bitcoind statistics
I need to get some values to find how updated my bitcoind client is.
For example, I would like the GUI to tell me:

If it is up to date.  If not, show blocks/total blocks
How many blocks have been downloaded
The time that the last received block was generated.

Are there commands available in the JSON API to get this information?  Or how else can I achieve this?
Regards

I was under the impression that version 5+ of the client (bitcoin-qt) offers all these capabilities. Am I wrong?

The client can't possibly tell if it's up to date in terms of blocks. The only way the client can know a block exists is to validate it. The only way to validate a block is to have it already. The client has no other mechanism to become convinced that it's not already current. (The exception would be if there was a checkpoint ahead of it.)

How does Bitcoin-QR know it is "out of sync"? And it also says something like ~24 block(s) remaining.

You probably need to read:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
You'll probably like the methods getblockcount and getblocknumber.
I don't think the API can give you the latest blocknumber until it's been updated, but you can find it on http://bitcoinwatch.com/ -> blocks -> count.

more details ( from #bitcoin-dev on IRC, thanks to sturles ) :  the client can't know for sure until all the blocks are verified, but it can report what other clients claim they have.  A malicious client can report arbitrary numbers to your client, so the bitcoin client can not be sure until the last block is verified. It can also make a guesstimate based on the current time and the age of the last verified block.

so your best guess will probably be to get the latest block number from a trusted provider ( bitcoinwatch.com is just an example)

Thanks for your reply.
I read that API command list but it is pretty vague.
The whole idea of doing this was to avoid using any 3rd party :(
How can I make a guestimate?  How can I get the last verified block?
Cheers.

you have no way to be sure of it until your local client have verifieds all the blocks; other clients can lie to you, but having a look at the client code and debug.log, you could find that other nodes are sending you messages like "version message: version 32300,blocks=170346", they tell you their version and blockcount, you can ignore old version clients and decide that all the latest version ones should have the latest block.

having this option ( downloaded XXX/YYYY blocks ) could really be useful for bitcoin users, if you can implement it as an API call, please fork https://github.com/bitcoin/bitcoin and send a pull request to share your good idea with others !


text:
Public key with 142 characters?
I've read that public keys that bitcoin uses have 130 characters (65 bytes), but on the page: http://blockexplorer.com/tx/7e9bf03454b9ff80974d39d02a8088154e60ee65726e239f70341366d1a1ccf7
I've found a public key: 30440220fe5322474a08626beac8fd44b9854fa3af52c14848993a9216b18b29793539f40220dd66a46dc1daa3d0d33fae22b7cc8ee3c753b062cc2e1a3be76183ee1f9dbbcb01 (140 characters), in addition the public key doesn't start with '04'.
There are a lot of keys with 140 characters. Is https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses wrong or have I missed something?

The public key is the 2nd word in the scriptSig but you're looking at the first word.  That's the signature.  Signatures are 71 to 73 bytes (142 to 146 characters) long.  I think you must have miscounted when you wrote that the one you found had 140 characters.
In the example you're looking at, the public key (i.e. the 2nd word in the scriptSig) is:
04
73769dda763e1f3f0ff1ca65343ed27279d73a63eaf88ca93714f0605d5d06bd
6d57cc6c3097909c5e0947341201d4960e4e16598687aa29c7b6c4675b7d66b6

and is 65 bytes long, as expected.


text:
Ho do I generate the output script of a bitcoin transaction?
When I mean output script I mean the output script from step 11 from this question:
Redeeming a raw transaction step by step example required

Then the actual output script: 76 a9 14 a2fd2e039a86dbcf0e1a664729e09e8007f89510 88 ac ( this is transferring funds back to address 1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc )

In this example the responder used Pkscript from the input of the previous trasaction. However there is no explanation how the hex "a2fd2e039a86dbcf0e1a664729e09e8007f89510" is generated itself. I'm asking because, I don't know what I would insert if I want to use another address as output. As I understand (maybe not) this hex is somehow generated from the bitcoin address "1FromKBPAS8MWsk1Yv1Yiu8rJbjfVioBHc". Is this correct? And how is it done?

This is a P2PKH (Pay-to-public-key-hash) address which means a2fd2e039a86dbcf0e1a664729e09e8007f89510 is the hash of your public key. Here is a step by step guide on how to go from public key to address

Thanks for clarification. But as I understand there is no way, how I get a P2PKH out of a bitcoin address. Because the bitcoin address (not the public key) is the only information I get from the receiver, I still can not see how I would get the P2PKH.

Hmm, it looks like I just have to base58 decode the btc adress which results in "00a2fd2e039a86dbcf0e1a664729e09e8007f89510c5214deb", don't know what the numbers before and after stand for but I can work with that.

I hope that this value is even the right value because at the second answer of https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required someone claimed that specifically this value ("a2fd2e0....") was not correct.

if you add the base58 decode info to your answer or clarify the solution , I will accept it.

So, I know have fully understand why there was another value than the "a2fd2e0....". The second responder just used another target address for the transaction. So base58 decoding is the solution.


text:
Incoming transaction has been marked as pending since 2013. How can I retrieve it?
I requested BTC from someone back in 2013. Its been in pending status ever since. It has nearly 500,000 confirmations. The value of transaction when initiated was only $200 or so. Now the value is over $40k.

How can I get the transaction to finally clear?
Can the BTC be stolen or redirected elsewhere to another wallet?

The good news is, if your transaction really has 500,000 confirmations, it's definitely not "pending". It is as "cleared" as it will ever be, but your wallet may be confused. Please give us more information about: what bitcoin wallet / software you are using; where you see "pending"; and where you see "500,000" confirmations (a block explorer?)

Its on Coinbase. It says pending in my wallet history within coinbase. I see nearly 500,000 confirmations in the blockchain explorer.

Ah, I see. Unfortunately the only people who can help you with that are Coinbase support. There's nothing else you can really do about it.

Coinbase support is a total joke. All they do is lock me out of my account, make me reset my password, try to log in, lock me out of my account, tell me to reset my password, etc. Its just a huge loop! The only recourse is to file a complaint about the open ticket and wait an indeterminate amount if time for a response.

Just to clarify how Bitcoin works:

How can I retrieve it?

You don't ever really retrieve Bitcoin money, it is always kept track of in the list of transactions that almost every Bitcoin user has their own copy of (or access to a trusted copy).
This list of transactions is a transaction-journal that is called the blockchain, but it isn't owned or controlled by any of the businesses that use the words blockchain or bitcoin in their name. Bitcoin was designed so that you don't need to use that sort of business, it was designed to do away with trusted intermediaries like that.
With a normal wallet, the wallet will keep track of the amounts under your control, If the transaction has 500,000 confirmations but your wallet has the amount marked as "pending" then there is something wrong with your wallet.

How can I get the transaction to finally clear?

Bitcoin transactions are never cleared. Clearance is not a thing in the Bitcoin network. Having more than 6 confirmations is the equivalent of being cleared.

Can the [BTC] be stolen or redirected elsewhere to another wallet?

Only by someone who knows the secret number called a private key that your wallet was designed to hold and protect.
Your money is safe so long as you are the only person who knows either the secret number or the "seed phrase" AKA "recovery phrase" AKA "backup phrase" from which that secret number can be calculated. You will have one of those two things written down somewhere as safe as the place you keep your regular backups of your wallet (i.e. not on your PC).
Bitcoin money is never really redirected in that you can't intercept it in transit (it is never really in transit). The recipient of the money can issue a new transaction to move the money elsewhere but that requires a wallet that knows the money is no longer "pending".

Update/Addendum based on comment to another answer:

Its on Coinbase. It says pending in my wallet history within coinbase. I see nearly 500,000 confirmations in the blockchain explorer.

The you likely have what I would call a bitcoin account and not what I think of as the normal sort of wallet. How exactly that account works is not part of the Bitcoin network or specification - it is an internal matter for that business. You'll need to ask Coinbase customer support why your account shows the amount as "pending" despite the 500,000 confirmations.
Check that you are accessing the website of the real Coinbase company at coinbase.com and not the website of some fake business like coińbase.com (with an accented n).

Thanks. I am concerned it may be stolen because an alleged btc day trader investor found me through linked in, and they have been sending me desperate emails like this for days....

@SD  Any BTC  day-trader/investor who sends desperate emails to strangers in LinkedIn is not what they claim to be but is almost certainly a scammer.

lets start at the beginning.
can you see the transaction going into your wallet by checking a blockchain exlorer like blockchair?
If you are 100% sure the transaction was sent to your address, and you have the private keys in your wallet for that address, it should be fine.
There are ways to clear the transaction, but I don't know what wallet software you are using. Are you using the Bitcoin Core wallet?
If so, you should first of all make a backup of the wallet.dat file and, you can start the software with the -zapwallettxes=2 parameter. This will try to clean up stuck transactions.
Hope this helps a little bit!

It was on coinbase. I have no idea what you mean when you say zapwallettxes=2 parameter.

So what does that mean?

you are using Coinbase, so you don't have the private key. -zapwallettxes=2 parameter applies to a BTC Core wallet, with wallet.dat. You should ask Coinbase about this


text:
How to findout the sender of a transaction
How do I find out which addresses are the inputs of a given transaction, given its transaction ID?
I know there is a way, as satoshidice.com uses this.
I would like to do this with own software and not rely on some third party provider, which could easily kill their service.
EDIT:
Basically I'm creating a PHP project, where I need to find out when a new transaction arrives and which address sent it. So I need a way to get a notification or start a PHP script (called with needed variables [txid, sender address, receiving address, value]) when a new transaction arrives.

I edited your question to tidy up the grammar and spelling, but also fixed the assumption that there is a single "sender" address.  It's quite possible that the transaction has multiple inputs and multiple outputs, so there's no single "sender".  SatoshiDICE doesn't care; it just sends the winnings to one of the sending addresses.

I just answered a similar question. The relevant parts are:
It is now possible to determine the list of addresses that sent a transaction using the raw transaction JSON-RPC API calls that were released with bitcoind and bitcoin-qt version 0.7. The pseudo-code to accomplish this is:
txid = <relevant transaction id>
addresses = []
raw_tx = decoderawtransaction(getrawtransaction(txid))
for(input in raw_tx['vin']) {
  input_raw_tx = decoderawtransaction(getrawtransaction(input['txid']))
  addresses.push(input_raw_tx['vout'][input['vout']]['scriptPubKey']['addresses'][0])
}

Trying to find out the same thing, your  "decoderawtransaction(getrawtransaction(input['txid']))" instruction failed at first. However, the problem fixed itself and your example worked after I waited for raw_tx['confirmation'] and raw_tx['blockhash'] to be defined.

this basically scans through the blockchain for the output transaction corresponding to the hash value in the later input-transaction. is there not a way of getting the answer using the input scriptsig though?

Asked a question related to your pseudocode. Would appreciate if you can take a look.

Note that if your wallet did not sent the previous transaction, you will need to enable txindex=1 in bitcoin.conf to track non-wallet transactions. Otherwise, the call to getrawtransaction will fail

The Bitcoin.org client doesn't provide this.
I believe your options are:

Armory
libbitcoin
ABE blockchain explorer
BitcoinJ http://code.google.com/p/bitcoinj

i thought about using ABE but i were told uses about 1,4GB of ram, which is just to much for my "small" vps with 2GB of ram in total. Are the other more "lightweight" ?


text:
Can Bitcoin blocks be organized into shards?
Bitcoin Scalability is a hot topic.  In database architecture design data is segmented into shards or the data is partitioned such that it can be spread among large number of machines.
In the financial world, credit card companies like Visa have to deal with thousands of transactions per second.  To deal with this volume credit card processors will use the Date as a shard key.  This allows for the credit card processor to group all transactions made in a set period of time and a set of machines are made responsible for a month of transactions.   Is this sharding tactic compatible with Bitcoin blocks?   Or more generally what if Bitcoin was as popular as credit cards?  What kind of techniques would Bitcoin be forced to use to cope with the scale of the problem?

I gave it some more thought - this is the result: https://bitcointalk.org/index.php?topic=88714.0

If you mean whether block verification can be distributed so that one entity can participate without storing the entire blockchain, this isn't compatible with the current design, but maybe a new design can do that. Also, suggestions such as this aim to improve the ability of lightweight (SPV) clients, who do not store the entire blockchain, to verify transactions concerning them specifically, without changing the core protocol.
If you mean whether a single entity can distribute the blockchain among several machines on the same LAN, then this is possible. The basic operation needed for block verification is to look up the details of a previous output, so the natural sharding key would be output hashes. One could also cache the newest outputs which are the most likely to be used in the following transactions.

Now that I think about it, perhaps N different (but very similar) blockchains could be created. If an easy API existed to trade between the chains in a secure, atomic way, then you could send money between any two chains by trading to the target chain first and then sending a normal tx.

https://bitcointalk.org/index.php?topic=88714.msg977222#msg977222

I don't think it will work.
I don't understand what you mean by sharding by date. The bitcoin analogy would be sharding by block-number ... but that is already the case ... every block is worked on separately. The thing is, every block depends on the previous block, so a miner has to keep some record of the entire blockchain history.
I initially thought you meant just sharding by "shard ID" - splitting the blockchain into N independent chains, where a miner can decide to work on "subchain 137 out of 1000". This idea won't work because every Bitcoin address must be able to send money to every other Bitcoin address. So, in order to mine only one shard, you still have to know the state of every other shard, because there will be transactions linking these shards (there could also be tx linking multiple addresses split between multiple (>2) shards).
Lastly, if you aren't suggesting a fork in this question, but just asking about techniques to process the existing chain structure using shards ... yes, the blockchain's data is shardable, it could be sharded by address. A miner would still have to process each new block, but its data set could be stored on a Redis cluster instead of in the memory of a single machine.
Update - then again, maybe I was wrong. Here are my latest thoughts on the matter.

maybe you should read about sharding before posting.

There is nothing so special about the data in the block chain that this cannot be done, but at present I know of no client which implements such a thing. BitcoinSharp, BitcoinJ and the default (Satoshi) client all use different database types and there's no reason you couldn't make a client that used still another database type.
So at present, no, it's not possible with off-the-shelf software, but there's no reason it couldn't be implemented as such if scale became an issue, or even implemented today as a proof-of-concept.

OP might have meant changing the Bitcoin protocol to allow each miner to process a particular shard, easing/solving its scalability requirements. See my answer.

The blockchain system IS a distributed database with its own architecture.

It would be possible in a few areas:
Storing the block chain on a server could be done in the same manner any data is stored - be it in one places or in many. This would be trivial from Bitcoin perspective.
Transmitting the data could also be partitioned into shards should a small change to the protocol be made - allowing one to request a block header with the information about the full merkle tree. This way one would know exactly which transactions are stored in the block without the need to know everything about all the transactions. The rest of the data could be fetched as needed from other places. This is similar to pruning the block history.
Preparing the blocks for mining could also be handled in a similar way, but it would require more trust from other nodes. A pool would only request the transaction hashes from other clients, not really needing to see the entire transaction in order to include it in the block header + merkle tree structure. The only downfall of this would be that someone could sneak in a few invalid transactions in this way, as there would be no data checking. So all in all, the pools that would wish to operate on seeing only part of the data would probably have to limit themselves to including transactions they have seen. This would mean that some transactions might take longer to include than others, depending on which pool has seen them.
All in all, Bitcoin's data could be partitioned with only small changes to the protocol, but that would require a lot of consideration first.


text:
What exactly happens when a new wallet is created?
I am asking for what is being created when there is a new wallet created.
And the second part of my question is considering public key. Is the public key the same thing as the address? I read that there is for every private key a large pool of 100 adresses. Every adress is used when sending any single transaction and "creating" new adress.

There are many types of wallets and clients, each of which can operate in a unique way regarding how it stores and manages the wallet.  You may wish to clarify that you are inquiring specifically about wallet for the Bitcoin.org client.

For each private key corresponds a public key, and an address is the hash of a public key. There is no pool of 100 addresses -per private key-, rather the wallet has a pool of 100 private keys, each of which corresponds to an address. (This is referring to the standard client)

Your wallet is a collection of private keys and a record of the transactions relating to them.  By default your wallet has a key pool of 100 keys.  So when your wallet is created, around 100 private keys are randomly generated and stored in your wallet.
Each private key has a corresponding public key, and each public key has a corresponding address.  A public key isn't "the same thing as" an address, but there is an algorithm that can give you the address corresponding to any given public key.  The reverse isn't true.  There are many different public keys for each address, since public keys are 256 bits wide and addresses are only 160 bits wide.
When you click 'new address' in the 'receive coins' tab of the client, it will show you an address you've not seen before.  It is taken from the 100 address keypool.  The keypool is topped up when possible to always contain 100 unseen addresses.  If your wallet is encrypted then it's not possible to top up the keypool until the wallet is unlocked with the passphrase.
Also, when you make a transaction out of your wallet, it's quite likely that the amount you are sending doesn't exactly match the sum of any of the inputs you currently have private keys for, and so some 'change' needs to be sent back to your wallet.  When this happens an address from your 100 address keypool is used to receive the change.  In this case the keypool will be immediately topped up, since your wallet will need to be unlocked since you're spending coins.
This all happens behind the scenes - you won't see any evidence of it happening unless you look at the blockchain.

When you create a new wallet you create 100 new private keys. From these can be derived the public keys and the "address". The keys are created randomly, so could in theory be the same as one already in existence, but that is so unlikely it will never happen.
Difference between the public key and the address is that the address is a "hash" of the public key along with a checksum added (so you can not mistype it) and is converted into characters that can be displayed and copy/pasted easily (base58).
Technical details are here: https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses
The only reason that 100 addresses are created is that when you backup your wallet, you will have saved the next 100 address you will use. So even if you do some transactions then lose the wallet and have to restore from backup you should still be able to get your bitcoins back (assuming you used less than 100 addresses since the backup).

Good point recovering from the backup! Note this is a double–edged sword: if someone steals your backup (or access your osx time machine at a point where there was no encryption!), your future transactions will be stolen too.


text:
What public data sets are available that could used for correlation in bitcoin analytics?
What data sets exist out there that can be used for engineers to perform statistical analysis against? Hopefully this data is not needing to be scraped, but is available in an importable format or API, though I am open to suggestions on data that APIs need to be written for.

ok, did that...

Historic trade data is available from the Bitcoin Charts Market API
Bitcointalk.org forum stats, impression stats for ads, e.g. new member sign-ups per day
Google Trends data for bitcoin. (Can be exported as a CSV file with links at bottom of the page)
Blockexplorer.com stats query page
Blockchain.info API
The Bitcoinstatus.RowIT page has graphs on the number of bitcoin hosts connected, client version and data on hosts/country. Don't see an API but some data is in tables so probably easy enough to scrape.
Chris Moore's answer to this question provides a lot of useful stats.
Of course the blockchain itself.

Quandl has many bitcoin data sets.  Here is a collections page of them.  On top of that , it has almost any other time series data you can imagine:  Everything from Stocks, fundamentals to diabetes and fertility rates.  What I love is that there is one easy API to access all of this data, so it is very easy to cross-compare the data sets  There's also an Excel tool if programming is not what interests you.

Mt. Gox trades as Google Fusion Table

https://www.google.com/fusiontables/DataSource?snapid=S364820JWm5

As far as a "wish list", knowing the count, mean, median and average of bitcoin addresses and their "balance" after each block would be useful for knowing over time traction.  By itself it might not reveal all that much to us but it may correlate to other data or indicate a trend that other data doesn't.
An update is done monthly to:

https://docs.google.com/spreadsheet/ccc?key=0AmcTCtjBoRWUdHJuUE1mUkFxa3A0eHBDQkxZLVVFZmc


text:
P2P getHeaders message - how to get block locator hashes
I'm trying to build my own block explorer
So that I need to use p2p bitcoin protocol. For that I'm using btcd (golang) lib.
According to bitcoin book I have to send version message (and receive verack message back) to init the connection, then I will send getheaders message in cycle.
Now, imagine I am a new peer and want to download all the blockchain (actually I want to receive block hashes with getheaders (2000 per tick) and for each block hash I want to receive a block itself to process it and put blocks data in my mongo database)
If I am new peer in the network, how should I send first (and next) getheaders message, I don't quite understand where should I get block locator hashes and how to form the message?

Block locator hashes are just the hashes of various blocks that you already have. As a new peer, the only block that you will have is the genesis block (the genesis block must be hard coded into your software). So you just send a getheaders message that only contains the hash of the genesis block.


text:
Bitcoin core make error
I am new to bitcoin core development.  I have created a clone using bitcoin core on a mac os mojave 10.14.3. I am have installed all dependencies and am able to run the autogen.sh and configure with no errors. However, when I run make I am getting the following error.
/opt/local/bin/ranlib: object: libbitcoin_server.a(libbitcoin_server_a-addrdb.o) malformed object (unknown load command 1)
/opt/local/bin/ar: internal ranlib command failed
make[2]: *** [libbitcoin_server.a] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Kindly help.

macOS Mojave changes how the header is serialized in the beginning of the executables. Maybe you could tell us how you installed the dependencies (using brew?) and the version of the compiler?

Actually, both brew and macports were present in my system. I uninstalled macports and after that make successfully went through, although several warning were generated. Thank you for your help!


text:
Script Bitcoin represent number > 16
I'm studying Script language, but I don't understand How can I rappresent the number > 16, for instance 210
I want to do a simple sum
OP_10 210 OP_ADD

how I have to represent 210?
I'm trying with OP_PUSHDATA1 without lucky.

You only need to use OP_PUSHDATA1 if you are trying to push more than 75 bytes of data onto the stack.
For pushing smaller sized values onto the stack, you can use the opcodes 0x01 to 0x4b to indicate the number of bytes being pushed. Thus, to push a single byte of value 210 (0xD2) onto the stack, you would use the byte sequence 0x01 0xd2.
To push a 16-bit number, such as 1000 onto the stack, you would use the sequence of bytes 0x02 0xe8 0x03. Note that little-endian byte ordering is used. You can do similarly for a 24-bit number, or 32-bit number.
The minimum size should always be used when pushing a value - meaning the most significant byte of the pushed value should never be zero.
The value pushed will internally be zero-extended to a represent a 32-bit signed integer. All of the numeric operations in bitcoin script are limited to 32-bit integers. The result returned by a numeric operation can be treated as a signed 64-bit value, but values which overflow the 32-bit integer range may not be used in subsequent numeric operation.

On OP_PUSHDATA1, this is used for pushing arbitrary binary data onto the stack which may be used as arguments for operations such as OP_SHA256. This works by having the first byte of the sequence being OP_PUSHDATA1, the second byte being the length of the pushed data, and the remaining bytes being the content. For data more than 255 bytes, OP_PUSHDATA2 is used, where the second and third bytes of the sequence represent the length, and so on. The minimum size rule applies to all of the kinds of pushes, including that you should not try to push a single byte <=16 onto the stack using 2 bytes, but should instead use the OP_N single-byte opcodes.

Thanks for your reply. I want to replicate 10+120=130.
With your suggestions my script is OP_10 0x01 0x78 OP_ADD 0x02 0x8200 OP_EQUAL.
But how can I replicate in hex or asm?

reference implementation will encode 210 this way 02d200 - only values up to 128 are encoded with one byte 01XX

To push data to the stack, if there is no opcode (i.e. there is no opcode for the number 210, but there are for the numbers 1-16: OP_1 - OP_16), you need to provide a push op. Since 210 can be represented in a single byte:
OP_10 0x01 210 OP_ADD
  ^    ^    ^    ^
  |    |    |    | pop the top 2 items, add, and return result
  |    |    | Push number 210 to the stack
  |    | The next 1 byte is pushed to the stack
  | Push 10 to the stack

See https://en.bitcoin.it/wiki/Script#Constants

thanks for reply, but I don't understand a little thing.
If i want to do 10+210, my Script is OP_10 0x02 0xD200 OP_ADD.
Instead if I want to do 10+130, my script is OP_10 0x02 0x8200 OP_ADD why?
I'm using this IDE for my tests https://ide.bitauth.com/

And again, If I want to 10+120=130, in Script is OP_10 0x01 0x78 OP_ADD 0x02 0x8200 OP_EQUAL and asm is 010A01789302820087
Can I test this in IDE online?

Those scripts look correct, what do you not understand? 0xD200 is 2-byte little endian form of 210 and 0x8200 is little endian form of 130. I don't know if there is an online ide, I'm working on one, so I'll let you know when it's ready. You can also try btcdeb at https://GitHub.com/kallewoof/btcdeb

Yes it is correct, I try on ide.bitauth.com. then every number is in hex and in little endian? with btcdeb, I try with ´btcc OP_10 0x01 0x78 OP_ADD 0x02 0x8200 OP_EQUAL`.  Im in confusion. I'd like to know how the operation 10+120=130 is rapresent in asm and hex, and where can I try it. thanks :)

Sorry maybe i don't understand your question, you already have it in ASM, to convert to hex, just look up the code for each word: https://en.bitcoin.it/wiki/Script

My fault sorry, this is OP_10 0x01 0x78 OP_ADD 0x02 0x8200 OP_EQUAL is already in asm?

Yes. There are some values there that are just values (they have no opcode) like 0x01, 0x78, etc.

Let us continue this discussion in chat.

but I cannot have scriptPubKey asm OP_10 0x01 0x78 OP_ADD 0x02 0x8200 OP_EQUAL even if I use btcdeb.


text:
SegWit-incapable miners won't include SegWit tx's but accept them as valid?
Why SegWit-incapable miners won't include SegWit tx's in their blocks but will accept as valid someone else's block with SegWit tx's in it?

https://bitcoin.stackexchange.com/questions/42634/can-unupgraded-nodes-that-accept-zero-confirmation-be-fooled-after-segwit/42642

@G.Maxwell "Among old nodes, the transaction is not propagated because it is non-standard", but how these tx's are accepted as valid by old nodes when inside a mined block?

If a pre-segwit miner would include a segwit tx in a block (which they won't accidentally do, due to nonstandardness), that block will be invalid to segwit miners. The latter would just ignore that block and build a chain that does not include it.

@PieterWuille, this I understand, but what about the other way around? Do pre-segwit miners receive blocks by segwit miners with segwit tx's in them and accept them as valid? Being "nonstandard" and "valid" are different things?

Nonstandard means "won't relay or include in a block" (which is a local policy). Invalid means "would be invalid in a block" (which is a network wide rule). Segwit has been constructed such that a block with witness transactions will be valid to pre-segwit nodes.

@PieterWuille , perfectly clear now. Thank you for the attention and patience


text:
Lighting Network transaction
I have never used LN, but read about it and I am confused about one thing, if I am send BTC through channel, then receiver exactly know who send this and can in some way check how much sender's balance left and even locate original BTC address that create sender's channel? Only I know that transaction is sent in onion manner, so participants don't know if sender is guy that sends him tx, or if next receiver tx is end receiver of transaction.

You only know the balance of the channels you have open with your peers. And because the payments to you can be routed through other people's channels, you cannot simply get the information about the sender's balance or other sensitive information.

ok, so how I know who send me BTC in LN?

the same way people have been doing in BTC, you provide each potential payer a unique LN invoice. AFAIK in LN you can't even re-use invoices. You can only make the payment once, for the exact amount stated on the invoice. the receiver needs to create the invoice, so they know who they gave it to, hence who paid.

that's different question, but see @ktorn 's comment above

There are no such thing as Bitcoin addresses, you're reasoning from the wrong analogy to understand this. The only things that exist on Bitcoin are transactions and Script, each transaction only references past transactions and they never have a receiver, just a condition specified in Script for being spent.
Start here: https://en.bitcoin.it/wiki/Coin_analogy


text:
blockexplorer is not fully synced
I am working with a cryptocurrency which is a fork of bitcoin. In my blockexplorer it shows 91% synced and I cant see any latest blocks.

Does the GUI of the daemon show that you are connected to inbound peers?
If it does, you may have to do a re-sync of the blockchain from scratch. It's happened to me before.
Not sure which crypto you're using, but I'd try backing up your wallet.dat files, you can save a copy of the blockchain database as well if it's huge and restore it later just in case.
But back up your wallet files, then do a fresh install, re-sync the blockchain, and see if it gets to sync status. Then open your wallet files.

Hello
Thank you so much for the reply. Please check the link for the status [link]https://www.screencast.com/t/kBiWZ1yTQvt [/link]
Its says 91% synced and there is no other updates. This is fork of bitcoin. Where can I check any log for some possible issues?


text:
I bought bitcoin from an ATM machine but the person I want to send it to didn't not see it
 this is the receipt I got but the address on it is different from the address I want to sent it to

Both of the transactions are confirmed and can be viewed using a block explorer. Furthermore, both of them were spent by your friend 6 hours ago.
Transaction 1
Transaction 2
In other words, those transactions have been seen by them and spent.


text:
How are the transactions going to be verified after all BTC blocks are found?
If I understood correctly the current transactions are included in the generation of the next block, thus these transactions get verified.
But what happens when all 21 million bitcoins are already mined? When there is no block to be found anymore? How will then the transactions be verified? Will BTC simply die?
Edit: My question is not about mining decline, my question is how do the future transactions are going to be verified in the case where all the blocks are found.

My question is not about mining decline, my question is how do the future transactions are going to be verified in the case where all the blocks are found.

There will never be a time when all blocks are found. The subsidy will go down, and eventually reach zero, but there will still be more blocks.

I've voted to reopen this; I think the real question OP is interested in was answered here already, but not by the duplicate it's linked to.


text:
How do wallets work?
It may seem like a vague question, but what I understand so far is, you have a public key (address) which people can send coins too, and then you have the private key which you need to send coins to someone else.
My question is, how does the program itself work?
Does it create a public key based of private? maybe on the wallet.dat file? How would you be prevented from getting a private key if you have the public key? and what stops someone from looping over a bunch of private keys to find one with some coins in?

Does it create a public key based of private?

Yes, a cryptographic routine exists that computes the public key from the private key.

maybe on the wallet.dat file?

All modern wallet software generates keys derministically from some sort of master key, or seed phrase. That master key is stored in the wallet, and all other private keys are derived from it, and the public keys are derived from that. For every new receive address, a distinct key is used. The fact that they're all computed from one piece of data means that a backup of your wallet allows generation of all future addresses - even the ones created after the backup was made.

How would you be prevented from getting a private key if you have the public key?

Cryptography. The function to compute the public key from the private is fairly efficient in one direction (~50 microseconds on a modern desktop CPU), but the best known algorithm for going the other way around (Pollard's rho) would take around 300 trillion times the age of the universe on the same computer. With many computers it becomes faster of course, but even billions of times faster isn't remotely close to being able to realistically break any key. The security is based on the assumed hardness of a number theoretical problem, the elliptic curve discrete logarithm problem (ECDLP).

and what stops someone from looping over a bunch of private keys to find one with some coins in?

There are 115792089237316195423570985008687907852837564279074904382605163141518161494336 valid private keys (that's the actual number). Attempts to brute force them are futile due to the sheer number. The duration I gave above doesn't rely on brute force - it uses a much more efficient algorithm. Brute force would be 600 trillion trillion trillion times slower still.

Thank you very much! Greatly appreciate the response.


text:
Quantifying the long term costs associated with self hosting the Bitcoin node?
In this question I discussed the option of self hosting the Bitcoin node vs. using 3rd party services with API access. I quoted a colleague who said that "for every coin we wish to support, we will be required to hire a dedicated expert developer to maintain each node at a cost of $40,000 per year per node".
Although this was not the main point of my other question, I received a polarizing response to this quote.
For example, the user @Anonymous commented:

Where could they have possibly got the idea that maintaining a bitcoin
node costs $40,000 a year?

In response, the user @chytrik wrote:

Perhaps not for bitcoin, but for some poorly developed altcoins that
number is maybe too low – chytrik

A similar sentiment to @chytrik has been echoed by @Murch♦:

I agree, developers with a cryptocurrency background is not neither
cheap nor abundant. Obviously, it depends on your location, but I
suspect that you may find that $40,000 p.a. to be actually highly
optimistic. In the US, you'd probably be looking at $150k+ per
position (salary+rest).

Since this site is for Bitcoin, the focus of my question will be exclusively on Bitcoin.
Is there a practical way of quantifying the cost associated with self hosting the Bitcoin node? This includes the cost of hosting, scaling and hiring a competent developer to setup and debug the node. Obviously, a big part of the evaluation is likely to depend on the number of expected transaction so let's assume for this example we are dealing with an app that will scale from 5,000 to 500,000 customers at some point or from 500 to 50,000 requests per day.
What is a practical way of quantifying the long term costs involved and what type of maintenance/upgrades would a developer be required to do in the long term?

the answer is going to depend on the specifics of what you are planning to use the node for. If you require functionality beyond what bitcoin-core (or some related open-source project, like btcpayserver) provides, there will likely be associated cost. eg Bitcoin-core running on a basic raspberryPi setup will need basically no hands-on maintenance, but building an enterprise solution that can handle serving a lot of customers with proper security is going to be more resource intensive to create and maintain.

What about using an open source Blockchain API like https://insight.is for Enterprise purpose? Supposedly, it supports a "complete REST and Websocket API for querying blocks, transactions, and addresses; and receiving live updates". I'm not concerned about the initial setup costs, only the long term costs associated with hosting and hiring a developer to maintain, debugg and scale an application like this.

I'm not intimately familiar with that project, or your specific requirements. For eaxmple will you just need to receive payments? Provide wallets for customers? With what functionality? At what scale? etc. It might be tough for someone to write a comprehensive answer to your question as posed, considering the number of variables and unknowns involved. I have a node running on some old hardware that requires literally almost zero maintenance for years now, but that alone wouldn't be sufficient to run a bitcoin-business on top of.

@chytrik thanks for your reply. We need to be able to receive ongoing deposits from our customers & provide each customer with a unique wallet address for their deposits. We will need to be notified when a customer makes a deposit and confirm each transaction on the blockchain. Then we forward funds to a consolidation address (cold storage). We need to get all info about a specific address. We will also need to give customers the option to withdraw funds from their wallet. We are dealing with approx. 500,000 customers in total (not all of them are active on a regular basis).

There may be existing open-source software like btcpayserver that does pretty much what you want. If you don't need to build custom infrastructure, your costs are going to be spectacularly lower.


text:
0 hashes per second in Qt for new altcoin
Lately I have become interested in the way crytocurrency works. So I decided to make my own cryptocurrency to learn it's internal workings.
I used a clone of SmallChange and followed this guide.
Everything compiled well, but when I run the program, be it via command line or the qt interface, when I tell it to start mining it just tells me that it is mining but the hashespersecond are 0.
I tried building the litecoin source on my machine and used the exact same configuration that I used in my own altcoin (the same ".conf" file) and when I tell it to mine it does mine.
For my altcoin I used the ports:

55883 for RCP
55884 for P2P

My question is, is my computer not mining my altcoin because I'm alone on the network or it is happening because I have made some mistake in my code?
Thank you in advance :)
Edit: my output for "getinfo" is:
{
 "version" : 1000000,
 "protocolversion" : 60001,
 "walletversion" : 60000,
 "balance" : 0.00000000,
 "blocks" : 0,
 "connections" : 0,
 "proxy" : "",
 "difficulty" : 0.00024414,
 "testnet" : false,
 "keypoololdest" : 1369621665,
 "keypoolsize" : 101,
 "paytxfee" : 0.00000000,
 "mininput" : 0.00010000,
 "errors" : ""
}

and the output for "getmininginfo" is:
 {
 "blocks" : 0,
 "currentblocksize" : 1000,
 "currentblocktx" : 0,
 "difficulty" : 0.00024414,
 "errors" : "",
 "generate" : true,
 "genproclimit" : 4,
 "hashespersec" : 0,
 "networkhashps" : -9223372036854775808,
 "pooledtx" : 0,
 "testnet" : false

}

Could you please post the output you are getting. It would help narrow down the list of what could have gone wrong :)

which output do you mean? the debug or the output for "getinfo" or "getmininginfo"?

i did same thing bro :) i am very happy when you saw your question :) firstly you have to connect another computer . and you have to see "connection=1" To do that, you have use command: ./testcoin -connect= # . and you have to add listen=1 to main pc and addnode for both pcs.However, hashespersec is also zero for me :(

I got it to work.. Did you use "setgenerate" to tell it to start mining ??

ye i did, now, i have mining part. but i still can't see my coins in my wallet address :S do you know what the answer is for this ?

if you are mining with the wallet it means you are solo mining (and using a very bad mining software), so it's very difficult for you to earn coins.. your best choice for mining will be joining a mining pool

i did almost the same thing. however, my hashes per sec is 0 for mainnet. it works on testnet :S why :S

Hmm I was reading that on testnet all connections are permitted while on the mainet only the connections coming from the ip you specify are permitted .. Maybe you haven't specified the correct ip on the config file ... You can use 0.0.0.0 to permit all connections, however that's not a very smart idea.... Also, have you specified the 'server' and 'listen' values in your config file?

i did this. i set rpcallowip=0.0.0.0 and listen=1 and server=1 for server pc. other pc only have the rpcallowip=0.0.0.0 . however, the hashespersec did not change. do you have any other suggestions ?

are you connecting the computers with the "connect" parameter? insted of 0.0.0.0 try rpcallowip=192.168..
if both pcs are on the same network. I hope you can get it to work


text:
Hourly price notifications on Linux
I'm running Debian & Ubuntu and I've been using this script running in a terminal for a while but I find I easily get obsessed with the price. Instead I'd rather get, say hourly, desktop notifications.
Is there a simple way to do this?

This question appears to be off-topic because it is about some particular script, not crytocurrencies in general

Agreed, this is technically programming so it might be better suited for http://stackoverflow.com.

I was initially looking for a premade solution, the answer became programming-oriented when I couldn't find any. The question was never about the script, it was just some background to my question.

I modified the script and used notify-send to get what I wanted. I run the lightweight notification daemon xfce4-notifyd but most desktop environments (Gnome, KDE, Xfce) should have one preinstalled (for example Gnome's notification-daemon).
It depends on the jq command, so make sure you install it first using your package manager.
Here's the script:
#!/bin/sh
# Requires jq

# Remember to chmod +x!
#
# Add the following cron-job (using "crontab -e") to run at hourly intervals:
#     0 * * * * export DISPLAY=:0.0 && /bin/bash <SCRIPT_PATH_GOES_HERE> > /dev/null 2>&1
# Change <SCRIPT_PATH_GOES_HERE> to the appropriate name

BTCE_PRICE="$(curl -s https://btc-e.com/api/2/btc_usd/ticker | jq '.ticker.last')"
MTGOX_PRICE="$(curl -s http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast | jq '.data.last.display' | cut -d "\"" -f 2)"

notify-send "MtGox:     $MTGOX_PRICE
BTC-e:      \$$BTCE_PRICE"

Also available here
In order to run it on hourly intervals add the following line to your crontab using crontab -e:
0 * * * * export DISPLAY=:0.0 && /bin/bash <SCRIPT_PATH_GOES_HERE> > /dev/null 2>&1

Assuming your script is called btce_ticker.sh, the following line would do it:
while true; do btce_ticker.sh; sleep 3600; done

The sleep 3600 sleeps for an hour before looping around and running the script again.

I don't want a terminal notification, instead I'd like a desktop notification. I solved it but can't answer my own question yet (apparently a forced 8h delay) since I have <10 rep. The script is here however: https://gist.github.com/ErikBjare/8332113

@erb: I note that you didn't actually say "desktop" in your original question.

Yeah I forgot to mention that, sorry.