text:
Coinbase to Coinbase off-chain transaction fees?
When I click on "Send" from my bitcoin address which I know is off-chain in Coinbase to another Coinbase address which I also know is off-chain. So technically the transaction will not touch the blockchain, just update their off-chain books locally.
I know it's off-chain, because I deposited money using my credit card, and I scanned all addresses under Tools > Addresses on a blockchain explorer for a few days and there's nothing in there. They're keeping it off-chain until I actually want to spend it. Granted, but if I spend it to another Coinbase off-chain address, they should be able to find out that this is an address they own and they don't need to utilize the blockchain at all and could do it all off-chain as they own both addresses.
If that's the case, why is coinbase still charging me network fees? Sounds like mickey mouse fees to me for updating a record in their database without touching the blockchain.
Are they assuming that I don't know it's a fully off-chain transaction, and think they can charge me regardless? Or does their wizard have a glitch ?

How do you know if is off-chain? If you are sending to a bitcoin address and a transaction is generated, it is necessarily on-chain.

Relevant? https://support.coinbase.com/customer/en/portal/articles/971437-how-do-i-send-digital-currency-to-another-wallet-

@AdamMillerchip I know it's off-chain, because I deposited money using my credit card, and I scanned all addresses under Tools > Addresses on a blockchain explorer for a few days and there's nothing in there. They're keeping it off-chain until I actually want to spend it. Granted, but if I spend it to another Coinbase off-chain address, they should be able to find out it doesn't need to utilize the blockchain at all and can do it all off-chain as it owns both addresses. I updated my question.

@AdamMillerchip Not fully, this applies to Coinbase to "any wallet". But for Coinbase to Coinbase transactions and knowing that Coinbase has an off-chain ledger system (they mention it themselves), that should give improved possibilities for Coinbase to Coinbase transactions.

Does Coinbase pay miner or network fees when sending digital currency? it is stated clearly here "Any transactions sent between Coinbase customers by email address take place off-chain (not on the blockchain) at no cost". Maybe Coinbase have a system that charges network fee as long as "addresses" are used.

@Chak You might be on to something, indeed when sending funds there's one to send by "Bitcoin address" and another one to send by "Email". I've never tried sending using the Email option, so perhaps when sending by email that might be the channel where it detects that the person has a Coinbase account. Thanks!

@Chak now that you've solved the question, please post an answer and accept it so the question doesn't remain unanswered :)

Does Coinbase pay miner or network fees when sending digital currency? is stated clearly here "Any transactions sent between Coinbase customers by email address take place off-chain (not on the blockchain) at no cost".
 Maybe Coinbase have a system that charges network fee as long as "addresses" are used.


text:
Transaction history size
I recently installed Bitcoin-Qt on my laptop and it started performing the synchronisation with the network since a couple of weeks. And it's not finished.
Why do the Bitcoin-Qt application have to do so? If I am right, this application is just a Bitcoin client... I mean, it have not to check transaction integrity such as a miner, right?
Also, I would know if according to you, in 10 years (with some imaginations), having a lot of transaction every days, this synchronisation could take some months or even more.
Thanks for your lights!

FYI, as of today, the full blockchain takes up ~16 GB of disk space.

The main reason to run Bitcoin-Qt is to help the bitcoin network by relaying transactions and blocks as well as verifying the blockchain.  Bitcoin is a distributed protocol and relies on its users for validation.  You can download an initial blockchain so that your client doesn't need to get it from a peer node (your download will be limited by the upload bandwidth of the peer node).  Once synchronized, the network load is around 144 MBytes/day depending on the number of connections and the needs of your peer nodes (your upload bandwidth can be saturated for hours if another node needs to download the blockchain from you).
That said, if you just want to use bitcoins without participating in the network, you should use a light client such as Multibit, Electrum, or Armory.  Check here for more information.

Considering Bitcoin-Qt participating in the network, does it mean it could act such a miner and collect some bit coins? What is the main difference between Bitcoin-Qt and a miner application?

The miner application (BFGMiner, etc) communicates with the local bitcoin client using the RPC interface.  The bitcoin client provides the block to be solved to the miner.   The miner does the hashing until it gets a solution and then tells the bitcoin client.  The client then broadcasts the block to the network.

It is a good question.  Bitcoin-Qt was the first client written.   It was written to download the entire blockchain, which is probably not optimal.
You are correct that this is problematic, and it will become even more so over time.
There are so-called thin clients, such as MultiBit, for instance, that you might want to look at.

This is not quite true. The client before Bitcoin-QT was called WxBitcoin. It is deprecated now.

I would not call this problematic, but the only way to grant real crypto security.

source: Stack Exchange

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

authors: Каракурт Пауков

sort: votes


text:
!setBlockIndexCandidates.empty()
!setBlockIndexCandidates.empty() Bitcoin Core 0.11 error
Hello,
I have a problem with the Bitcoin Core v. 0.11 software!!!
I installed the software today and after a long wait (downloading block source - 5 years) I closed the application and when I tried to start it again I received this error:
"Assertion failed!
File: main.cpp, Line 2287
Expression: !setBlockIndexCandidates.empty()"
If I click Ignore on the error window the program start but with "No block source available" so it can't continue the download. And when I close the program I receive a FATAL ERROR message: "see debug.log for details"
Can somebody tell me how do I fix this error or what do I do next?
And another thing...
I was sent today some Bitcoins and I am asking if the sun can be recovered somehow?
Thanks!
debug.log

Can you take the last 30 lines or so of %APPDATA%\Bitcoin\debug.log and edit them into your answer?

Did you try to delete the blocks and chainstate directory in the bitcoin datadir?

I had exactly the same problem with litecoin 0.15.1 and it helped me to run it with --reindex option on the command line. I only had to do it once...

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

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


text:
I have lost my blockchain.info wallet identifier and used a fake email, does anybody know if its recoverable still?
I have the password and mnemonic phase, thanks so much for any help

I don't think so.

This is a support question for a specific service, try talking to them about it.

Yes, it can be done. I've done it myself, but it's imperative whatever machine you used to create the account or last logged in with, is immediately turned off. Before I go through it, can you clarify your OS, platform, login method (Chrome Extension? Direct login?)

Yes you can as long as you have the mnemonic phrase.
Enter it here for recovery:  https://blockchain.info/wallet/forgot-password
If you don't have the access to the email address then you will need to contact support at: https://blockchain.info/support-desk
Here's the info straight from Blockchain.info
A mnemonic is the passphrase seed of your Blockchain Wallet provided to you when you sign up for a new wallet. The purpose of this is in case you need to recover your wallet at a later date, if you lose your login information. When you recover your wallet with your mnemonic, your password and identifier will be displayed to you. Your main password can not be changed once it is set, therefore your mnemonic will always remain the same for each wallet. - See more at: http://blog.blockchain.com/2015/03/17/whats-the-difference-a-comparison-between-key-blockchain-wallet-terms-and-features/#sthash.kRhvW9CM.dpuf

authors: Дима Чебанов


text:
How to access Latest Transactions using the Blockchain.info api?
I'm new in bitcoin, I just want to return json scrutucture from latest transactions from time to time.
I couldn't figure by searching their reference, I think it requires a level of knowledge in bitcoin I don't have yet.
I just wanted to return plain vanilla json array
thanks

First of all, there's no way for blockchain.info to know which transactions you have and don't have if it's not in a block.
You can get the full list of transactions not yet in a block using this call:
https://blockchain.info/unconfirmed-transactions?format=json
Otherwise, you can get a continuous stream of new transactions using the websocket API:
https://blockchain.info/api/api_websocket
You can subscribe to unconfirmed transactions by connecting via websocket to
wss://ws.blockchain.info/inv
and sending this:
{"op":"unconfirmed_sub"}
That socket will receive every transaction that blockchain.info receives.

which doesn't work for the testnet: https://github.com/blockchain/api-v1-client-node/issues/93

If you are looking how to display the live transaction feed on the blockchain you should check out this step-by-step tutorial on using their websocket API.
BROKEN LINK
If you don't want to do websocket and only want a "plain vanilla" JSON array of the most recent unconfirmed transactions you can simply use https://blockchain.info/unconfirmed-transactions?format=json
EDIT: Link no longer available, pasted below

So we started by creating the variable var btcs and then we had that be equal to the new websocket connection. Now that we have a connection to the websocket we need to send it a message and tell blockchain.info which information we are interested in receiving. We are going to use the onopen and send properties on our btcs variable and create a function that subscribes us to {"op":"unconfirmed_sub"} which is new transactions to the bitcoin network.
JSON.stringify will send a JSON request to the websocket server telling it that we want to receive updates on new transactions to the network. At this point the server will start sending "messages" to the client everytime there is a new transaction. We need to tell javascript what to do everytime a message is received using the onmessage command. Create a new function using onmessage and I'm going to name the function onmsg. Within that function we will parse the JSON using the data command.
At this point you could stick this script into an HTML document and when you run it, it will start shooting out all the new transactions as objects in JSON format into your browsers debug/console. If you look at it you'll notice they all start with utx and then all the transaction data is under x. The data within the x array includes input and out. If we want info form the input area we would call the response variable and then add in .x.input. However there can be multiple inputs and outs so we have to clarify which one. If we add in stright brackets and put a zero [0]that will get us information on the first item in the array. Here's an example that will get the BTC amount that was received by the first output.

sadly the tutorial is no longer available.  I get a 404

Edited answer to include the sample html page and instructions

awesome.  thank you.  sadly, I can't get it to work on the testnet


text:
How do I generate multiple address with a master public key in pybitcointools?
I'm goofing around with this fork of pybitcointools and I got stock with generating multiple address for receiving coins with a master public key. So far, this is what I have:
import bitcoin as btc

privatekey = btc.sha256("large example seed for this great test")
print privatekey

# 03e02b95a485112b543ac29cd262afbbd64dca9b4496e264e47312cb193ae5ab

bip32_masterprivatekey = btc.bip32_master_key(privatekey)
bip32_masterpublickey = btc.bip32_privtopub(bip32_masterprivatekey)

print bip32_masterprivatekey
# xprv9s21ZrQH143K3tQmGrVtKc7B6ZPtCJAmD6wDAJXxb7YXAoZFTb55UroSxrU7k823vSQmYPDhdseRKqP1mgSUWDneinai2seUd7RLX2xkmGW

print bip32_masterpublickey
# xpub661MyMwAqRbcGNVENt2tgk3uebENbktcaKroxgwa9T5W3btQ18PL2f7vp78LNoioGhZcgSH1i2cH48YcQttiEaAh86TuJpsUu2J7jQWnmbC

You want to use bip32_bin_extract_key on the bip32_masterpublickey:
https://github.com/vbuterin/pybitcointools/blob/8e8a33d7281c871950519e5f256ad08cf0d5df69/bitcoin/deterministic.py#L140
And then use pubkey_to_address on the result:
https://github.com/vbuterin/pybitcointools/blob/8e8a33d7281c871950519e5f256ad08cf0d5df69/bitcoin/main.py#L446
simply put:
btc.pubkey_to_address(btc.bip32_bin_extract_key(bip32_masterpublickey))

That would generate one bitcoin address, right? How do I generate two or more using the master public key?

Indeed, that would. You'll want to do bip32_descend to get keys that are not the root key.

Sorry for being annoying, but what parameters should I exactly feed bip32_descend with, besides the public master key (I guess) to achieve what I'm looking? I did this btc.pubkey_to_address(btc.bip32_descend(bip32_masterpublickey, [1, 0, 0])) and I'm getting a different address changing the third 0 of the list, but I'm not sure if that equals to M/i'/0

So the last argument is the BIP32 path. [1,0,0] => M/1/0/0 path. Changing any of the numbers in the path or making it longer by an element will change the address.


text:
I have a BIP39 seed but I cannot successfully recover the wallet on Electrum
Saw a photo of a screenshot I took and uploaded to Facebook 8 years ago, the address in the picture was this https://www.blockchain.com/btc/address/19ScMXCyxoL1igxuw2LqRCtfdZb5WdQGJC and turns out that wallet still have some coins!
The screenshot came from Bitcoin from Android, or so I believe:

Today I was able to access an old KeePass password database and I still have backups of some wallets in there:

I successfully restored the one called "Cartera personal" (in red), sadly is in 0.
But I'm having troubles restoring the other waller, the one which, I believe, has some funds left and is related to the address I linked above: "billetera de calle (telefono android)". I already have the seed store in KeePass, and despite following the restoration process with Electrum I see no transactions, like it was a new Bitcoin wallet.
I'm 100% sure that one wallet is the one in the screenshot, then, what am I doing wrong?
EDIT: from this Android wallet some transactions were sent and turns out the address were from an exchange to an account I still control, it only have less than a dollar tho.

How old are the wallets exactly? I had one quite old seed (from 2013 or 2014) and I needed to use an old version of Electrum to recover it.

2013 I think, did you follow a guide or something?

No, I couldn't find any. I could consider revisiting the topic to make one unless you want to try first. What OS are you on? 1.9.8 version is what I would try as 1.9.x was a major release in late 2013: https://github.com/spesmilo/electrum/releases/tag/1.9.8 it uses python 2.6..

Well the windows builds are still here. The portable exe is probably the easiest way to proceed if you got a trustworthy windows computer around: https://download.electrum.org/1.9.8/

I dug out my old seed from 2014, but it's not BIP39, so the information I have provided earlier probably does not apply to your use case. Sorry. My seed appears to be from before electrum started using a word list (it's just a long hexadecimal string).

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


text:
Can I be held liable if a gateway vanishes?
I'm beginning to wonder what my liabilities may be once I start using a system like Ripple.
For example if a gateway I'm using (say Bitstamp) suddenly vanishes, could I, as a user of Ripple and Bitstamp, be held liable for some sort of debt (in addition to losing my balance on that gateway)?
Say I have 3 bitcoins on Bitstamp (and they're worth $1000 each) and transfer them to Ripple and I buy for $3000 of Litecoin. Then for whatever reason Bitstamp disappears and the price of bitcoin reaches $100 000 (it's just an example), would it be possible that the person/service I bought Litecoin from comes to me and say "You bought us for 3 bitcoins of litecoins and you got your litecoins from us, but your gateway disappeared and hence we never had our bitcoins. So you're liable of $300 000 to us".
Or could Ripple itself come to me and say: "Look, you used coins coming from Bitstamp to buy Litecoins but Bitstamp couldn't honor his word, so now we'll force the sale of your house so that you can pay us the x bitcoins you owe us"?
The question is probably silly but I'd still like to know what, as a a user, my liabilities could be because I certainly wouldn't want any money that I have outside of the crypto currencies world to be at risk once I start using/trading crypto currencies.
I'm asking this because I read about the IOU and I often read things like: "you don't have 3 bitcoins, you have an IOU saying that someone owes you 3 bitcoins". What I want to know is if I'm selling/trading the IOU or if I'm putting my a** on the line.

No, Ripple payments work nothing like what you describe. Your description is like someone saying "you paid with X bitcoins but now two days later the value of bitcoins crashed therefore your payment is longer good".

@dchapes: in Ripple, are you paying with bitcoins or with IOU of people/exchange basically saying: "we hereby recognize we owe you bitcoins"?  If the later, when you trade bitcoins on Ripples, are you actually really trading (part of) the IOU?  If it's nothing like I described, maybe you could explain a bit why I can't be held liable?

Closely related: What happens when a gateway on the Ripple network defaults or simply vanishes?

You are not liable when a gateway vanishes.
When you send money on Ripple, you are trading IOUs. In order for someone to receive IOUs, this recipient must have expressed his acceptance of IOUs from the corresponding issuer.

Alice wants to buy a lot of ice-cream from Bob for $20. They both trust the gateway Gateway.
Alice has previously paid $100 to Gateway and holds therefore an IOU from Gateway with the value of $100. She sends $20 to Bob. Bob also trusts Gateway, so he is willing to accept Gateway-IOUs as payment. Gateway now owes her only $80, and Gateway owes $20 to Bob.

At this point their deal is done. So, if Gateway went under after this, there would be no liability, because the payment was transferred and accepted by Bob. His beef is with Gateway, or with himself for trusting Gateway, not with Alice.


text:
Encrypted wallet which is syncronizing
I have a question, I have like 0.1 BTC on my wallet from FEB 2013.
I am 34 weeks behind sync with bitcoin-qt wallet, but the weird thing is its encrypted but I think that i never encrypted it.
Is it possible it says its encrypted because its out of sync? or it is encrypted?
and also if u set a bitcoin password can it be something like: hello123 (the reason for asking is because maybe I can figure it out) if its something hard I probably wont remember it (randoms chars, e.g symbols).
EDIT: thing also is that in the menu I cannot choose encryp wallet ..

If it says the wallet is encrypted, then it's encrypted. I can't imagine any way the wallet could be encrypted other than that you encrypted it. You can try as many passwords as quickly as you want, so maybe you'll remember it.


text:
What is the difference between time, blocktime and timereceived?
What is exactly the difference between
time, blocktime and timereceived
in transaction information returned by Bitcoind JSON RPC API? For example:
{
    "amount": 0.02,
    "blockindex": 45,
    "time": 1306179671,
    "category": "receive",
    "confirmations": 109244,
    "timereceived": 1306179671,
    "address": "1P5xanGEdgPKYNt4BnATambHpbZ2h89bYv",
    "txid": "91eb6cb34b9253cce0ab5da171a0f5aae9d3d36208e23062ba61cd9e21c09a3d",
    "blockhash": "0000000000002e65f5cc554e99c352af958a63f4be663627f2c569e5a996a03a",
    "account": "",
    "blocktime": 1306173564
}

timereceived is when your client first learned of the transaction. If you sent the transaction, it's the time when you sent the transaction. If you received the transaction, it's when your client first saw the transaction on the network.
time can be different from timereceived if you first learned about the transaction by seeing it in a block. This usually happens when your client was offline for a while and you're getting caught up with the block chain. In this case, time will use the block's timestamp if it seems reasonable. Specifically:

If the block timestamp is in the future, time will be the same as timereceived.
If the block timestamp is before the latest transaction in the wallet, time will be equal to the time of the latest transaction in the wallet.
Otherwise, the block timestamp will be used.

Transaction times don't change, even after a reorg, and new transactions will never have a time earlier than an existing transaction. This was not always the case (old versions preferred to use the block timestamp, which is usually more accurate), but the current method makes it easier to deal with transaction timestamps safely.


text:
Blockchain.info's blockcount API call giving error, alternatives?
This URL today: https://blockchain.info/q/getblockcount
Was giving the error "Too many requests".
Any alternative out there to get the blockcount via an API? Thanks

Works fine for me (5 minutes after you posted your question).

Another public API I found for this:
https://blockexplorer.com/api/status?q=getBlockCount
But the best one so far, is blockR.io because it even has testnet support:
MainNet: http://btc.blockr.io/api/v1/coin/info
TestNet: http://tbtc.blockr.io/api/v1/coin/info

You can use our API:
Get latest block (total blocks count )
https://bitaps.com/api/#Get_latest_block

testnet support?


text:
What is anonymous and safe api to get bitcoin Exchange Rates?
What is anonymous and safe api to get bitcoin Exchange Rates like BTC/USD and BTC/EUR without trace my ip ?
i used tor service, i search and found blockchain api contain Exchange Rates Feed
http://blockchain.info/ticker
is this secure means if i use this api, can blockchain trace my ip(tor) ?
and how can i use this api in php ?
and if anyone have others api provides bitcoin Exchange Rates Feed please tell me ?
thanks

thanks you but i ask about is api like blockchain can trace my ip when i get json file from it ?

Sure, but as you say you can use Tor with any API if you want to hide your IP address.

is there exist api anonymous and safe rather than blockchain api beside i use tor ?


text:
How to find a specific bitcoin address from all the addresses?
Recently, I found a site that show all the addresses in a huge list, divided in 904625697166532776746648320380374280100293470930272690489102837043110636675 pages.
The site's link is http://directory.io/ and I want to know if I can find a certain address from the whole list. I already tried to merge all those pages into one list and then search for the address with the browser, but I'm not sure how to do it (because I don't know much about HTML).
So, if you know a way to do this, please tell me and explain me how. Thanks!

That's hilarious.

@DavidSchwartz It's hilarious if it's a malcontent scallywag- perhaps its for noble causes! Op check answer #2

I wonder how far Google's crawler has gotten into this site.

If you know the private key, yes you can. If not, you'll need roughly an eternity to find it.

As Arturo and Aussie already said, directory.io shows all Bitcoin addresses sorted by private key. Also, the author explains his intent on directory.io/faq.
The first page has 11.302 Byte. Assuming they all are about the same size, 1TiB would just store 97,284,695 pages. Yet, there are 904625697166532776746648320380374280100293470930272690489102837043110636675 pages. That is approximately 9.05 × 1074, i.e. ~1066 TiB.
There is not enough memory to store them, and it is infeasible to search for one address in them in reasonable time.
Concluding, everyone's bitcoins are still safe. :)

The site Directory.io is an insider joke; it's simply making the statement that there's 2^256 - 1 (ie X combinations, where X = 115792089237316195423570985008687907852837564279074904382605163141518161494336
) private keys.
A private key can be a large number like 904625697166532776746648320380374280100293470930272690489102837043110636601 or small like 0.
So what's been done is each page is essentially a list of hashed numbers in order, starting at n=0, then next n=1, 2, 3, etc ad nauseum
Similarly, a hashed number called the secret exponent - a hexadecimal number up to 2^160 in size - represents the public key. You can see the public key for yourself with the secret exponent field at BrainWallet.org and the private key proof at the Directory.io FAQ.

It's actually 115792089237316195423570985008687907852837564279074904382605163141518161494336 private keys! http://blog.richardkiss.com/?p=371 ... 1 Mississippi, 2 Mississippi...

Tiny nit: 0 is not a valid private key. 1 is.

I don't think you understand that site. It 'lists' all possible addresses and you do NOT want to search your own address in there (even if that were possible).
I don't know of the site is a joke or a troll, but best just to avoid it.

There is not bad faq section there http://directory.io/faq

Those a too much private keys! just try it. It will take too long to search. directory.io is not available anymore. But there seems to be a new site: allprivatekeys.com. I don't know if its serious so DO NOT CHECK YOUR PRIVATE KEYS THERE but you can check your Bitcon Addresses.

But you also should not post there any bitcoin addresses with your email address. This would be a good combination for an attack ;)

Also important to note is that Directory.io doesn't actually store any private key (because that would be physically imposible, for a reason similar to this). Rather, you tell it which page you want to see, and then it shows you the private keys [n*128, (n+1)*128-1], which it calculates on the fly. Your private keys are never compromised by this website.

UNLESS of course you search for your private key or public key in the list. A malicious webmaster could actually exploit that now I think of it.

Actually, the theoretical minimum energy to perform any reversible computing operation is zero. Yapping about thermodynamics doesn't change that. Sources: http://www.cise.ufl.edu/research/revcomp/faq.html and https://en.wikipedia.org/wiki/Reversible_computing

The link I provided about counting and thermodynamics was an example. The actual storing of such numbers is a different problem that depends on the smallest physical storage posible for a bit. If we take this to be an atom, then we're on a similar scale. We would need almost all atoms in the observable universe to store all of them.

Also, I would like to know about a real-life computer that actually uses 0 energy (how would it work, anyway?)

@WizardOfOzzie lol dont ever do that ,  u will give the site's owner shortcut right to your wallet


text:
Do bitcoins count as income in the UK?
I am interested in mining bitcoin here in the UK. I have done a quick search and cannot find anything relevant. If I were to use a cloud mining service to mine bitcoin, would it be counted as income AND/or would it have to be taxed?
Could a link also be posted so I can see more information on it please?


text:
Bitcoin Mining -> A mining pool that pays in USD (preferred) or BTC per Unit Time per CPU rate
I plan on mining bitcoin, and I would like to know a good mining pool that pays in USD per Unit Time per CPU rate (preferred) or BTC per Unit Time per GPU/ASIC rate.
I would like to know
1. The highest rate for such a pool in USD or BTC, and
2. The highest rate for such a pool in USD (direct USD payment)
I know such a pool exists, I just need names. If you do not think such a pool exists, I would like to know of a pool with a high success rate or with lots of power as to provide a near steady income. Thank you for any and all answers
[EDIT] for CPU to GPU or ASIC

Except for the payment in USD, how is this any different from all mining pools?

Or are you asking for current values of mining profitability?

it would be a more effective money making method going to your nearest town and searching for pennies on the ground, just saying.

You can't mine with CPU.
All mining pools pay BTC. They all pay pretty similar.
You won't get any income. 0 with CPU or less than your electricity cost if you have better hardware. Only people that really know what they are doing AND can pay for the latest hardware in decent quantities (without getting scammed by the manufacturer) AND have access to large amounts of cheap electricity will be able to earn a bit of income.


text:
Why blockcypher send transaction is throwing fatal error?
I am trying to send bitcoin implementing blockcypher API, but having difficulty in using the following code snippet...
i. http://blockcypher.github.io/php-client/sample/doc/transaction-api/CreateTransaction.html
ii. http://blockcypher.github.io/php-client/sample/doc/transaction-api/CreateAndSignAndSendTransaction.html
The transaction is being created perfectly, but following error is being thrown while trying to send it...
Fatal error: Uncaught exception 'BlockCypher\Exception\BlockCypherSignatureException' with message '1 private keys do not correspond to any input. Please check private keys provided.' in /www/myserver.com/blockcypher1/php-client/blockcypher/php-client/lib/BlockCypher/Api/TXSkeleton.php:148 Stack trace: #0 /www/myserver.com/blockcypher1/php-client/blockcypher/php-client/lib/BlockCypher/Api/TXSkeleton.php(96): BlockCypher\Api\TXSkeleton->generateSignatures(Object(BlockCypher\Crypto\PrivateKeyList), 'btc') #1 /www/myserver.com/blockcypher1/php-client/blockcypher/php-client/lib/BlockCypher/Client/TXClient.php(35): BlockCypher\Api\TXSkeleton->sign(Array, 'btc') #2 /www/myserver.com/blockcypher1/send.php(19): BlockCypher\Client\TXClient->sign(Object(BlockCypher\Api\TXSkeleton), Array) #3 {main} thrown in /www/myserver.com/blockcypher1/php-client/blockcypher/php-client/lib/BlockCypher/Api/TXSkeleton.php on line 148
But, I have provided unencrypted Hex private key of my input address. Also tried with WIF. None is working! How do I solve this ?

Is the key the right key for at least one of the inputs?

@NickODell Yes it is. As input I am testing with only one address. I created that address with blockchain.info and has taken the unencrypted HEX from there only. Also cross checked the HEX with bitcore.io/playground/#/address.

The problem was caused becasue BlockCypher-php-client-1.2.2 does not support uncompressed public keys.
Details: https://github.com/blockcypher/php-client/issues/5


text:
Cannot connect to php-mpos with CgMiner: Pool 0 slow/down or URL or credentials invalid
I'm trying set up a local pool, using the php-mpos and the zetacoin-qt executable file, but for some reason, when I attempt to connect using cgminer, I get this error: Pool 0 slow/down or URL or credentials invalid, this happens even though I've created a worker in php-mpos, I am running all of this on a windows machine. My batch file running the program is this:
cgminer-nogpu.exe -o "stratum+tcp://localhost:9332" -O admin.user:password

My Zetacoin config is this:
rpcuser=username
rpcpassword=password
rpcport=9332
daemon=1
server=1
gen=1

block_nTime=1317972665
block_nNonce=2084524493

Oops, It turns out I didn't use stratum mining server properly, instead I used stratum alone.  There's an important distinction between the two.


text:
Programming for/modding bitcoin-qt on Windows
In multiple places I've found methods of modifying or adding to the bitcoin-qt(or other coin wallet) source on ubuntu or osx, but how would I do this on a Windows machine? If possible, I'd like to be able to use an IDE(pretty much required) to be able to build, but also, I need some way to edit. Thanks ahead of time!

Qt is a multiplattform library, so is its IDE (qtcreator). You can compile bitcoin-qt on Windows pretty much the same that yo do on Linux.


text:
Setting up Statistics with litecoin-qt or bitcoin-qt
I'm trying to set up a bitcoin/altcoin pool server, but I've run in to a bit of a problem, I have no way to verify I've connected to the pool succesfully, and no stats or informations on the actual pool operations. Is there some way I could find these stats in litecoin-qt or bitcoin-qt? The getinfo command seems to only return stats about the client, versus the actual pool info. I'd also like to have them generated automatically vs having to calculate myself.

Please provide more information. How long have you been a miner, how long have you know bitcoin/litecoin/altcoin? What are you using for your back end/frontend? either one should show you if you are on the right track. if you can provide this info i can help. I am a altcoin pool op for about a year now myself. EDIT are you using a front end?

@JoeWhite Updated and no I don't believe I am using a frontend, though I'm not sure what it is. I'm just trying to start, but now that I think about it, I have heard about frontends before.

Dylan, i suggest you do a lot more reading before you attempt to run a pool. A pool is not an easy job, you need an in-depth knowledge of bitcoin/c++/python etc. It's not simply cut and paste.
Unfourtunately from waht i am reading you are only running a coin daemon as your pool node which won't work for a pool. check out how to install mmcfe for litecoin. that should help you out

I know c++, and python, I'm currently learning quite alot about bitcoins. Thank you for putting me on the right track, though I think you underestimate me.
EDIT: Also does pushpool work for this?

Dylan, i'm sorry if you got the opinion that i underestimate you. I do not know you more than your post here and you said some odd phrasing "but now that I think about it, I have heard about frontends before" so I just have to assume that you are not knowledgeable about it. I just don't want to see you have any problems with your code. please feel free to contact me with any help you may need.

yeah pusphool does work, but not sure why you would want that. stratum is much better. https://github.com/moopless/stratum-mining-litecoin
EDIT or mpos https://github.com/TheSerapher/php-mpos


text:
How is the target section of a block header calculated?
I've been poking around https://en.bitcoin.it/wiki/Target and I've found the current target, but I can't seem to find how it's generated. It's supposedly generated when the difficulty is adjusted, as stated here: https://en.bitcoin.it/wiki/Block_hashing_algorithm, but what exactly is the algorithm for generating the target? If someone could show me some psuedocode that would be great.

It is not clear to me whether you are looking for a verbal explanation of the difficulty algorithm, the specific line of code where to find it, or a step-by-step explanation of the code. Perhaps you could edit your question in order to clarify. If you are asking for the first: possible duplicate of How is difficulty calculated?

Is difficulty the same thing as the target?

Difficulty is essentially the human readable representation of the target. See here: What is “difficulty” and how it relates to “target”?

The target section of the block header is called nBits in the code.  nBits is a 32-bit compact encoding of a 256-bit target threshold.  It works like scientific notation, except that it uses base-256 instead of base-10.  For example, if nBits is equal to 0x181bc330, you would calculate it like this:

Or, more simply, you'd use the same shorthand you use with regular scientific notation:

At a re-target point (every 2,016th block), Bitcoin Core adjusts nBits according to the rules described in this answer except that it is important to note that when difficulty changes by p percent, nBits is adjusted by the inverse (-p percent).  That's because a lower target is harder to reach the way Bitcoin is implemented.
It's also important to note that you can't just adjust the exponent part of nBits in the obvious way because when Satoshi first wrote the code, he inherited from a signed type---so extra care must be taken not to create a negative nBits value.  The Bitcoin.org Developer Reference has more details (but be careful, I haven't yet had an expert review that section).

Can you elaborate on how this is Base-256? Surely for base 256 we would need 256 unique symbols?

@ElRonnoco It does have 256 unique symbols: each byte is a symbol. (For the analogy, anyway; exponential notation doesn't actually require the base to line up with symbols at all; in fact, mathematicians use base $e$ a lot.)

I am not sure how this is actually implemented in the code, but you can approximate the new target (nBits) value with data from the prior 2016th block. Note that as described above nBits is the 32-bit compact encoding of the 256-bit target value.
Here shows the new difficulty (d_new) as:
d_new = d_old * 2 weeks / t_old
where 'old' signifies the previous 2016 blocks, and t_old is the time it took to find those previous 2016 blocks.
Here shows d_new from genesis block values as:
d_new = nBits_genesis / nBits_new, and similarly
d_old = nBits_genesis / nBits_old
Combining these 3 equations results in
nBits_new = (t_old / 2 weeks) * nBits_old
So knowing the timestamps of the new block and the prior 2016th block, and the target of the prior 2016th block, we can approximate the new target value. For example:
block 703584
nBits = 0x170e2632 = 927282 * 256^(23-3)
timestamp 2021-10-04 16:35:19
block 701568 (the prior 2016th block)
nBits = 0x170ed0eb = 970987 * 256^(23-3)
timestamp 2021-09-21 07:34:36
So
t_old = 13 days 9h 33s = 1155633s and 2 weeks = 1209600s
nBits_old = 970987 * 256^(23-3)
Thus the new target is approximately
1155633/1209600 * 256^20
= 0.955384424 * 970987 * 256^20 = 927666 * 256^20
Converting to the compact 32-bit format we get
nBits_new ~ 0x170e27b2
The mantissa 927666 (0x0e27b2) is close to the actual mantissa 927282 (0x0e2632).  It's a reasonable approximation but obviously the absolute values of the targets are quite different because it's base-256. Error here is likely due to rounding to the nearest second in the timestamps. Even though this is not the explicit calculation done in the code, I hope that it helps in general understanding, including the references here and here.

I have a working c# implementation of nBits computation. I've tested and it works. However, keep in mind my machine is Little Endian so the implementation takes that into account. If your machine is Big Endian, then the way you would read in the nBits bytes would be different.
If you don't know how to get changeFactor, the steps are below after the code.
changeFactor is the ratio of time it took to mine the last 2015 blocks to the expected time of 10mins per block. {Pls it is not a typo. It is the last 2015 blocks you will consider when computing change factor even though you only recalculate nBits after every 2016 blocks}.
actual time of last 2015 blocks = unixEpoch of current highest block - unixEpoch of block with blockHeight equals [currentHighestBlockHeight - 2014] {again this is not a typo}
expected time = 2016 * 10 * 60 = 1209600
change factor = actualTime / expectedTime.
However, there is a limit for change factor. There can't be a change of more than 400% per retarget cycle.
so after getting change factor you do the ff. to keep it within the set bounds before feeding it to the retargeting function.
if (changeFactor > 4) changeFactor = 4;
if (changeFactor < 0.25) changeFactor = 0.25;

Finally oldNBits is just the nBits of the current Highest block in uint form.
Hope this helps.
public static uint RetargetByFactor(uint oldNBits, double changeFactor)
        {
            // convert change factor to rational number with numerator and denomenator
            BigInteger numerator = 0;
            BigInteger denomenator = 1;

            while(changeFactor % 1 != 0)
            {
                changeFactor = changeFactor * 10;
                denomenator = denomenator * 10;
            }
            numerator = (BigInteger)changeFactor;

            byte[] oldNBitsBytes = BitConverter.GetBytes(oldNBits);
            byte[] mantissa = new byte[] {oldNBitsBytes[0], oldNBitsBytes[1], oldNBitsBytes[2], 0x00 };  // need to reverse the bytes because we want the mantissa in little endian
            byte exponent = oldNBitsBytes[3];

            BigInteger result = new BigInteger(mantissa);
            result = result << (exponent-3)*8;

            result = result * numerator / denomenator;

            byte[] resultBytes = result.ToByteArray();

            if (result == 0)
            {
                return 0;
            }

            // now to get the exponent of the newNBits, we count how many binary right shifts are needed for result to go below or equal to 0xffffff.
            byte newExponent = 3;
            while(result > 0xffffff)
            {
                result = result >> 8;
                newExponent++;
            }

            BigInteger newMantissa = result;

            List<byte> compressedResult = new List<byte>();
            byte[] newMantissaBytes = newMantissa.ToByteArray();

            compressedResult.AddRange(new byte[] { newMantissaBytes[0], newMantissaBytes[1], newMantissaBytes[2] });

            compressedResult.Add(newExponent);

            return BitConverter.ToUInt32(compressedResult.ToArray(), 0);
        }

Finally, let me add that you only compute nBits for all blocks whose blockHeight % 2016 equals zero.


text:
What is the origin of the data that the bitcoin algorithm operates on?
According to the bitcoin wiki, the data used comes from calling getwork.

getwork is a JSON-RPC defined at https://en.bitcoin.it/wiki/Getwork as "An RPC method used by a miner to get hashing work to try to solve."

After reviewing the source here: https://github.com/bitcoin/bitcoin/blob/142e604184e3ab6dcbe02cebcbe08e5623182b81/src/main.cpp#L3352 I was unable to determine the code for the GetWork method. I am mostly curious about the source of the data though. Although the bitcoin system is said to be entirely transparent, it seems to skimp on information regarding the data used.
Where/what is the origin of the data that is being worked on by the bitcoin hashing algorithm?

possible duplicate of What are bitcoin miners really solving?

@StéphaneGimenez - Your answer from the link was informative. However, it merely points out the type of data being solved, and not where it comes from. You state there is data "waiting for inclusion" but give no source as to where that data originates.

Maybe you should clarify your question then.

@StéphaneGimenez - Is that a sufficient edit? If not, feel free to make an edit or suggestion for how it would be more clear please. My main curiosity is in the source of the data. Your answer seems to imply a majority of it is just concatenation of previous hashes. But there is also inclusion of new data - where does that new data originate from?

All the data comes from peers, new transactions and recent block creations. All this is checked for validity and used generate a new block which must then be completed with the right nonce.

@StéphaneGimenez - So the entirety of data being hashed by bitcoin is generated by the use of bitcoin? Sorry if this seems naive, I am not trying to badger.

@TravisJ Yes, that's right. The client monitors the network, checks everything for validity, and determines the current blockchain. It then looks at proposed transactions and sees which are valid. The current blockchain is all that's strictly needed for mining, but miners generally try to include as many valid transactions as they can as well.

The proof of work that miners do is a double sha256 hash on 80 bytes of data.
Where do the 80 bytes come from?
They are build from enough data to describe the current block (and the transactions it contains) and a pointer to the previous block.
To wit:

4 bytes version number
32 bytes hash of the previous block
32 bytes Merkle root of all the transactions contained in this block
4 bytes timestamp
4 bytes current difficulty target
4 bytes nonce

These 80 bytes are concatenated and have the shit sha'd out of them until the required difficult is reached.
More info


text:
SCRYPT [Need Help] Radeon 5970 HD [Apparently supposed to get 750-800KH/s) @ 300kh/s
Okay, so I'm on Windows 7 and I'm only getting 300KH/s. Please help.
I'm using cgminer, I have the latest AMD drivers (Catalyst).
I'm using -T --intensity 18 -v 2 --worksize 256 --failover-only -d 0,1
GPU Specs:
730 MHz engine
1010 Memory
Also, I have to use -T in my batch file, otherwise I get a black screen.

@StéphaneGimenez ? That made no sense ?

He was pointing out your spelling mistake.  It's "otherwise".

For what it's worth, the -T flag has no influence on mining speed.  It simply disables the fancy curses-based interface, which is purely for aesthetic purposes.

There are many parameters to tweak in cgminer.  Its documentation explains precisely how to tune it, but for starters, you will probably just want to play with the intensity settings and perhaps more importantly, the --thread-concurrency flag.  Getting your thread concurrency right is crucial in getting a good mining speed.  You might start with a value of 8000.
Then you can play with more advanced flags, such as the ones that relate to overclocking.


text:
Is it possible to get the network to accept a partially signed multisig transaction?
I tried to send a half signed multisig transaction to the testnet but it got rejected.
I think this is by design but has anyone some hard facts on this?
EDIT:
I think https://en.bitcoin.it/wiki/BIP_0010 was the case I was looking for.

What could it possibly do with the transaction?!

Forward it to another node that signs it. But i think https://en.bitcoin.it/wiki/BIP_0010 is what I was looking for.

Sure, if it somehow knew there was some other node that would sign it, but how could it know that?

Why does it need to know another node signs it?

Because if another node is not going to sign it, then there's no point in forwarding it. Anyone can create an unlimited number of incompletely-signed transactions and nodes must not be willing to do unbounded work.

Anyone could create an unlimited number of signed transactions that contain no fee and point to his own address.

No, because he can only have a finite number of outputs that can be transferred with no fee, and each such transaction consumes at least one old transaction output. (If this were true, Bitcoin would be broken. Bitcoin is not broken.)

The same applies to the partially signed multi sig transactions.

No. There is no limit to the number of partially-signed multi-sig transactions you can form. You can create any number of such transactions that spend the same output.

The network will only forward transactions that are valid. That is they only claim so far unclaimed outputs and contain all the necessary signature scripts. Your transaction does not contain valid signature scripts, hence it's not valid and will be dropped by the nodes in the network.


text:
How is the wallet balance split across keys?
I suppose it's advisable to use a new key frequently for bitcoin receive address for anonymity. If each received amount goes to a new key, will my wallet size become unmanageable if I receive a number of small amounts per month ?
If yes, how can I consolidate all the coins split across 100s of keys in case my wallet is compromised and move it to a new wallet?

It is foreseeable that the number of private keys that you must maintain may grow  to an unmaintainable level.
The most common sense way to consolidate is to send your balance to a single address. This, however, effectively announces that all of those previously created addresses are linked to the same wallet.
If you really must maintain anonymity, then you could send the balance to a tumbler, and have that tumbler output different amounts to several different addresses you control. This, however, does have a cost, because tumblers are not free. Another alternative to a tumbler service is to send your balance to a web wallet that pools all bitcoin together (ledgering internally) and manually send different amounts to separate, new address. However, any time a balance exceeds one of those addresses' balances, it's likely that more than one will be used for the transaction, thereby linking them.

If I don't care about staying anonymous, will consolidating require that I manually transfer all the amounts from each key to 1 consolidation key. Will that cost me a fee per transaction?

No, your wallet is able to combine the balances together. Really, an address's balance is comprised of outputs, and a wallet's balance is comprised of address balances. Your client software can combine all of the outputs together and send them as a single output to a single address, meaning you can care about a single private key that corresponds to that receiving address. You may want to keep those other addresses' keys around, though, even if in cold storage, in case someone erroneously sends a transaction to one of them!


text:
How can one gauge the reliability, customer service, and transparency of bitcoin exchanges?
There are several exchanges for Bitcoin with a few highly respected ones like Mt.Gox, Bitstamp, bter, bit-e etc. I understand the reason why they require verification of users by supplying their bank information along with government ID and address proof. However, most of these exchanges decide to keep themselves anonymous to an extent. They don't mention the founding/management team on their website. I'm sure it's possible to find out for some by googling. I don't feel comfortable that they want all the information from me without disclosing anything about themselves.
This also raises the question about what level of security practices and audit do they have in place. I have read several stories about hacking of exchanges, stolen databases/wallets, nightmare to withdraw money etc.
Is there a source of information that compares these exchanges in terms of real world incidents, fee structure, and the backing team behind them? Basically looking for a reliability and customer service rating.
Edit : After Mt Gox's supposed failure, this question feels more relevant. I find myself fortunate that I avoided them. Especially since there were news about a large scale customer data loss.

This would be a nice to have but as you said, with very little audibility of their team and how they run their operation something like this essentially cant / would struggle to exist.

I once wrote an open letter to MtGox and Bitcoin Exchanges in general. I believe MtGox replied it appreciated the feedback and would present it on their next management meeting. Nothing changed.

Are the operators anonymous?  If so, this represents the highest possible risk.
How regularly does the exchange prove that it is solvent?  This is possible to do with cryptography.  If an exchange isn't doing it, its users should be asking why.
Is the exchange insured?  Having someone else's money on the line (and lots of it) can be a good way to help protect your own.  They might not let you behind the scenes as an individual but for an insurer to issue a contract, they will certainly be doing some due diligence.
The space is nascent enough and evolving so rapidly that trusted independent auditors (e.g. a Moody's, Fitch, or S&P) have not yet emerged.  They will but until that time, the onus is on the individual to tread carefully.
Ask on IRC.  Go to freenode #bitcoin and ask.  You might be surprised at what you will learn.  A lot of folks who got goxxed could have avoided their fates by doing this.
Read this: https://bitcointalk.org/index.php?topic=576337 (List of Major Bitcoin Heists, Thefts, Hacks, Scams, and Losses) for some perspective.
Finally, I would recommend the following:
Hold some BTC yourself, if you feel technically capable of doing so.  Use cold storage best practices.  (Practice these procedures with trivial amounts until you feel comfortable).
https://en.bitcoin.it/wiki/How_to_set_up_a_secure_offline_savings_wallet
Partition the rest of your holdings across several trusted, publicly visible entities such as BlockChain.info, CoinBase, and Xapo.
Use email addresses to register that have multifactor authentication enabled (such as gmail) and then enable multifactor authentication on the sites themselves.  Use unique, strong passwords.

If you do all of this, you will achieve a high level of security, distribute your risk, and you'll also learn a lot along the way.

How can one gauge the reliability, customer service, and transparency of bitcoin exchanges?

I totally agree that Bitcoin feels like the wild west, with people selling snake oil left and right.  It is early days, and that's how it works. If you want to be a pioneer, you will get arrows in your back. Right now, it's gambling, even more risky than gambling on the Stock Market.
If you're not comfortable with that, then wait. Down the road, there will be an influx of reputable exchanges. Right now, a "good" exchange won't make any more money than a fly-by-night exchange. But over time, the average reputation will increase.
The Internet worked the same way. Every Newspaper had an article on "Is the Internet a fad?" and warned "never use your credit card on the Internet". (Of course, kids these days don't even know what a newspaper is.)

How can one gauge the reliability, customer service, and transparency of Banks or Retailers?

Think of how many reputable retailers had their credit card database stolen in the last 6 months. Think of how many banks went out of business without warning in 2008.
People are reporting on bitcoin exchanges that loose a few million, but nobody reports when a grocery store goes under and looses a few million.

I think the best way to gauge exchanges is based on their structure, the information they provide to the public, and their overall features. Exchanges are not banks (yet), so there is no set regulations for them to follow especially if the exchange is located outside the USA. Is the exchange proactive about security and precautions-also if an incident occurs is there some point of contact for more information? Some exchanges don't even have a customer support service, so that would be the first thing to check for. Second does the exchange openly tell you about it's structure, provides all the conditions to usage and terms upfront? Someone in another answer mentioned AML policies and that's only one possible indicator. Last you want an exchange that has a good selection of coins, can hold your coins safely, is NOT at the risk of insolvency, has an interface that is intuitive, but provides enough information to perform the desired tasks. Cryptsy.com happens to meet all those conditions. I can only mention Cryptsy because thats the one I know the insides  of and can speak as an authority.

Based on their compalince , KYC and AML policies.

Compliance is, them covering themselves from prosecution.


text:
How to test RBF on Testnet?
I'd like to do RBF testing on testnet. I'd like to simulate a transaction with too-low fees, aka "stuck" transaction, and then RBF it in various ways.
Problem is, all testnet transactions are added to the next block due to mostly-empty mempool and 1 sat/B fee rate.
Is there a clever way to create a transaction that sits in the testnet mempool, which can be later mined after RBF?
Didn't the developers of RBF test their code on testnet?


text:
No new UpdateTip. Just "Pre-allocating up to position ..."
I'm IBD'ing a new testnet node 0.21.0
Why are there long periods of no UpdateTip messages?  I have 10 connected peers.
Excerpt starting at 00:13:
2021-04-05T00:13:17Z UpdateTip: new best=000000000000005b0a40663b50cf4588f8dfd9c18bbbe8696fe2b549c893fbe4 height=1382700 ...
Then there are lots of pre-alloc messages and no UpdateTip messages:
2021-04-05T00:36:32Z ping timeout: 1200.048936s
2021-04-05T00:36:55Z New outbound peer connected: version: 70015, blocks=1969990, peer=737 (full-relay)
2021-04-05T00:39:17Z Pre-allocating up to position 0x7000000 in blk00112.dat
2021-04-05T00:43:15Z Pre-allocating up to position 0x8000000 in blk00112.dat
2021-04-05T00:44:59Z Socks5() connect to 165.231.163.24:18333 failed: general failure
2021-04-05T00:46:22Z Leaving block file 112: CBlockFileInfo(blocks=167, size=133222507, heights=1382791...1383090, time=2018-08-10...2018-08-11)
2021-04-05T00:46:22Z Pre-allocating up to position 0x1000000 in blk00113.dat
2021-04-05T00:47:43Z New outbound peer connected: version: 70016, blocks=1969991, peer=738 (full-relay)
2021-04-05T00:47:46Z Synchronizing blockheaders, height: 1969991 (~100.00%)
2021-04-05T00:49:10Z Pre-allocating up to position 0x2000000 in blk00113.dat
2021-04-05T00:50:18Z Socks5() connect to 2001:19f0:6001:3bf2:5400:2ff:febc:2f63:18333 failed: general failure
2021-04-05T00:51:03Z Pre-allocating up to position 0x3000000 in blk00113.dat
2021-04-05T00:51:43Z ping timeout: 1200.026721s
2021-04-05T00:51:44Z ping timeout: 1200.029607s
2021-04-05T00:51:57Z New outbound peer connected: version: 70015, blocks=1969991, peer=740 (block-relay)
2021-04-05T00:52:50Z Pre-allocating up to position 0x100000 in rev00113.dat

After about 40 minutes (why?), there is a new UpdateTip finally:
 2021-04-05T00:52:50Z UpdateTip: new best=00000000000000c771e3ffe2108fe02768164469d366e2f48c9e8b4ef7eeae54 height=1382701 version=0x20000000 log2_work=71.161934 tx=28150831 date='2018-08-10T05:40:01Z' progress=0.470404 cache=2824.5MiB(20668057txo)
2021-04-05T00:52:50Z UpdateTip: new best=00000000000000ad0e7806e25ae3628c709cbfd1eb100e8b4aeebf326fc603d9 height=1382702 version=0x20000000 log2_work=71.161974 tx=28152664 date='2018-08-10T05:44:22Z' progress=0.470435 cache=2824.6MiB(20668080txo)
I inspected machine health: Very little io-wait, and cpu is quite idle:
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0 1523548 477268 133600 5865132    0    0    18    29    4    3  6  0 93  1  0
 4  0 1523548 477836 133600 5866108    0    0     0   580 3894 7616  2  1 91  6  0
 1  2 1523548 477648 133600 5866140    0    0    32   400 3650 6994  2  1 88  9  0
 0  1 1523548 477420 133600 5866140    0    0     0   452 4403 8249  1  2 91  6  0
 1  2 1523548 477696 133600 5866140    0    0     0   700 4414 8394  1  1 92  6  0
 0  1 1523548 477004 133616 5866140    0    0     0  1512 3007 4780  1  1 80 19  0
 2  1 1523548 476420 133616 5866144    0    0     0   460 4536 8690  2  2 92  5  0
 0  1 1523548 475532 133616 5866220    0    0     0   480 4616 9066  1  2 93  4  0
 2  1 1523548 475428 133616 5866220    0    0     0   480 4568 8689  1  2 92  5  0

Quad-core, Intel i7-3740QM CPU @ 2.70GHz. I am using conventional hard disk (platters).
I'm curious what might cause the delay. Reviewed the log and IBD seemed to progress steadily until this time.
I searched here and google but could not find an answer.
Update: I thought the multiple pre-alloc messages was a symptom of an issue. But now I'm thinking that's a red herring, and the real issue might have been instability (or other network issue) in the Testnet network at that time.  A few hours later, I was seeing a steady pace of UpdateTip messages again.

If you're seeing pre-alloc messages but no UpdateTip messages, it means that you're receiving blocks from peers, but not the next block you need.
Bitcoin Core tries to spread downloading of blocks among multiple peers. However, once a block has been requested, it won't get requested again as long as that request is still outstanding with the peer it's already requested from - until that peer goes offline, or the request times out (at which point the peer is disconnected too).
However, validation requires consecutive blocks, eventually. If we've processed all blocks until number N, we need block number N+1 to continue. It's possible that the request for block N+1 was sent to a non-responsive peer, while other blocks (N+2, N+3, ...) are requested from other peers who are responding. Validation won't proceed until N+1 is received. There are some heuristics to detect such straggling peers and disconnect them (you'd see "Peer X is stalling block download" messages when this happens, I believe), but it's not perfect.


text:
CGMiner freezing on anything above intensity 16
I have 2 x Sapphire 7950 Boost cards running on Windows. I can only get them running stable on intensity 16 using CGMiner. Anything above that and the whole system freezes up (screen stays on but everything else is unresponsive).
Previously I had them on linux running BAMT, and I could get them running fine on intensity 18/19 for longer.
So I'm positive the cards should be able to handle greater than intensity 16, and I have two more PC's with just a single card in running around 600 KH/s, so I know they can.
What could be causing the system to freeze?  Is it the cards or could it be drivers etc?  Theyr'e only clocked at 1000/1250, with 24768 for thread-concurrency. Nothing over the top, and settings which are fine on the two single card PC's.
Here's my config file:
"kernel"            : "scrypt",
"scrypt"            : true,
"no-submit-stale"   : true,
"temp-cutoff"       : "85,85",
"temp-overheat"     : "80,80",
"temp-target"       : "70,70",
"auto-fan"          : true,

"api-listen"        : true,
"api-port"          : "4028,4028",

"intensity"         : "16,16",
"vectors"           : "1,1",
"worksize"          : "256,256",

"lookup-gap"        : "2,2",
"thread-concurrency": "24768,24768",
"gpu-engine"        : "1000,1000",
"gpu-fan"           : "0-90,0-90",
"gpu-memclock"      : "1250,1250",
"gpu-memdiff"       : "0,0",
"gpu-powertune"     : "0,0",
"gpu-vddc"          : "0.000,0.000",

"expiry"            : "30",
"gpu-dyninterval"   : "7",
"gpu-thread"        : "1",
"sharethreads"      : "32",
"log"               : "5",
"queue"             : "1",
"retry-pause"       : "5",
"scan-time"         : "30",
"temp-hysteresis"   : "3",
"shares"            : "0",

"kernel-path" : "/usr/local/bin"

The temperatures are fine by the way, they're only reaching 76 max, so this can't be the issue.

I eventually figured out this problem, and it was solved by lowering the voltage on the cards to 1100 or 1150.
Stock Sapphire 7950 boost cards are volted at 1250, and when running both cards concurrently it was making the system unstable and thus it would crash.  Even so, I would have expected a Corsair CX750 to still be able to handle them both, but it seems not.
Lowering the voltage through Sapphire Trixx makes the whole rig stable, and I can now run at 18/19 intensity without any problems. Heck I might even try 20 soon ;)
Hope this helps anybody out in the same situation.

Your question "fixed" my problem.  I have a computer with 4 X Saphire HD 7950 and I am dealing with the same problem.  I think it's power related issue but I have a 1300 gold rated unit...  I used to just have it sit at 13 intensity while I figured out this but now I can sit it at 16!  Anyways I don't want Munch to get angry at me so I'll add a bounty on the "if" someone could resolve this $5 of BTC will be heading their way.


text:
How do I set up a fee for my p2pool node?
I'm running a p2pool node for dogecoin.
Since running the node costs me some money, I set up a small fee with
./run_p2pool.py --give-author 0 --net dogecoin -f 0.5 -a DSomeDogeAddressIOwn DOGEUSER DOGEPW

but I don't seem to get any fees.
The local hashrate is around 10 MH/s, so I should get at least a few dogecoins.
Basically I used this setup: http://doges.org/index.php/topic,5586.0.html
It is running on an Ubuntu 12.04 Server, everything else works.
When I use the webinterface, "http://example.com:22550/fee" displays '0.5' as expected
Am I missing something?

You may want to add what software you are using to run the pool, with a link to it.

Found out why I'm not seeing the fees:
The fee payouts are of type 'mined' so in the client history, they don't show up with an address.
http://dogechain.info/chain/Dogecoin/q/addressbalance/DMYSTUPIDADRRESS
Told me that there must have come some coins in.
Wow, such joy!
Edit:
seems like the new client shows to which address it was mined.


text:
pycoin command line transaction
Is there a quick way to do transactions knowing only the private key(secret exponent) and the destination address, preferably from a command line utility such as pycoin?
I am using Debian/Ubuntu and python 2.7.

You'll need to clarify what OS and Python version you're using. Assuming Win/Posix, Python 2.7 pybitcointools has an excellent CLI. Although I do agree that Pycoin is a great tool for simplicity. More complicated usage cases under posix could use SX/libbitcoin

I am currently using Ubuntu with python 2.7.6.

In order to create a transaction, you need the blockchain, or at least the transactions in the blockchain that belong to a particular address (technical term would be unspent transaction outputs or UTXOs for a particular script). There are three ways this can happen:

You have a local bitcoind or btcd installed which would let you query for transactions, at the expense of downloading the entire blockchain.
You use an electrum or some other SPV server to query for transactions, at the expense of connecting to these nodes.
You use a centralized service such as blockchain.info to gather all transactions at the expense of having to trust the centralized service to be up all the time and to not be corrupt.

Any way you slice it, you cannot get the transaction data from a python library that doesn't connect to some other service. Hence tools like pybitcointools or pycoin will not get you what you need. sx has some tools to look up utxos using method #3.
You can install Armory or bitcoind and import the private key and use method #1 above or use something like pi-wallet and use method #2.

For Ubuntu, Python 2.7 (same setup as me) I'd highly recommend either:

pybitcointools (install using pip install pybitcointools for version 1.1.15 or pip install bitcoin for version 1.1.25 (recommended)
sx/libbitcoin. Might need to install using mastercoin's install.sh script, depending on whether dependencies work (I had issues using Tasty Tahr Ubuntu 14.04).

Both are CLIs, and both work similarly allowing piping of variables, etc. However pybitcointools seems to support the address history function (API call to Blockchain.info/Blockr.io) and the support documentation for pybitcointools seems to be more self-explanatory than the brief sx tutorial.

+1 Do you happen to have an example of how to perform a transaction knowing only the WIF and a destination address?

From the manual page it is not very clear to me how the destination address is specified.

Sure. I'll do it once I'm off iOS. I'll need to play around and I'll post it here in ~12hrs

@Sebi just to clarify, you want to create a raw Txn and send BTC from your address (ie private key) to another address, right?

yes that is what I want

OK, I'll edit accordingly. SX tools is how I have gone about it in the past. Read https://bitcoin.stackexchange.com/questions/32219/ubuntu-14-lts-with-sx-tools-installation-issues/32411#32411 if you're having dependency issues as I'll put procedures for both SX and pybitcointools

See http://bitcoin.stackexchange.com/a/35889/9382

Using SX tools.
At bash command line, create a WIF private key file called private.key for 1MBngSqZbMydscpzSoehjP8kznMaHAzh9y with this data inside:  5HvofFG7K1e2aeWESm5pbCzRHtCSiZNbfLYXBvxyA57DhKHV4U3. FYI, the private key (as discussed here) is a brainwallet of mrbubbymrbubbymrbubby! (which is cool, because 1MB ≈ brainwallet phrase)
OK, now we run these aliases/commands in the exact order given (node comments explaining each step):

DECODED_ADDR=$(cat private.key | sx addr | sx decode-addr) # hash160
PREVOUT_SCRIPT=$(sx rawscript dup hash160 [ $DECODED_ADDR ] equalverify checksig)  # hash160 + script padding
SIGNATURE=$(cat private.key | sx sign-input txfile.tx 0 $PREVOUT_SCRIPT)   # 72 digit der signature
SIGNATURE_AND_PUBKEY_SCRIPT=$(sx rawscript [ $SIGNATURE ] [ $(cat private.key | sx pubkey) ])  # 278 digit script/sig/pubkey
sx set-input txfile.tx 0 $SIGNATURE_AND_PUBKEY_SCRIPT > txfile.tx.signed    # 192 digit signed txn

In this instance, the aliases give the following:

DECODED_ADDR=dd6cce9f255a8cc17bda8ba0373df8e861cb866e
PREVOUT_SCRIPT=76a914dd6cce9f255a8cc17bda8ba0373df8e861cb866e88ac
SIGNATURE=3045022100da43201760bda697222002f56266bf65023fef2094519e13077f777baed553b102205ce35d05eabda58cd50a67977a65706347cc25ef43153e309ff210a134722e9e01
SIGNATURE_AND_PUBKEY_SCRIPT=483045022100da43201760bda697222002f56266bf65023fef2094519e13077f777baed553b102205ce35d05eabda58cd50a67977a65706347cc25ef43153e309ff210a134722e9e0141042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9

FINAL SIGNED TXN:
Here's the final raw Txn which sends BTC to 14zWNsgUMmHhYx4suzc2tZD6HieGbkQi5s.
0100000001be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396000000008b483045022100da43201760bda697222002f56266bf65023fef2094519e13077f777baed553b102205ce35d05eabda58cd50a67977a65706347cc25ef43153e309ff210a134722e9e0141042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9ffffffff0123ce0100000000001976a9142bc89c2702e0e618db7d59eb5ce2f0f147b4075488ac00000000
File Contents:
private.key = 5HvofFG7K1e2aeWESm5pbCzRHtCSiZNbfLYXBvxyA57DhKHV4U3
txfile.tx = 0100000001be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d53960000000000ffffffff0123ce0100000000001976a9142bc89c2702e0e618db7d59eb5ce2f0f147b4075488ac00000000
rawscript.sigpubkey.tx = 473044022054f60e8ae19411541597167362d12fc132e081a546c766bfd69c16d9d58e268a022048055c7fd8bf78e48543e8756bb3b26336df35b812a184119ba0e9d525bbb8aa0141042daa93315eebbe2cb9b5c3505df4c6fb6caca8b756786098567550d4820c09db988fe9997d049d687292f815ccd6e7fb5c1b1a91137999818d17c73d0f80aef9
signed.tx = 0100000001be66e10da854e7aea9338c1f91cd489768d1d6d7189f586d7a3613f2a24d5396000000000b00000c0000000000000000ffffffff0123ce0100000000001976a9142bc89c2702e0e618db7d59eb5ce2f0f147b4075488ac00000000

here is an example of transaction on testnet(https://github.com/suhailvs/bitcoin-code/tree/testnet), you need private key,destination address and previous transacion hash which has output address which relate to the given privatekey::
import hashlib
import txnUtils
from keyUtils import keyToAddr, addrToScriptPubkey

# From --> one input
privateKey = hashlib.sha256('abcdefghijklmnop').hexdigest() # mpSyb71528U8dQjuTCeDCcJqH8dQTyY13c
from_address= keyToAddr(privateKey,testnet=True)
txn_hash = "3c24ca820100153fb43434191d10464dd2dcd13f0c9aa07d15f7330e8bcd0596"

# To --> android testnet wallet
to_address = 'miD4PnSDWC2M725hvFBoBhNn8fbowoHnnS'

# Sign the Transction
signed_txn = txnUtils.makeSignedTransaction(
    privateKey, txn_hash, 0, addrToScriptPubkey(from_address), # input: has balance 0.01btc
    [[900000,addrToScriptPubkey(to_address)]] # outputs: 0.009btc
)

print 'SIGNED TXN', signed_txn

# Broadcast this transaction(ie: signed_txn) at:
# https://testnet.blockexplorer.com/tx/send


text:
Bitcoin ABC, When Fed Bitcoin Core Chain Syncs to Aug 1 6:23AM 2017, Then Freezes
I've installed Bitcoin ABC, set bitcoin.conf to point at a copy of my directory from Bitcoin Core, and let it sync with the network.  All was well until it froze at the fork (Aug 1, 2017, 6:23AM).  The client is responsive, but my progress doesn't budge and the "Estimated time left until synced" stays at "calculating..."  At first I thought I had some kind of network error, but that doesn't appear to be the case.  I have 8 active connections.  Why won't it move beyond this point, downloading the post-fork transactions?
Bitcoin ABC, v0.16.2.0-unk on Ubuntu 17.10 (Mate).

What do you mean by "fed it my chain from Bitcoin Core"? Did you copy Bitcoin Core's blocks folder? Or did you copy the entire data directory? Or are you connecting it only to a Bitcoin Core instance? Either way, that time is the time of the fork, so Bitcoin blocks will no longer be valid to Bitcoin ABC and it will need to sync off of the Bitcoin Cash network.

I copied the entire directory, except I gave it an empty wallet, which I then connected only to a Bitcoin ABC instance running on another machine.  My question is why it doesn't continue after the fork, syncing off of the Bitcoin Cash network.

You copied the entire chainstate too, which will confuse the node and cause it to be unable to continue syncing because the chainstate says the Bitcoin Cash chain is invalid and the node things that the chain it is currently using is also invalid. You can fix this by removing the chainstate, in which case it will begin reindexing.
However this may not fix all of your problems because the Bitcoin chain is still on disk and it will still index and verify that. So you may need to delete some of the blk*.dat and rev*.dat files (the higher numbered ones) in order to get it to revert to a state before the fork and then sync Bitcoin Cash from that point onwards.

Details are that we copy the .bitcoin directory, but remove the .bitcoin/chainstate directory.  If you run the client now, it will freeze again when it gets to the blk*.dat files that are beyond the fork.  By running it while also running:
watch -n 1 'sudo lsof -c bitcoin | egrep -o "bitcoin/blocks/(blk|rev).*dat" | uniq | sed -E "s/^.+$/&   `date`/" | tee -a recent.blk'

and
watch tail recent.blk,
I was able find that the files that need to be deleted are .bitcoin/blocks/{blk,rev}00953.dat and above.  That is, keep 00000 to 00952.  Then when I ran the client again, it worked.  After the fork, it synced with the network.  You can save yourself running it twice by just going ahead and deleting both the chainstate/ directory and the relevant files in blocks/.  When you run the client, it will say, "Error loading the block database, do you want to rebuild now?"  Respond, "Yes", and then  it will say "Reindexing the blocks on disk", followed by "Syncing the Headers (478436)".  That last number is the number of blocks in blk00000.dat through blk00952.dat, and just preceeds the fork at 478558.

So my first step is to remove the directory "chainstate", correct?  Then, if I have to, how do I tell how many blk/rev files to remove from the end.  The whole point of this exercise was to avoid re-downloading the whole blockchain.

I removed "chainstate" and it's syncing headers again, all the way from the beginning.  It's going to take some time.

Yes, first remove the chainstate directory. For the blk*.dat and rev*.dat files, look at the sizes of the highest numbered blk*.dat files. Divide that size by 1 MB. That tells you at least how many blocks are in that file. Then delete files starting from the highest numbered until you have passed the number of blocks since the fork point. Delete the same number of rev*.dat files.

Ok, thanks.  There is a directory called "index" in the "blocks" directory.  Will I need to do anything with that?

No. When you delete the files, you will need to reindex, and that folder will be cleared and rewritten

As I resync after having removed the chainstate directory, I am running watch -n 20 'sudo lsof | egrep -o "bitcoin/blocks/(blk|rev).*dat" | uniq | tee -a recent.blk'  That way, I get a list of block and rev files that have been opened, listed in recent.blk, and I can see which one was open last.  When this is done, and if needs be, I'll just delete from there on.

In addition to the chainstate directory, I had to remove the blocks/{blk,dev}*.dat files from #00953 on (so keep up to #00952).  After reindexing, it is now syncing headers for the 3rd time, and this seems the slowest of the three.  It will take days.  And I'm just assuming that this time it will progress beyond the fork.  I really think I should have just DL'd the whole blockchain again, from the beginning.


text:
Bitcoin Core Re-install- Don't want to Overwrite Chain Previously Downloaded
I have a full Bitcoin chain that I downloaded using Bitcoin Core (v.0.18.0.0, from Ubuntu's launchpad bitcoin ppa).  I've moved to another machine and installed the Snap linked from BitcoinCore.Org, pointing it at my .bitcoin directory.  When I run it, I get the following message.  Before I hit "OK", I want to make sure I'm not going to nuke my already downloaded chain.  Can anyone confirm?

As this is the first time the program is launched, ... Bitcoin Core will download and store a copy of the Bitcoin block chain....  The wallet will also be stored in this directory.
[ ] use the default data directory
[x] use a custom data directory
When you click OK, Bitcoin Core will begin to download and process the full Bitcoin block chain (320GB) ....
[ ] Discard blocks after verification, except most recent 2 GB (prune)

Also, it's been a while since I looked, but the Ubuntu PPA stable channel is now saying:

NOT MAINTAINED. The OS-library linking packages here had a series of issues.
PLEASE DOWNLOAD DIRECTLY FROM bitcoincore.org ...

Is there any chance running that Snap might cause any issues with my wallet and already downloaded blockchain?

The Snap (v.0.20.0) is having various issues, some of which are mentioned here.  As mentioned above, the Ubuntu PPA is saying that it shouldn't be used.  There is apparently a second PPA that is at least semi-official.  That works and doesn't overwrite my chain.


text:
Using Bitcoin Core on Ubuntu. How to claim BCH & BTG while keeping whole BTC blockchain?
I'm using the Bitcoin Core client on Ubuntu.  I've got the whole ~170GB blockchain on my hard drive.  I'd like to be able to claim my BCH and BTG while preserving that blockchain, though if I don't have to keep multiple copies of the chain from before the forks, that would be optimal.  Does anyone have a suggestion of what wallet(s) and procedures to use?  Note that since the splits, I have had a single transaction out of the wallet which is, unfortunately, sitting in limbo.

@Adam - that doesn't appear to be a duplicate because (1) it doesn't discuss BTG, and most importantly (2) it appears to necessitate my having two copies of the whole chain.  Please correct me if I'm wrong.

Are you planning on keeping the forked coins locally too? In that case you'll need the forked blockchains. I guess theoretically you could share the common pre-fork data between chains, but it looks tricky and if a client changes their blockchain database structure in the future it'll break.

@Adam.  I see.  Ok, yes, the plan is to keep them all locally.  So in this case, I will just have to get an extra hard drive or two for this.  I'm reading on claiming BCH now, so it looks like I'm left with my question (1), claiming BTG.  Also, I'm vague on whether this post-fork limbo transaction will create any obstacles.

The process is no different for BTG. Use a Bitcoin Gold client, import your wallet or keys. Backup your Bitcoin wallet first to make sure it doesn't get overwritten by software or user error in the process.

try this

@Adam - So I've been poking around with bitcoinabc on ubuntu.  What I see is that if I install it, it writes over the bitcoind and bitcoin-qt binaries of the Bitcoin Core, replacing them with its own.  So there's no way to run these side by side, even if I keep two copies of the blockchain.


text:
Retrieving all the funds from BIP32 derived wallets
An ecommerce site is using BIP32 wallets for receiving order payments from a tree of child keys where each leaf node is unique to one purchase transaction.
Is it common for the site to immediately send the received coins to its superwallet (master node) upon X confirmations? If so, how would you go about sending all the coins in the entire tree of child keys (which can be tons of nodes depending on the number of transactions) to the super wallet?
And how would u know when a payment is sent to one of the derived addresses?
Let's assume the case with a derivation path of m/k'/0/i, where m is the master node, ever user has a k node and i is his i'th purchase transaction.

Is it common for the site to immediately send the received coins to its superwallet (master node) upon X confirmations?

No. Not at all and would normally be considered very bad practice as in bitcoin you don't spend from addresses but from transactions, so "accumulating" in one address doesn't really work. Sending from that address would again have to reference all the forwarded transactions. (There are special cases like green address in its original implementation but no, that's a thing of the past.)

And how would u know when a payment is sent to one of the derived addresses?

You watch the bitcoin network? Either through proxies or with a full node. Check out the insight.bitpay.com API.

Let's assume the case with a derivation path of m/k'/0/i, where m is the master node, ever user has a k node and i is his i'th purchase transaction.

I would strongly advise to hold that logic in the server, only.
eCommerce sounds like one central server, so there is really no big need to fan out too much in the HD wallet structure. You should also look into BIP44 on transaction discovery.
Your business logic has to keep track what purpose an address has but if that website never has to send refunds, it would typically only have an extended public key. Now if it receives to
m / 44' / 0' / i' / 0 / j

any bip44 compatible wallet would find and be able to spend the funds if you provided it with at least the xpriv key for
m / 44' / 0' / i' / 0

but typically
m / 44' / 0' / i'

One minor thing you have to keep track of, is the gap between addresses that don't receive a payment. If your server observes a gap of more than 20, you would have to help your wallet to find those funds if it's strictly bip44 which would only bridge gaps up to 20. If your last transaction is to index 1220 and you don't see transactions to 1255 and 1257, you could send a satoshi to 1239 and your wallet would find the rest.

Is it common for the site to immediately send the received coins to its superwallet (master node) upon X confirmations?

Aggregating your assets coming from tons of transactions into a single address is not necessary, but it's not that uncommon. It can be practical if the volume of addresses holding some coins becomes unmanageable (the exact number depends on your wallet software, system resources, etc.).
If this happens, you can simply send those coins in a big transaction with multiple inputs (in order to save on tx fees) to an address managed by your "master node".

And how would u know when a payment is sent to one of the derived addresses?

The same way as you knew before. You can keep watching the address after you've transfered the funds to you master address. If needed, you can make another aggregation transaction later again.


text:
Trouble running bitcoin unit tests with test_bitcoin on Ubuntu
From Bitcoin Core's test directory (bitcoin/src/test), the executable test_bitcoin is supposed to run the unit tests. When I run test_bitcoin, however, I get:
replication requires locking support
Test setup error: std::runtime_error: CDBEnv::MakeMock : Error 22 opening database environment.

How can I run test_bitcoin? I installed Bitcoin from source.
Also:
I ran configure using the --with-incompatible-bdb flag.

Why don't you install the correct version of bdb? I have the correct .debs in this repository: https://github.com/nickodell/build_bitcoin Does that fix it?

@NickODell When I run build.sh I get: dpkg: regarding .../libdb4.8-dev_4.8.24-1ubuntu1_i386.deb containing libdb4.8-dev:  libdb5.3-dev conflicts with libdb4.8-dev   libdb4.8-dev (version 4.8.24-1ubuntu1) is to be installed.

It's complaining that you already have a different version of libdb installed.

@NickODell I got it to work by uninstalling libdb5.3. I also had to reinstall the 64 bit version of libdb4.8-dev due to some packaging problem, but now it is working. Thanks! Also: how should this be written up as an answer so that users can see that this question already has been answered?

Try installing the correct version of BerkleyDB. (4.8) I have the correct .debs in this repository:
http://github.com/nickodell/build_bitcoin
You may need to uninstall the newer version of libdb first.


text:
Is there any way to make a transaction invalid if it is not confirmed before a certain block?
It seems like it would be useful to avoid replay attacks if your wallet could specify that a transaction must be confirmed before say the (current+100)th block before broadcasting it
I guess there could be a problem with this scheme if the tx was no longer able to be included into a block after a reorg (esp for dependent txs)

I don't know of any way to accomplish that.  Can you be more specific as to what kind of "replay attack" you are worried about?

here is an example http://qntra.net/2016/03/a-miner-problem/

This is not an attack. This is total misunderstaning how the Bitcoin network works.

In a scenario of permanent backlog of transactions this scenario will need better strategies however

No, there isn't a way to make a transaction that has to be included before a certain block number.
And there's a good reason for this: such a transaction would not be what is known as reorg-safe. Generally, transactions should be able to be included in either side of a block chain fork. If you make a transaction that can only be included before a certain block number, and then a fork occurs that makes a chain that doesn't include it before the designated block number, then that transaction gets reversed and so do all transactions that depend on the base transaction.


text:
Alternative chain shows blocks with empty TXIDs - what's going on?
An alternative chain based on Litecoin 0.8.6.1 that I have an interest in is during certain low-difficulty periods showing several blocks that contain empty TXIDs. Digging into the TXIDs return nothing with gettxout, and "No info available" with getrawtransaction. Usually these blocks contain just a single empty TXID, but some blocks can contain normal TXIDs as well as an empty one.
What's the cause of this? What action can create these empty blocks with no apparent transaction or coinbase content in them? Can it be rectified?

maybe client is not indexing the transactions.
I'm having this problem and apparently running yourcoind -txindex (or txindex=1 in the conf)  and afterwards run with -reindex will fix the issue
when I run this command it just hangs but it looks like it's actually doing something which might take a long time. I may have to start from scratch with those changes added first


text:
There are Argentina's friends?I want to buy BTC with Pesos
I want to try using the ARS to buy BTC in Argentina and selling the BTC for RMB in China, so as to ecnomic losses from the traditional way of International remittance.Is the method feasible?I am in China and want to know about some information related to the deal.

Welcome to the site. Related questions have been asked a number of times. In short: If you're in China there are several exchanges willing to buy/sell bitcoins in exchange of yuans, like btcchina.com or okcoin.com . Once you're in Argentina you can locate people willing to trade in person for you via localbitcions.com - you'll find a lot of Argentinians willing to trade.


text:
Can't connect locally with API
I try to connect locally  with bitcoin client using the API but I get 404 on request
 testnet=1
 server = 1
 rpcport=8332
 rpcuser=myuser
 rpcpassword=mypass

I was installing bitcoind on ubuntu server with apt-get install bitcoind
PHP API Call
 $_credintials = array('btc' =>'http://myuser:mypass@127.0.0.1:8332');
 //or
 $_credintials = array('btc' =>'http://myuser:mypass@127.0.0.1:18332');
 $this->load->library('jsonRPCClient');
 $this->bitcoin = new jsonRPCClient($this->_credintials['btc']);

var_dump();
Message: fopen(http://...@127.0.0.1:8332): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

Update
Compiling bitcoind from github resolved the issue

first of all, you shouldn't be using fopen.
second of all you you obviously don't have rpcallowip set to whatever your ip is.
two things that will help you here:
this modified jsonrpc written by Gweedo is a secure way to connect to rpc in php. it uses curl instead of fopen. additionally, i modified this to return arrays instead of throwing exceptions, allowing you to keep log errors from your scripts silently or ignore them all together:
name this JsonRPCClient.php
/*
 * Copyright 2007 Sergio Vaccaro <sergio@inservibile.org>
 * GNU GPL LICENSE
 * The object of this class are generic jsonRPC 1.0 clients
 * http://json-rpc.org/wiki/specification
 * @author sergio <jsonrpcphp@inservibile.org>
 */
 class jsonRPCClient {
private $debug;
private $url;
private $id;
private $notification = false;
public function __construct($url,$debug = false) {
    $this->url = $url;
    empty($proxy) ? $this->proxy = '' : $this->proxy = $proxy;
    empty($debug) ? $this->debug = false : $this->debug = true;
    $this->id = 1;
}
public function setRPCNotification($notification) {
    empty($notification) ? $this->notification = false : $this->notification = true;
}
public function __call($method,$params) {
    if (!is_scalar($method)) { throw new Exception('Method name has no scalar value'); }
    if (is_array($params)) { $params = array_values($params);}else{ throw new Exception('Params must be given as array'); }
    if ($this->notification) {$currentId = NULL; }else{ $currentId = $this->id;}
    $request = array( 'method' => $method, 'params' => $params, 'id' => $currentId );
    $request = json_encode($request);
    $this->debug && $this->debug.='***** Request *****'."\n".$request."\n".'***** End Of request *****'."\n\n";
    $ch = curl_init($this->url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    $response = json_decode(curl_exec($ch),true);
    curl_close($ch);
    if ($this->debug) { echo nl2br($debug); }
    if (!$this->notification) {
            if ($response['id'] != $currentId) { return $response; }
            if (!is_null($response['error'])) { return $response; }
            return $response['result'];
    }else{
            return true;
    }
}
}

a basic wallet.class.php for you to use
name this wallet.class.php
class Wallet {
public $ip;
public $port;
public $username;
public $password;
public $Client;
public $credentials;
function Wallet($credentials)
{
    foreach($credentials as $row)
    {
        $ip = $row["ip"];
        $us = $row["user"];
        $pa = $row["pass"];
        $po = $row["port"];
        $ac = $row["acr"];
    }
    $this->ip        = $ip;
    $this->username  = $us;
    $this->password  = $pa;
    $this->port      = $po;
    $this->acronym   = $ac;
    $this->Client    = new jsonRPCClient('http://' . $this->username . ':' .$this->password . '@' . $this->ip . ':' . $this->port);
    return true;
}
}

now to use this functionality you simply do the following, lets call it test.php
require_once 'jsonRPCClient.php';
require_once 'class.wallet.php';
$credentials = array();
$credentials["ip"]   = '127.0.0.1';//your ip
$credentials["user"] = 'foo';//your username
$credentials["pass"] = 'bar';//your password
$credentials["port"] = '1337';//your port
$credentials["acr"]  = 'btc';
$rpc = new Wallet($credentials);//this returns true if no error during connection.
if($rpc === true) {
    $info =$rpc->Client->getinfo(); //try a basic rpc command
    echo '<pre>'; //make sure the array is printed neatly to the screen
    print_r($info, false); //dump the info to the screen
}else{
    print_r($rpc, false);//should dump the error for you
}

hope this helped, and good luck with your script.

I use the same library

no you use the original library. the one i use has been modified to replace the insecure fopen with curl and also never disclose error information

compiling bitcoind from github resolved the issue


text:
Verification of transaction once trasaction is broadcasted
I have few doubts regarding verification of transaction and am trying to find answers from last few days. I agree similar post exist in this portal but I am not getting satisfactory answer for my questions. Its also fine if you can paste link which has detailed analysis of transaction verification if its annoying to answer same questions again and again.
1) Since block is created after constant number of transactions is it the case that, until that number of transactions are accumulated all transactions remains on hold?
2) Since there is only one coinbase transaction per block does this mean that all the rewards are accumulated in single transaction and then distributed among the winners?
3) When transaction is verified what exactly it verifies and how it verifies ?
Here major part of my confusion is. As per my understanding it checks each and every transaction from beginning of time by verifying signatures to check whether given transactions are unspent or not which I feel is unpractical.
Thanks for your time

1) Since block is created after constant number of transactions is it the case that, until that number of transactions are accumulated all transactions remains on hold?

Your premise is false. Blocks are not created after a constant number of transactions. They are created whenever someone manages to create one.

2) Since there is only one coinbase transaction per block does this mean that all the rewards are accumulated in single transaction and then distributed among the winners?

No. Each block has a coinbase transaction that rewards the miner who generated that block.

3) When transaction is verified what exactly it verifies and how it verifies ? Here major part of my confusion is. As per my understanding it checks each and every transaction from beginning of time by verifying signatures to check whether given transactions are unspent or not which I feel is unpractical.

You don't have to actually do this. You just have to produce the same results as you would if you did this. Since you check each transaction as it occurs, there's an obvious optimization -- there's no need to check transactions you've already checked. That will be every past transaction.
Basically, you check that the transaction is well-formed, properly signed, doesn't spend out more money than it pulls in (unless it's a coinbase transaction), and that all the funds it pulls in come from valid transactions and haven't yet been spent.

I think I should dig more about block creation. Thanks for your answer. Regarding question 3, then how double spending is checked for broadcasted trasaction?

In a double spend, whichever transaction comes second will try to spend outputs that have already been spent. That will render the block invalid. (So no miner would create a block with a double spend as they would get no reward. But if they did, everyone would just ignore it since it's invalid.)

Ok Just consider this scenario, if I have two transactions which are assigned to me and I want to spend them, then if I try to double spend them by doing single transaction (using both as input ) today and then again using same transactions 10 years after. Is this a possible scenario and if yes will it be checked in network?

Yes, it will be checked. The system behaves as if every input of every transaction is checked to see if it was spent by any other transaction that has ever been processed. (Of course, obvious optimizations are done. For example, servers keep track of all unspent outputs so it's just a "does this set contain this value" operation.)

oohh I think here concept of index comes into picture which gives information about unspent transaction. Thank you for patiently answering my questions.


text:
What do I do if I bought Bitcoin in 2009 or 2008
I want to find the Bitcoin I purchased in the past by paying 100,000 won.
I remember back then that I made the purchase by bank transfer or phone small payment. Is this the right way to purchase it?
I think I formatted and installed Windows on the disk about 4 to 5 times. Is recovery possible? (Currently, the wallet.dat file cannot be found)
I connected the drive to another desktop, installed Bitcoin QT, and synchronized it over three days. Currently, blk files in newly installed qt are confirmed from blk04197 to blk04209. The blk file starts from blk00000.dat. Why is it created like this? If it is strange, is it correct that there should be files from blk00000.dat to blk04196.dat? If so, can you find that file?
Thank you for your reply. I am a person who does not know much about computers.

Does this answer your question? I have lost my wallet, what can I do?. Running Bitcoin QT on an old disk won't recover overwritten wallet.dat files.


text:
How to Track if Payment is Received with API in Coinbase
I am using coinbase api https://github.com/coinbase/coinbase-php and I successfully created order button but I didn't found anything to confirm or track that I have received payment.
<?php
    require_once 'lib/coinbase.php';
    require_once 'config.php';
    $coinbase = Coinbase::withApiKey(Key, Secret);
    echo $coinbase->createButton("Bullion Products", "10.00", "BTC")->embedHtml;
?>

With this codes I am able to show Pay with bitcoins its showing correct values but just want to track with API that someone send me bitcoins so I'll do some action according to it.
Thanks

Use the callback URL, it will load it on the first confirmation.
Just have it load a URL that runs a script to notify you or record the transaction somewhere.
https://coinbase.com/api/doc/1.0/buttons/create.html

Create a payment button
This will create the code for a payment button (and modal window) that you can use to accept bitcoin on your website. You can read more about payment buttons here and try a demo.
The method signature is public function createButton($name, $price, $currency, $custom=null, $options=array()). The custom param will get passed through in callbacks to your site. The list of valid options are described here.